~ubuntu-branches/ubuntu/maverick/uim/maverick

« back to all changes in this revision

Viewing changes to fep/uim-fep-tick.c

  • Committer: Bazaar Package Importer
  • Author(s): Masahito Omote
  • Date: 2006-11-23 15:10:53 UTC
  • mfrom: (3.1.8 edgy)
  • Revision ID: james.westby@ubuntu.com-20061123151053-q42sk1lvks41xpfx
Tags: 1:1.2.1-9
uim-gtk2.0.postinst: Don't call update-gtk-immodules on purge.
(closes: Bug#398530)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 
3
 
  Copyright (c) 2003,2004 uim Project http://uim.freedesktop.org/
 
3
  Copyright (c) 2003-2006 uim Project http://uim.freedesktop.org/
4
4
 
5
5
  All rights reserved.
6
6
 
17
17
     may be used to endorse or promote products derived from this software
18
18
     without specific prior written permission.
19
19
 
20
 
  THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 
20
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
21
21
  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
22
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
 
  ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 
23
  ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
24
24
  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
25
  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26
26
  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31
31
 
32
32
*/
33
33
 
34
 
#if HAVE_CONFIG_H
35
 
#include "config.h"
 
34
#ifdef HAVE_CONFIG_H
 
35
#include <config.h>
36
36
#endif
37
37
#include <stdio.h>
38
 
#if HAVE_STDLIB_H
 
38
#ifdef HAVE_STDLIB_H
39
39
#include <stdlib.h>
40
40
#endif
41
 
#if HAVE_STRING_H
 
41
#ifdef HAVE_STRING_H
42
42
#include <string.h>
43
43
#endif
44
 
#if HAVE_UNISTD_H
 
44
#ifdef HAVE_UNISTD_H
45
45
#include <unistd.h>
46
46
#endif
47
47
#include "udsock.h"
48
 
#include "uim-fep.h"
 
48
#define FALSE 0
 
49
#define TRUE 1
49
50
#define EOT 4
50
51
#define BUFSIZE 600
51
52
 
54
55
static void version(void);
55
56
int main(int argc, char **argv)
56
57
{
57
 
  char *buf = malloc(BUFSIZE + 1);
58
 
  char *prev_buf = malloc(BUFSIZE + 1);
 
58
  char buf[BUFSIZE + 1];
 
59
  char prev_buf[BUFSIZE + 1];
59
60
  const char *sock_path = NULL;
60
61
  int op;
61
62
 
99
100
    buf[len] = '\0';
100
101
    if (strcmp(buf, prev_buf) != 0) {
101
102
      puts(buf);
102
 
      strcpy(prev_buf, buf);
 
103
      strlcpy(prev_buf, buf, sizeof(prev_buf));
103
104
      fflush(stdout);
104
105
    }
105
106
  }
108
109
 
109
110
static void version(void)
110
111
{
111
 
  fprintf(stderr, "uim-fep-tick %s\n", PACKAGE_VERSION);
 
112
  printf("uim-fep-tick %s\n", PACKAGE_VERSION);
112
113
}
113
114
 
114
115
static void usage(void)