diff --git a/libraries/liblunicode/ucdata/ucdata.c b/libraries/liblunicode/ucdata/ucdata.c index 29f97bd708..7560136d04 100644 --- a/libraries/liblunicode/ucdata/ucdata.c +++ b/libraries/liblunicode/ucdata/ucdata.c @@ -27,12 +27,13 @@ static char rcsid[] = "$Id: ucdata.c,v 1.3 1999/08/23 16:14:09 mleisher Exp $"; #endif #endif +#include "portable.h" + #include #include -#include -#ifndef WIN32 -#include -#endif +#include +#include + #include "ucdata.h" @@ -68,12 +69,7 @@ static unsigned long masks32[32] = { ((((cc) >> 16) & 0xff) << 8)|((cc) >> 24)) static FILE * -#ifdef __STDC__ _ucopenfile(char *paths, char *filename, char *mode) -#else -_ucopenfile(paths, filename, mode) -char *paths, *filename, *mode; -#endif { FILE *f; char *fp, *dp, *pp, path[BUFSIZ]; @@ -114,13 +110,7 @@ static unsigned short *_ucprop_offsets; static unsigned long *_ucprop_ranges; static void -#ifdef __STDC__ _ucprop_load(char *paths, int reload) -#else -_ucprop_load(paths, reload) -char *paths; -int reload; -#endif { FILE *in; unsigned long size, i; @@ -210,11 +200,7 @@ int reload; } static void -#ifdef __STDC__ _ucprop_unload(void) -#else -_ucprop_unload() -#endif { if (_ucprop_size == 0) return; @@ -228,12 +214,7 @@ _ucprop_unload() } static int -#ifdef __STDC__ _ucprop_lookup(unsigned long code, unsigned long n) -#else -_ucprop_lookup(code, n) -unsigned long code, n; -#endif { long l, r, m; @@ -272,12 +253,7 @@ unsigned long code, n; } int -#ifdef __STDC__ ucisprop(unsigned long code, unsigned long mask1, unsigned long mask2) -#else -ucisprop(code, mask1, mask2) -unsigned long code, mask1, mask2; -#endif { unsigned long i; @@ -308,13 +284,7 @@ static unsigned short _uccase_len[2]; static unsigned long *_uccase_map; static void -#ifdef __STDC__ _uccase_load(char *paths, int reload) -#else -_uccase_load(paths, reload) -char *paths; -int reload; -#endif { FILE *in; unsigned long i; @@ -371,11 +341,7 @@ int reload; } static void -#ifdef __STDC__ _uccase_unload(void) -#else -_uccase_unload() -#endif { if (_uccase_size == 0) return; @@ -385,14 +351,7 @@ _uccase_unload() } static unsigned long -#ifdef __STDC__ _uccase_lookup(unsigned long code, long l, long r, int field) -#else -_uccase_lookup(code, l, r, field) -unsigned long code; -long l, r; -int field; -#endif { long m; @@ -418,12 +377,7 @@ int field; } unsigned long -#ifdef __STDC__ uctoupper(unsigned long code) -#else -uctoupper(code) -unsigned long code; -#endif { int field; long l, r; @@ -450,12 +404,7 @@ unsigned long code; } unsigned long -#ifdef __STDC__ uctolower(unsigned long code) -#else -uctolower(code) -unsigned long code; -#endif { int field; long l, r; @@ -482,12 +431,7 @@ unsigned long code; } unsigned long -#ifdef __STDC__ uctotitle(unsigned long code) -#else -uctotitle(code) -unsigned long code; -#endif { int field; long l, r; @@ -527,13 +471,7 @@ static unsigned long *_ucdcmp_nodes; static unsigned long *_ucdcmp_decomp; static void -#ifdef __STDC__ _ucdcmp_load(char *paths, int reload) -#else -_ucdcmp_load(paths, reload) -char *paths; -int reload; -#endif { FILE *in; unsigned long size, i; @@ -583,11 +521,7 @@ int reload; } static void -#ifdef __STDC__ _ucdcmp_unload(void) -#else -_ucdcmp_unload() -#endif { if (_ucdcmp_size == 0) return; @@ -601,12 +535,7 @@ _ucdcmp_unload() } int -#ifdef __STDC__ ucdecomp(unsigned long code, unsigned long *num, unsigned long **decomp) -#else -ucdecomp(code, num, decomp) -unsigned long code, *num, **decomp; -#endif { long l, r, m; @@ -634,12 +563,7 @@ unsigned long code, *num, **decomp; } int -#ifdef __STDC__ ucdecomp_hangul(unsigned long code, unsigned long *num, unsigned long decomp[]) -#else -ucdecomp_hangul(code, num, decomp) -unsigned long code, *num, decomp[]; -#endif { if (!ucishangul(code)) return 0; @@ -663,13 +587,7 @@ static unsigned long _uccmcl_size; static unsigned long *_uccmcl_nodes; static void -#ifdef __STDC__ _uccmcl_load(char *paths, int reload) -#else -_uccmcl_load(paths, reload) -char *paths; -int reload; -#endif { FILE *in; unsigned long i; @@ -717,11 +635,7 @@ int reload; } static void -#ifdef __STDC__ _uccmcl_unload(void) -#else -_uccmcl_unload() -#endif { if (_uccmcl_size == 0) return; @@ -731,12 +645,7 @@ _uccmcl_unload() } unsigned long -#ifdef __STDC__ uccombining_class(unsigned long code) -#else -uccombining_class(code) -unsigned long code; -#endif { long l, r, m; @@ -766,14 +675,8 @@ static unsigned long *_ucnum_nodes; static unsigned long _ucnum_size; static short *_ucnum_vals; -static void -#ifdef __STDC__ +void _ucnumb_load(char *paths, int reload) -#else -_ucnumb_load(paths, reload) -char *paths; -int reload; -#endif { FILE *in; unsigned long size, i; @@ -832,11 +735,7 @@ int reload; } static void -#ifdef __STDC__ _ucnumb_unload(void) -#else -_ucnumb_unload() -#endif { if (_ucnum_size == 0) return; @@ -846,13 +745,7 @@ _ucnumb_unload() } int -#ifdef __STDC__ ucnumber_lookup(unsigned long code, struct ucnumber *num) -#else -ucnumber_lookup(code, num) -unsigned long code; -struct ucnumber *num; -#endif { long l, r, m; short *vp; @@ -881,13 +774,7 @@ struct ucnumber *num; } int -#ifdef __STDC__ ucdigit_lookup(unsigned long code, int *digit) -#else -ucdigit_lookup(code, digit) -unsigned long code; -int *digit; -#endif { long l, r, m; short *vp; @@ -918,12 +805,7 @@ int *digit; } struct ucnumber -#ifdef __STDC__ ucgetnumber(unsigned long code) -#else -ucgetnumber(code) -unsigned long code; -#endif { struct ucnumber num; @@ -940,12 +822,7 @@ unsigned long code; } int -#ifdef __STDC__ ucgetdigit(unsigned long code) -#else -ucgetdigit(code) -unsigned long code; -#endif { int dig; @@ -968,13 +845,7 @@ unsigned long code; **************************************************************************/ void -#ifdef __STDC__ ucdata_load(char *paths, int masks) -#else -ucdata_load(paths, masks) -char *paths; -int masks; -#endif { if (masks & UCDATA_CTYPE) _ucprop_load(paths, 0); @@ -989,12 +860,7 @@ int masks; } void -#ifdef __STDC__ ucdata_unload(int masks) -#else -ucdata_unload(masks) -int masks; -#endif { if (masks & UCDATA_CTYPE) _ucprop_unload(); @@ -1009,13 +875,7 @@ int masks; } void -#ifdef __STDC__ ucdata_reload(char *paths, int masks) -#else -ucdata_reload(paths, masks) -char *paths; -int masks; -#endif { if (masks & UCDATA_CTYPE) _ucprop_load(paths, 1); @@ -1032,11 +892,7 @@ int masks; #ifdef TEST void -#ifdef __STDC__ main(void) -#else -main() -#endif { int dig; unsigned long i, lo, *dec; diff --git a/libraries/liblunicode/ucdata/ucdata.h b/libraries/liblunicode/ucdata/ucdata.h index 57b6999bcc..89c47f2914 100644 --- a/libraries/liblunicode/ucdata/ucdata.h +++ b/libraries/liblunicode/ucdata/ucdata.h @@ -26,16 +26,10 @@ * $Id: ucdata.h,v 1.5 1999/11/19 15:24:29 mleisher Exp $ */ -#ifdef __cplusplus -extern "C" { -#endif +LDAP_BEGIN_DECL #undef __ -#ifdef __STDC__ #define __(x) x -#else -#define __(x) () -#endif #define UCDATA_VERSION "2.3" @@ -291,16 +285,16 @@ extern void ucdata_load __((char *paths, int mask)); extern void ucdata_unload __((int mask)); extern void ucdata_reload __((char *paths, int mask)); +#ifdef UCDATA_DEPRECATED /* * Deprecated functions, now just compatibility macros. */ #define ucdata_setup(p) ucdata_load(p, UCDATA_ALL) #define ucdata_cleanup() ucdata_unload(UCDATA_ALL) +#endif #undef __ -#ifdef __cplusplus -} -#endif +LDAP_END_DECL #endif /* _h_ucdata */ diff --git a/libraries/liblunicode/ucdata/ucgendat.c b/libraries/liblunicode/ucdata/ucgendat.c index d09f757afa..06ebc5da95 100644 --- a/libraries/liblunicode/ucdata/ucgendat.c +++ b/libraries/liblunicode/ucdata/ucgendat.c @@ -27,12 +27,12 @@ static char rcsid[] = "$Id: ucgendat.c,v 1.3 1999/10/07 20:49:56 mleisher Exp $" #endif #endif +#include "portable.h" + #include #include -#include -#ifndef WIN32 -#include -#endif +#include +#include #define ishdigit(cc) (((cc) >= '0' && (cc) <= '9') ||\ ((cc) >= 'A' && (cc) <= 'F') ||\ @@ -176,13 +176,7 @@ static unsigned long nums_used; static unsigned long nums_size; static void -#ifdef __STDC__ add_range(unsigned long start, unsigned long end, char *p1, char *p2) -#else -add_range(start, end, p1, p2) -unsigned long start, end; -char *p1, *p2; -#endif { int i, j, k, len; _ranges_t *rlp; @@ -280,14 +274,7 @@ char *p1, *p2; } static void -#ifdef __STDC__ ordered_range_insert(unsigned long c, char *name, int len) -#else -ordered_range_insert(c, name, len) -unsigned long c; -char *name; -int len; -#endif { int i, j; unsigned long s, e; @@ -425,12 +412,7 @@ int len; } static void -#ifdef __STDC__ add_decomp(unsigned long code) -#else -add_decomp(code) -unsigned long code; -#endif { unsigned long i, j, size; @@ -494,12 +476,7 @@ unsigned long code; } static void -#ifdef __STDC__ add_title(unsigned long code) -#else -add_title(code) -unsigned long code; -#endif { unsigned long i, j; @@ -539,12 +516,7 @@ unsigned long code; } static void -#ifdef __STDC__ add_upper(unsigned long code) -#else -add_upper(code) -unsigned long code; -#endif { unsigned long i, j; @@ -591,12 +563,7 @@ unsigned long code; } static void -#ifdef __STDC__ add_lower(unsigned long code) -#else -add_lower(code) -unsigned long code; -#endif { unsigned long i, j; @@ -643,12 +610,7 @@ unsigned long code; } static void -#ifdef __STDC__ ordered_ccl_insert(unsigned long c, unsigned long ccl_code) -#else -ordered_ccl_insert(c, ccl_code) -unsigned long c, ccl_code; -#endif { unsigned long i, j; @@ -721,12 +683,7 @@ unsigned long c, ccl_code; * multiplied by 2. */ static unsigned long -#ifdef __STDC__ make_number(short num, short denom) -#else -make_number(num, denom) -short num, denom; -#endif { unsigned long n; @@ -755,13 +712,7 @@ short num, denom; } static void -#ifdef __STDC__ add_number(unsigned long code, short num, short denom) -#else -add_number(code, num, denom) -unsigned long code; -short num, denom; -#endif { unsigned long i, j; @@ -812,12 +763,7 @@ short num, denom; * entry. */ static void -#ifdef __STDC__ read_cdata(FILE *in) -#else -read_cdata(in) -FILE *in; -#endif { unsigned long i, lineno, skip, code, ccl_code; short wnum, neg, number[2]; @@ -1092,12 +1038,7 @@ FILE *in; } static _decomp_t * -#ifdef __STDC__ find_decomp(unsigned long code) -#else -find_decomp(code) -unsigned long code; -#endif { long l, r, m; @@ -1116,12 +1057,7 @@ unsigned long code; } static void -#ifdef __STDC__ decomp_it(_decomp_t *d) -#else -decomp_it(d) -_decomp_t *d; -#endif { unsigned long i; _decomp_t *dp; @@ -1139,11 +1075,7 @@ _decomp_t *d; * in the decomposition. */ static void -#ifdef __STDC__ expand_decomp(void) -#else -expand_decomp() -#endif { unsigned long i; @@ -1156,12 +1088,7 @@ expand_decomp() } static void -#ifdef __STDC__ write_cdata(char *opath) -#else -write_cdata(opath) -char *opath; -#endif { FILE *out; unsigned long i, idx, bytes, nprops; @@ -1434,13 +1361,7 @@ char *opath; } int -#ifdef __STDC__ main(int argc, char *argv[]) -#else -main(argc, argv) -int argc; -char *argv[]; -#endif { FILE *in; char *prog, *opath; diff --git a/libraries/liblunicode/ucdata/ucpgba.c b/libraries/liblunicode/ucdata/ucpgba.c index 6c4d767cea..d63526db4f 100644 --- a/libraries/liblunicode/ucdata/ucpgba.c +++ b/libraries/liblunicode/ucdata/ucpgba.c @@ -27,8 +27,11 @@ static char rcsid[] = "$Id: ucpgba.c,v 1.4 1999/11/29 16:41:06 mleisher Exp $"; #endif #endif +#include "portable.h" + #include #include + #include "ucdata.h" #include "ucpgba.h" @@ -93,12 +96,7 @@ sizeof(_symmetric_pairs)/sizeof(_symmetric_pairs[0]); * This routine looks up the other form of a symmetric pair. */ static unsigned long -#ifdef __STDC__ _ucsymmetric_pair(unsigned long c) -#else -_ucsymmetric_pair(c) -unsigned long c; -#endif { int i; @@ -115,15 +113,8 @@ unsigned long c; * the visual text order chain. */ static ucrun_t * -#ifdef __STDC__ _add_run(ucstring_t *str, unsigned long *src, unsigned long start, unsigned long end, int direction) -#else -_add_run(str, src, start, end, direction) -ucstring_t *str; -unsigned long *src, start, end; -int direction; -#endif { long i, t; ucrun_t *run; @@ -179,14 +170,8 @@ int direction; } static void -#ifdef __STDC__ _ucadd_rtl_segment(ucstring_t *str, unsigned long *source, unsigned long start, unsigned long end) -#else -_ucadd_rtl_segment(str, source, start, end) -ucstring_t *str; -unsigned long *source, start, end; -#endif { unsigned long s, e; ucrun_t *run, *lrun; @@ -298,14 +283,8 @@ unsigned long *source, start, end; } static void -#ifdef __STDC__ _ucadd_ltr_segment(ucstring_t *str, unsigned long *source, unsigned long start, unsigned long end) -#else -_ucadd_ltr_segment(str, source, start, end) -ucstring_t *str; -unsigned long *source, start, end; -#endif { ucrun_t *run; @@ -329,14 +308,8 @@ unsigned long *source, start, end; } ucstring_t * -#ifdef __STDC__ ucstring_create(unsigned long *source, unsigned long start, unsigned long end, int default_direction, int cursor_motion) -#else -ucstring_create(source, start, end, default_direction, cursor_motion) -unsigned long *source, start, end; -int default_direction, cursor_motion; -#endif { int rtl_first; unsigned long s, e; @@ -446,12 +419,7 @@ int default_direction, cursor_motion; } void -#ifdef __STDC__ ucstring_free(ucstring_t *s) -#else -ucstring_free(s) -ucstring_t *s; -#endif { ucrun_t *l, *r; @@ -472,13 +440,7 @@ ucstring_t *s; } int -#ifdef __STDC__ ucstring_set_cursor_motion(ucstring_t *str, int cursor_motion) -#else -ucstring_set_cursor_motion(s, cursor_motion) -ucstring_t *str; -int cursor_motion; -#endif { int n; @@ -491,13 +453,7 @@ int cursor_motion; } static int -#ifdef __STDC__ _ucstring_visual_cursor_right(ucstring_t *str, int count) -#else -_ucstring_visual_cursor_right(str, count) -ucstring_t *str; -int count; -#endif { int cnt = count; unsigned long size; @@ -535,13 +491,7 @@ int count; } static int -#ifdef __STDC__ _ucstring_logical_cursor_right(ucstring_t *str, int count) -#else -_ucstring_logical_cursor_right(str, count) -ucstring_t *str; -int count; -#endif { int cnt = count; unsigned long size; @@ -619,13 +569,7 @@ int count; } int -#ifdef __STDC__ ucstring_cursor_right(ucstring_t *str, int count) -#else -ucstring_cursor_right(str, count) -ucstring_t *str; -int count; -#endif { if (str == 0) return 0; @@ -635,13 +579,7 @@ int count; } static int -#ifdef __STDC__ _ucstring_visual_cursor_left(ucstring_t *str, int count) -#else -_ucstring_visual_cursor_left(str, count) -ucstring_t *str; -int count; -#endif { int cnt = count; unsigned long size; @@ -680,13 +618,7 @@ int count; } static int -#ifdef __STDC__ _ucstring_logical_cursor_left(ucstring_t *str, int count) -#else -_ucstring_logical_cursor_left(str, count) -ucstring_t *str; -int count; -#endif { int cnt = count; unsigned long size; @@ -764,13 +696,7 @@ int count; } int -#ifdef __STDC__ ucstring_cursor_left(ucstring_t *str, int count) -#else -ucstring_cursor_left(str, count) -ucstring_t *str; -int count; -#endif { if (str == 0) return 0; @@ -780,13 +706,7 @@ int count; } void -#ifdef __STDC__ ucstring_cursor_info(ucstring_t *str, int *direction, unsigned long *position) -#else -ucstring_cursor_info(str, direction, position) -ucstring_t *str, int *direction; -unsigned long *position; -#endif { long c; unsigned long size; diff --git a/libraries/liblunicode/ucdata/ucpgba.h b/libraries/liblunicode/ucdata/ucpgba.h index cd4c8bdd3f..74a8f6f4bc 100644 --- a/libraries/liblunicode/ucdata/ucpgba.h +++ b/libraries/liblunicode/ucdata/ucpgba.h @@ -22,20 +22,16 @@ #ifndef _h_ucpgba #define _h_ucpgba +#include "portable.h" + /* * $Id: ucpgba.h,v 1.4 1999/11/19 15:24:30 mleisher Exp $ */ -#ifdef __cplusplus -extern "C" { -#endif +LDAP_BEGIN_DECL #undef __ -#ifdef __STDC__ #define __(x) x -#else -#define __(x) () -#endif /*************************************************************************** * @@ -155,8 +151,6 @@ extern void ucstring_cursor_info __((ucstring_t *string, int *direction, #undef __ -#ifdef __cplusplus -} -#endif +LDAP_END_DECL #endif /* _h_ucpgba */ diff --git a/libraries/liblunicode/ure/ure.c b/libraries/liblunicode/ure/ure.c index 2175034966..51e204d556 100644 --- a/libraries/liblunicode/ure/ure.c +++ b/libraries/liblunicode/ure/ure.c @@ -24,9 +24,12 @@ static char rcsid[] = "$Id: ure.c,v 1.2 1999/09/21 15:47:43 mleisher Exp $"; #endif +#include "portable.h" + #include -#include -#include +#include +#include + #include "ure.h" /* @@ -251,13 +254,7 @@ typedef struct _ure_dfa_t { *************************************************************************/ static void -#if NeedFunctionPrototypes _ure_memmove(char *dest, char *src, unsigned long bytes) -#else -_ure_memmove(dest, src, bytes) -char *dest, *src; -unsigned long bytes; -#endif { long i, j; @@ -301,13 +298,7 @@ unsigned long bytes; } static void -#ifdef __STDC__ _ure_push(ucs2_t v, _ure_buffer_t *b) -#else -_ure_push(v, b) -ucs2_t v; -_ure_buffer_t *b; -#endif { _ure_stlist_t *s; @@ -341,12 +332,7 @@ _ure_buffer_t *b; } static ucs2_t -#ifdef __STDC__ _ure_peek(_ure_buffer_t *b) -#else -_ure_peek(b) -_ure_buffer_t *b; -#endif { if (b == 0 || b->stack.slist_used == 0) return _URE_NOOP; @@ -355,12 +341,7 @@ _ure_buffer_t *b; } static ucs2_t -#ifdef __STDC__ _ure_pop(_ure_buffer_t *b) -#else -_ure_pop(b) -_ure_buffer_t *b; -#endif { ucs2_t v; @@ -386,15 +367,8 @@ _ure_buffer_t *b; * variable, and return the number of characters consumed. */ static unsigned long -#ifdef __STDC__ _ure_prop_list(ucs2_t *pp, unsigned long limit, unsigned long *mask, _ure_buffer_t *b) -#else -_ure_prop_list(pp, limit, mask, b) -ucs2_t *pp; -unsigned long limit, *mask; -_ure_buffer_t *b; -#endif { unsigned long n, m; ucs2_t *sp, *ep; @@ -450,14 +424,7 @@ _ure_buffer_t *b; * of characters used. */ static unsigned long -#ifdef __STDC__ _ure_hex(ucs2_t *np, unsigned long limit, ucs4_t *n) -#else -_ure_hex(np, limit, n) -ucs2_t *np; -unsigned long limit; -ucs4_t *n; -#endif { ucs2_t i; ucs2_t *sp, *ep; @@ -494,14 +461,7 @@ ucs4_t *n; * them in increasing range-start order. */ static void -#ifdef __STDC__ _ure_add_range(_ure_ccl_t *ccl, _ure_range_t *r, _ure_buffer_t *b) -#else -_ure_add_range(ccl, r, b) -_ure_ccl_t *ccl; -_ure_range_t *r; -_ure_buffer_t *b; -#endif { ucs2_t i; ucs4_t tmp; @@ -567,11 +527,9 @@ _URE_MATHSYM|_URE_CURRENCYSYM|_URE_OTHERSYM) #define _URE_SPACE_MASK (_URE_SPACESEP|_URE_LINESEP|_URE_PARASEP) typedef void (*_ure_cclsetup_t)( -#ifdef __STDC__ _ure_symtab_t *sym, unsigned long mask, _ure_buffer_t *b -#endif ); typedef struct { @@ -583,27 +541,13 @@ typedef struct { } _ure_trie_t; static void -#ifdef __STDC__ _ure_ccl_setup(_ure_symtab_t *sym, unsigned long mask, _ure_buffer_t *b) -#else -_ure_ccl_setup(sym, mask, b) -_ure_symtab_t *sym; -unsigned long mask; -_ure_buffer_t *b; -#endif { sym->props |= mask; } static void -#ifdef __STDC__ _ure_space_setup(_ure_symtab_t *sym, unsigned long mask, _ure_buffer_t *b) -#else -_ure_space_setup(sym, mask, *b) -_ure_symtab_t *sym; -unsigned long mask; -_ure_buffer_t b; -#endif { _ure_range_t range; @@ -625,14 +569,7 @@ _ure_buffer_t b; } static void -#ifdef __STDC__ _ure_xdigit_setup(_ure_symtab_t *sym, unsigned long mask, _ure_buffer_t *b) -#else -_ure_xdigit_setup(sym, mask, b) -_ure_symtab_t *sym; -unsigned long mask; -_ure_buffer_t *b; -#endif { _ure_range_t range; @@ -723,16 +660,8 @@ static _ure_trie_t cclass_trie[] = { * trie. */ static unsigned long -#ifdef __STDC__ _ure_posix_ccl(ucs2_t *cp, unsigned long limit, _ure_symtab_t *sym, _ure_buffer_t *b) -#else -_ure_posix_ccl(cp, limit, sym, b) -ucs2_t *cp; -unsigned long limit; -_ure_symtab_t *sym; -_ure_buffer_t *b; -#endif { int i; unsigned long n; @@ -776,16 +705,8 @@ _ure_buffer_t *b; * Construct a list of ranges and return the number of characters consumed. */ static unsigned long -#ifdef __STDC__ _ure_cclass(ucs2_t *cp, unsigned long limit, _ure_symtab_t *symp, _ure_buffer_t *b) -#else -_ure_cclass(cp, limit, symp, b) -ucs2_t *cp; -unsigned long limit; -_ure_symtab_t *symp; -_ure_buffer_t *b; -#endif { int range_end; unsigned long n; @@ -954,14 +875,7 @@ _ure_buffer_t *b; * Probe for a low surrogate hex code. */ static unsigned long -#ifdef __STDC__ _ure_probe_ls(ucs2_t *ls, unsigned long limit, ucs4_t *c) -#else -_ure_probe_ls(ls, limit, c) -ucs2_t *ls; -unsigned long limit; -ucs4_t *c; -#endif { ucs4_t i, code; ucs2_t *sp, *ep; @@ -982,16 +896,8 @@ ucs4_t *c; } static unsigned long -#ifdef __STDC__ _ure_compile_symbol(ucs2_t *sym, unsigned long limit, _ure_symtab_t *symp, _ure_buffer_t *b) -#else -_ure_compile_symbol(sym, limit, symp, b) -ucs2_t *sym; -unsigned long limit; -_ure_symtab_t *symp; -_ure_buffer_t *b; -#endif { ucs4_t c; ucs2_t *sp, *ep; @@ -1135,12 +1041,7 @@ _ure_buffer_t *b; } static int -#ifdef __STDC__ _ure_sym_neq(_ure_symtab_t *a, _ure_symtab_t *b) -#else -_ure_sym_neq(a, b) -_ure_symtab_t *a, *b; -#endif { if (a->type != b->type || a->mods != b->mods || a->props != b->props) return 1; @@ -1161,15 +1062,8 @@ _ure_symtab_t *a, *b; * Construct a symbol, but only keep unique symbols. */ static ucs2_t -#ifdef __stdc__ _ure_make_symbol(ucs2_t *sym, unsigned long limit, unsigned long *consumed, _ure_buffer_t *b) -#else -_ure_make_symbol(sym, limit, consumed, b) -ucs2_t *sym; -unsigned long limit, *consumed; -_ure_buffer_t *b; -#endif { ucs2_t i; _ure_symtab_t *sp, symbol; @@ -1227,13 +1121,7 @@ _ure_buffer_t *b; *************************************************************************/ static ucs2_t -#ifdef __stdc__ _ure_make_expr(ucs2_t type, ucs2_t lhs, ucs2_t rhs, _ure_buffer_t *b) -#else -_ure_make_expr(type, lhs, rhs, b) -ucs2_t type, lhs, rhs; -_ure_buffer_t *b; -#endif { ucs2_t i; @@ -1286,14 +1174,7 @@ static unsigned char spmap[] = { * reduce to a DFA. The starting state for the reduction will be returned. */ static ucs2_t -#ifdef __STDC__ _ure_re2nfa(ucs2_t *re, unsigned long relen, _ure_buffer_t *b) -#else -_ure_re2nfa(re, relen, b) -ucs2_t *re; -unsigned long relen; -_ure_buffer_t *b; -#endif { ucs2_t c, state, top, sym, *sp, *ep; unsigned long used; @@ -1377,13 +1258,7 @@ _ure_buffer_t *b; } static void -#ifdef __STDC__ _ure_add_symstate(ucs2_t sym, ucs2_t state, _ure_buffer_t *b) -#else -_ure_add_symstate(sym, state, b) -ucs2_t sym, state; -_ure_buffer_t *b; -#endif { ucs2_t i, *stp; _ure_symtab_t *sp; @@ -1424,13 +1299,7 @@ _ure_buffer_t *b; } static ucs2_t -#ifdef __STDC__ _ure_add_state(ucs2_t nstates, ucs2_t *states, _ure_buffer_t *b) -#else -_ure_add_state(nstates, states, b) -ucs2_t nstates, *states; -_ure_buffer_t *b; -#endif { ucs2_t i; _ure_state_t *sp; @@ -1484,13 +1353,7 @@ _ure_buffer_t *b; } static void -#ifdef __STDC__ _ure_reduce(ucs2_t start, _ure_buffer_t *b) -#else -_ure_reduce(start, b) -ucs2_t start; -_ure_buffer_t *b; -#endif { ucs2_t i, j, state, eval, syms, rhs; ucs2_t s1, s2, ns1, ns2; @@ -1665,13 +1528,7 @@ _ure_buffer_t *b; } static void -#ifdef __STDC__ _ure_add_equiv(ucs2_t l, ucs2_t r, _ure_buffer_t *b) -#else -_ure_add_equiv(l, r, b) -ucs2_t l, r; -_ure_buffer_t *b; -#endif { ucs2_t tmp; @@ -1715,12 +1572,7 @@ _ure_buffer_t *b; * Merge the DFA states that are equivalent. */ static void -#ifdef __STDC__ _ure_merge_equiv(_ure_buffer_t *b) -#else -_ure_merge_equiv(b) -_ure_buffer_t *b; -#endif { ucs2_t i, j, k, eq, done; _ure_state_t *sp1, *sp2, *ls, *rs; @@ -1776,11 +1628,7 @@ _ure_buffer_t *b; *************************************************************************/ ure_buffer_t -#ifdef __STDC__ ure_buffer_create(void) -#else -ure_buffer_create() -#endif { ure_buffer_t b; @@ -1790,12 +1638,7 @@ ure_buffer_create() } void -#ifdef __STDC__ ure_buffer_free(ure_buffer_t buf) -#else -ure_buffer_free(buf) -ure_buffer_t buf; -#endif { unsigned long i; @@ -1833,15 +1676,7 @@ ure_buffer_t buf; } ure_dfa_t -#ifdef __STDC__ ure_compile(ucs2_t *re, unsigned long relen, int casefold, ure_buffer_t buf) -#else -ure_compile(re, relen, casefold, buf) -ucs2_t *re; -unsigned long relen; -int casefold; -ure_buffer_t buf; -#endif { ucs2_t i, j, state; _ure_state_t *sp; @@ -1959,12 +1794,7 @@ ure_buffer_t buf; } void -#ifdef __STDC__ ure_dfa_free(ure_dfa_t dfa) -#else -ure_dfa_free(dfa) -ure_dfa_t dfa; -#endif { ucs2_t i; @@ -1988,13 +1818,7 @@ ure_dfa_t dfa; } void -#ifdef __STDC__ ure_write_dfa(ure_dfa_t dfa, FILE *out) -#else -ure_write_dfa(dfa, out) -ure_dfa_t dfa; -FILE *out; -#endif { ucs2_t i, j, k, h, l; _ure_dstate_t *sp; @@ -2111,16 +1935,8 @@ FILE *out; (cc) == 0x2029) int -#ifdef __STDC__ ure_exec(ure_dfa_t dfa, int flags, ucs2_t *text, unsigned long textlen, unsigned long *match_start, unsigned long *match_end) -#else -ure_exec(dfa, flags, text, textlen, match_start, match_end) -ure_dfa_t dfa; -int flags; -ucs2_t *text; -unsigned long textlen, *match_start, *match_end; -#endif { int i, j, matched, found, skip; unsigned long ms, me; diff --git a/libraries/liblunicode/ure/ure.h b/libraries/liblunicode/ure/ure.h index 7d7fbb2e07..63c98bd2e2 100644 --- a/libraries/liblunicode/ure/ure.h +++ b/libraries/liblunicode/ure/ure.h @@ -23,22 +23,18 @@ #ifndef _h_ure #define _h_ure +#include "portable.h" + /* * $Id: ure.h,v 1.2 1999/09/21 15:47:44 mleisher Exp $ */ #include -#ifdef __cplusplus -extern "C" { -#endif +LDAP_BEGIN_DECL #undef __ -#ifdef __STDC__ #define __(x) x -#else -#define __(x) () -#endif /* * Set of character class flags. @@ -143,8 +139,6 @@ extern int _ure_matches_properties __((unsigned long props, ucs4_t c)); #undef __ -#ifdef __cplusplus -} -#endif +LDAP_END_DECL #endif /* _h_ure */ diff --git a/libraries/liblunicode/ure/urestubs.c b/libraries/liblunicode/ure/urestubs.c index 10157238c1..078202491a 100644 --- a/libraries/liblunicode/ure/urestubs.c +++ b/libraries/liblunicode/ure/urestubs.c @@ -35,13 +35,7 @@ static char rcsid[] = "$Id: urestubs.c,v 1.2 1999/09/21 15:47:44 mleisher Exp $" * This routine should return the lower case equivalent for the character or, * if there is no lower case quivalent, the character itself. */ -ucs4_t -#ifdef __STDC__ -_ure_tolower(ucs4_t c) -#else -_ure_tolower(c) -ucs4_t c; -#endif +ucs4_t _ure_tolower(ucs4_t c) { return c; } @@ -52,13 +46,7 @@ ucs4_t c; * properties. */ int -#ifdef __STDC__ _ure_matches_properties(unsigned long props, ucs4_t c) -#else -_ure_matches_properties(props, c) -unsigned long props; -ucs4_t c; -#endif { return 1; } diff --git a/libraries/liblunicode/utbm/utbm.c b/libraries/liblunicode/utbm/utbm.c index 32904b0aa9..863f2c5c6a 100644 --- a/libraries/liblunicode/utbm/utbm.c +++ b/libraries/liblunicode/utbm/utbm.c @@ -75,13 +75,7 @@ typedef struct _utbm_pattern_t { * Routine to look up the skip value for a character. */ static unsigned long -#ifdef __STDC__ _utbm_skip(utbm_pattern_t p, ucs2_t *start, ucs2_t *end) -#else -_utbm_skip(p, start, end) -utbm_pattern_t p; -ucs2_t *start, *end; -#endif { unsigned long i; ucs4_t c1, c2; @@ -105,15 +99,8 @@ ucs2_t *start, *end; } static int -#ifdef __STDC__ _utbm_match(utbm_pattern_t pat, ucs2_t *text, ucs2_t *start, ucs2_t *end, unsigned long *match_start, unsigned long *match_end) -#else -_utbm_match(pat, text, start, end, match_start, match_end) -utbm_pattern_t pat; -ucs2_t *text, *start, *end; -unsigned long *match_start, *match_end; -#endif { int check_space; ucs4_t c1, c2; @@ -231,11 +218,7 @@ unsigned long *match_start, *match_end; *************************************************************************/ utbm_pattern_t -#ifdef __STDC__ utbm_create_pattern(void) -#else -utbm_create_pattern() -#endif { utbm_pattern_t p; @@ -245,12 +228,7 @@ utbm_create_pattern() } void -#ifdef __STDC__ utbm_free_pattern(utbm_pattern_t pattern) -#else -utbm_free_pattern(pattern) -utbm_pattern_t pattern; -#endif { if (pattern == 0) return; @@ -265,15 +243,8 @@ utbm_pattern_t pattern; } void -#ifdef __STDC__ utbm_compile(ucs2_t *pat, unsigned long patlen, unsigned long flags, utbm_pattern_t p) -#else -utbm_compile(pat, patlen, flags, p) -ucs2_t *pat; -unsigned long patlen, flags; -utbm_pattern_t p; -#endif { int have_space; unsigned long i, j, k, slen; @@ -449,15 +420,8 @@ utbm_pattern_t p; } int -#ifdef __STDC__ utbm_exec(utbm_pattern_t pat, ucs2_t *text, unsigned long textlen, unsigned long *match_start, unsigned long *match_end) -#else -utbm_exec(pat, text, textlen, match_start, match_end) -utbm_pattern_t pat; -ucs2_t *text; -unsigned long textlen, *match_start, *match_end; -#endif { unsigned long k; ucs2_t *start, *end; diff --git a/libraries/liblunicode/utbm/utbm.h b/libraries/liblunicode/utbm/utbm.h index 0050186cc5..95b4cbf458 100644 --- a/libraries/liblunicode/utbm/utbm.h +++ b/libraries/liblunicode/utbm/utbm.h @@ -27,16 +27,12 @@ * $Id: utbm.h,v 1.1 1999/09/21 15:45:18 mleisher Exp $ */ -#ifdef __cplusplus -extern "C" { -#endif +#include "portable.h" + +LDAP_BEGIN_DECL #undef __ -#ifdef __STDC__ #define __(x) x -#else -#define __(x) () -#endif /************************************************************************* * @@ -102,8 +98,9 @@ extern ucs4_t _utbm_totitle __((ucs4_t c)); #undef __ -#ifdef __cplusplus -} +LDAP_END_DECL + #endif + #endif /* _h_utbm */ diff --git a/libraries/liblunicode/utbm/utbmstub.c b/libraries/liblunicode/utbm/utbmstub.c index 51a2c77cc0..72ceed114b 100644 --- a/libraries/liblunicode/utbm/utbmstub.c +++ b/libraries/liblunicode/utbm/utbmstub.c @@ -37,13 +37,7 @@ static char rcsid[] = "$Id: utbmstub.c,v 1.1 1999/09/21 15:45:18 mleisher Exp $" * of a space character. Return zero otherwise. */ int -#ifdef __STDC__ _utbm_isspace(ucs4_t c, int compress) -#else -_utbm_isspace(c, compress) -ucs4_t c; -int compress; -#endif { if (compress) return (c == 0x09 || c == 0x0a || c == 0x0d || @@ -57,12 +51,7 @@ int compress; * Return non-zero if the character is a control character, or zero otherwise. */ int -#ifdef __STDC__ _utbm_iscntrl(ucs4_t c) -#else -_utbm_iscntrl(c) -ucs4_t c; -#endif { return 0; } @@ -72,12 +61,7 @@ ucs4_t c; * otherwise. */ int -#ifdef __STDC__ _utbm_nonspacing(ucs4_t c) -#else -_utbm_nonspacing(c) -ucs4_t c; -#endif { return 0; } @@ -86,12 +70,7 @@ ucs4_t c; * Convert a character to lower case. */ ucs4_t -#ifdef __STDC__ _utbm_tolower(ucs4_t c) -#else -_utbm_tolower(c) -ucs4_t c; -#endif { return c; } @@ -100,12 +79,7 @@ ucs4_t c; * Convert a character to upper case. */ ucs4_t -#ifdef __STDC__ _utbm_toupper(ucs4_t c) -#else -_utbm_toupper(c) -ucs4_t c; -#endif { return c; } @@ -114,12 +88,7 @@ ucs4_t c; * Convert a character to title case. */ ucs4_t -#ifdef __STDC__ _utbm_totitle(ucs4_t c) -#else -_utbm_totitle(c) -ucs4_t c; -#endif { return c; }