#endif
#endif
+#include "portable.h"
+
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
-#ifndef WIN32
-#include <unistd.h>
-#endif
+#include <ac/string.h>
+#include <ac/unistd.h>
+
#include "ucdata.h"
((((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];
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;
}
static void
-#ifdef __STDC__
_ucprop_unload(void)
-#else
-_ucprop_unload()
-#endif
{
if (_ucprop_size == 0)
return;
}
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;
}
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;
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;
}
static void
-#ifdef __STDC__
_uccase_unload(void)
-#else
-_uccase_unload()
-#endif
{
if (_uccase_size == 0)
return;
}
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;
}
unsigned long
-#ifdef __STDC__
uctoupper(unsigned long code)
-#else
-uctoupper(code)
-unsigned long code;
-#endif
{
int field;
long l, r;
}
unsigned long
-#ifdef __STDC__
uctolower(unsigned long code)
-#else
-uctolower(code)
-unsigned long code;
-#endif
{
int field;
long l, r;
}
unsigned long
-#ifdef __STDC__
uctotitle(unsigned long code)
-#else
-uctotitle(code)
-unsigned long code;
-#endif
{
int field;
long l, r;
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;
}
static void
-#ifdef __STDC__
_ucdcmp_unload(void)
-#else
-_ucdcmp_unload()
-#endif
{
if (_ucdcmp_size == 0)
return;
}
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;
}
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;
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;
}
static void
-#ifdef __STDC__
_uccmcl_unload(void)
-#else
-_uccmcl_unload()
-#endif
{
if (_uccmcl_size == 0)
return;
}
unsigned long
-#ifdef __STDC__
uccombining_class(unsigned long code)
-#else
-uccombining_class(code)
-unsigned long code;
-#endif
{
long l, r, m;
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;
}
static void
-#ifdef __STDC__
_ucnumb_unload(void)
-#else
-_ucnumb_unload()
-#endif
{
if (_ucnum_size == 0)
return;
}
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;
}
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;
}
struct ucnumber
-#ifdef __STDC__
ucgetnumber(unsigned long code)
-#else
-ucgetnumber(code)
-unsigned long code;
-#endif
{
struct ucnumber num;
}
int
-#ifdef __STDC__
ucgetdigit(unsigned long code)
-#else
-ucgetdigit(code)
-unsigned long code;
-#endif
{
int dig;
**************************************************************************/
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);
}
void
-#ifdef __STDC__
ucdata_unload(int masks)
-#else
-ucdata_unload(masks)
-int masks;
-#endif
{
if (masks & UCDATA_CTYPE)
_ucprop_unload();
}
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);
#ifdef TEST
void
-#ifdef __STDC__
main(void)
-#else
-main()
-#endif
{
int dig;
unsigned long i, lo, *dec;
* $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"
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 */
#endif
#endif
+#include "portable.h"
+
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
-#ifndef WIN32
-#include <unistd.h>
-#endif
+#include <ac/string.h>
+#include <ac/unistd.h>
#define ishdigit(cc) (((cc) >= '0' && (cc) <= '9') ||\
((cc) >= 'A' && (cc) <= 'F') ||\
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;
}
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;
}
static void
-#ifdef __STDC__
add_decomp(unsigned long code)
-#else
-add_decomp(code)
-unsigned long code;
-#endif
{
unsigned long i, j, size;
}
static void
-#ifdef __STDC__
add_title(unsigned long code)
-#else
-add_title(code)
-unsigned long code;
-#endif
{
unsigned long i, j;
}
static void
-#ifdef __STDC__
add_upper(unsigned long code)
-#else
-add_upper(code)
-unsigned long code;
-#endif
{
unsigned long i, j;
}
static void
-#ifdef __STDC__
add_lower(unsigned long code)
-#else
-add_lower(code)
-unsigned long code;
-#endif
{
unsigned long i, j;
}
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;
* 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;
}
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;
* 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];
}
static _decomp_t *
-#ifdef __STDC__
find_decomp(unsigned long code)
-#else
-find_decomp(code)
-unsigned long code;
-#endif
{
long l, r, m;
}
static void
-#ifdef __STDC__
decomp_it(_decomp_t *d)
-#else
-decomp_it(d)
-_decomp_t *d;
-#endif
{
unsigned long i;
_decomp_t *dp;
* in the decomposition.
*/
static void
-#ifdef __STDC__
expand_decomp(void)
-#else
-expand_decomp()
-#endif
{
unsigned long i;
}
static void
-#ifdef __STDC__
write_cdata(char *opath)
-#else
-write_cdata(opath)
-char *opath;
-#endif
{
FILE *out;
unsigned long i, idx, bytes, nprops;
}
int
-#ifdef __STDC__
main(int argc, char *argv[])
-#else
-main(argc, argv)
-int argc;
-char *argv[];
-#endif
{
FILE *in;
char *prog, *opath;
#endif
#endif
+#include "portable.h"
+
#include <stdio.h>
#include <stdlib.h>
+
#include "ucdata.h"
#include "ucpgba.h"
* 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;
* 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;
}
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;
}
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;
}
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;
}
void
-#ifdef __STDC__
ucstring_free(ucstring_t *s)
-#else
-ucstring_free(s)
-ucstring_t *s;
-#endif
{
ucrun_t *l, *r;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
#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
/***************************************************************************
*
#undef __
-#ifdef __cplusplus
-}
-#endif
+LDAP_END_DECL
#endif /* _h_ucpgba */
static char rcsid[] = "$Id: ure.c,v 1.2 1999/09/21 15:47:43 mleisher Exp $";
#endif
+#include "portable.h"
+
#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
+#include <ac/unistd.h>
+#include <ac/string.h>
+
#include "ure.h"
/*
*************************************************************************/
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;
}
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;
}
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;
}
static ucs2_t
-#ifdef __STDC__
_ure_pop(_ure_buffer_t *b)
-#else
-_ure_pop(b)
-_ure_buffer_t *b;
-#endif
{
ucs2_t v;
* 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;
* 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;
* 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;
#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 {
} _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;
}
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;
* 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;
* 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;
* 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;
}
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;
}
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;
* 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;
*************************************************************************/
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;
* 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;
}
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;
}
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;
}
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;
}
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;
* 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;
*************************************************************************/
ure_buffer_t
-#ifdef __STDC__
ure_buffer_create(void)
-#else
-ure_buffer_create()
-#endif
{
ure_buffer_t b;
}
void
-#ifdef __STDC__
ure_buffer_free(ure_buffer_t buf)
-#else
-ure_buffer_free(buf)
-ure_buffer_t buf;
-#endif
{
unsigned long i;
}
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;
}
void
-#ifdef __STDC__
ure_dfa_free(ure_dfa_t dfa)
-#else
-ure_dfa_free(dfa)
-ure_dfa_t dfa;
-#endif
{
ucs2_t i;
}
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;
(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;
#ifndef _h_ure
#define _h_ure
+#include "portable.h"
+
/*
* $Id: ure.h,v 1.2 1999/09/21 15:47:44 mleisher Exp $
*/
#include <stdio.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+LDAP_BEGIN_DECL
#undef __
-#ifdef __STDC__
#define __(x) x
-#else
-#define __(x) ()
-#endif
/*
* Set of character class flags.
#undef __
-#ifdef __cplusplus
-}
-#endif
+LDAP_END_DECL
#endif /* _h_ure */
* 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;
}
* 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;
}
* 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;
}
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;
*************************************************************************/
utbm_pattern_t
-#ifdef __STDC__
utbm_create_pattern(void)
-#else
-utbm_create_pattern()
-#endif
{
utbm_pattern_t p;
}
void
-#ifdef __STDC__
utbm_free_pattern(utbm_pattern_t pattern)
-#else
-utbm_free_pattern(pattern)
-utbm_pattern_t pattern;
-#endif
{
if (pattern == 0)
return;
}
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;
}
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;
* $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
/*************************************************************************
*
#undef __
-#ifdef __cplusplus
-}
+LDAP_END_DECL
+
#endif
+
#endif /* _h_utbm */
* 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 ||
* 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;
}
* otherwise.
*/
int
-#ifdef __STDC__
_utbm_nonspacing(ucs4_t c)
-#else
-_utbm_nonspacing(c)
-ucs4_t c;
-#endif
{
return 0;
}
* 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;
}
* 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;
}
* 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;
}