Mercurial > freewnn
comparison Wnn/jutil/atod.c @ 22:c966456648ad
- fixed argument style in function definition
- created header files for prototype check. (in progress)
- suppress warnings
author | Yoshiki Yazawa <yaz@cc.rim.or.jp> |
---|---|
date | Thu, 17 Apr 2008 01:17:45 +0900 |
parents | 790205f476c0 |
children | a7ccf412ba02 |
comparison
equal
deleted
inserted
replaced
21:22b754fbd8fe | 22:c966456648ad |
---|---|
68 #endif | 68 #endif |
69 #include "getopt.h" /* GNU getopt in the stock */ | 69 #include "getopt.h" /* GNU getopt in the stock */ |
70 #include "wnn_string.h" | 70 #include "wnn_string.h" |
71 #include "wnn_os.h" | 71 #include "wnn_os.h" |
72 | 72 |
73 extern int wnn_loadhinsi (), init_heap (), little_endian (), Sorted (), asshuku (), revdic (); | 73 /* for prototype */ |
74 extern void ujis_header (), read_ujis (), reverse_yomi (), create_rev_dict (), | 74 #include "atorev.h" |
75 uniq_je (), sort_if_not_sorted (), output_header (), udytoS (), output_ri (), exit1 (), new_pwd (), rev_short_fun (), rev_w_char (); | 75 #include "ujisf.h" |
76 extern | 76 #include "atod.h" |
77 | |
78 /* prototypes */ | |
79 int wnn_loadhinsi (unsigned char *fname); | |
80 int init_heap (int hpb, int yhpb, int l, int rl, FILE *ipf); | |
81 int little_endian (void); | |
82 int revdic (struct JT *jtl, int match); | |
83 | |
84 int Sorted (register char *st, register int lc, int size, int (*sort_fun) ()); | |
85 int asshuku (); | |
86 | |
87 #ifdef CHINESE | |
88 void ujis_header (int *which_dict); | |
89 #else | |
90 void ujis_header (void); | |
91 #endif | |
92 | |
93 void read_ujis (int rev, int to_esc, int which_dict); | |
94 void uniq_je (int (*func)()); | |
95 void reverse_yomi (void); | |
96 void sort_if_not_sorted (void); | |
97 void exit1 (void); | |
98 | |
99 void create_rev_dict (void); | |
100 void output_header (FILE* ofpter, struct JT* jtp, struct wnn_file_head* fhp); | |
101 void udytoS (); | |
102 void output_ri (FILE* ofpter); | |
103 void new_pwd (); | |
104 void rev_short_fun (); | |
105 void rev_w_char (); | |
106 | |
77 #ifdef BDIC_WRITE_CHECK | 107 #ifdef BDIC_WRITE_CHECK |
78 int | 108 int put_n_EU_str (); |
79 #else | 109 #else |
80 void | 110 void put_n_EU_str (); |
81 #endif | 111 #endif |
82 put_n_EU_str (); | 112 |
83 static void ujistoud (), output_dic_index (), usage (), sdic_sort (), | 113 static void ujistoud (void); |
84 ujistosd (), not_enough_area (), get_pwd (), output_hindo (), output_hinsi (), output_kanji (), rev_dic_data (), set_pter1 (), output_comment (), output_hinsi_list (); | 114 static void output_dic_index (void); |
85 void upd_kanjicount (), output_dic_data (); | 115 static void usage (void); |
116 static void sdic_sort (void); | |
117 static void ujistosd (int start_je, int level); | |
118 static void not_enough_area (void); | |
119 static void get_pwd (char* fname, char* crypted); | |
120 static void output_hindo (FILE* ofpter); | |
121 static void output_hinsi (FILE* ofpter); | |
122 static void output_kanji (FILE* ofpter); | |
123 static void rev_dic_data (void); | |
124 static void set_pter1 (void); | |
125 static void output_comment (FILE* fp); | |
126 static void output_hinsi_list (FILE* fp); | |
127 void upd_kanjicount (int k); | |
128 void output_dic_data (void); | |
86 | 129 |
87 /* Switcher variable between UD and SD */ | 130 /* Switcher variable between UD and SD */ |
88 | 131 |
89 int which_dict = WNN_REV_DICT; | 132 int which_dict = WNN_REV_DICT; |
90 #ifdef CHINESE | 133 #ifdef CHINESE |
91 extern int pzy_flag; | 134 extern int pzy_flag; |
92 static void output_sisheng (); | 135 static void output_sisheng (FILE* ofpter); |
93 #endif | 136 #endif |
94 | 137 |
95 /* Variables both for UD and SD */ | 138 /* Variables both for UD and SD */ |
96 int reverse_dict = NORMAL; | 139 int reverse_dict = NORMAL; |
97 | 140 |
219 } | 262 } |
220 hoend = (UCHAR *) ((char *) hostart + jt.maxserial * (sizeof (struct uind2) + sizeof (w_char) * 2)); | 263 hoend = (UCHAR *) ((char *) hostart + jt.maxserial * (sizeof (struct uind2) + sizeof (w_char) * 2)); |
221 } | 264 } |
222 } | 265 } |
223 | 266 |
224 extern int sort_func_je (); | 267 int sort_func_sdic (const void* a, const void* b); |
225 int sort_func_sdic (const char* a, const char* b); | |
226 FILE *ofpter; | 268 FILE *ofpter; |
227 | 269 |
228 int | 270 int |
229 main (int argc, char** argv) | 271 main (int argc, char** argv) |
230 { | 272 { |
543 return (1); | 585 return (1); |
544 return ((int) *a - (int) *b); | 586 return ((int) *a - (int) *b); |
545 } | 587 } |
546 | 588 |
547 int | 589 int |
548 sort_func_sdic (const char* a, const char* b) | 590 sort_func_sdic (const void *a, const void *b) |
549 { | 591 { |
550 int tmp; | 592 int tmp; |
551 struct je *pa, *pb; | 593 struct je *pa, *pb; |
552 pa = *((struct je **) a); | 594 pa = *((struct je **) a); |
553 pb = *((struct je **) b); | 595 pb = *((struct je **) b); |