X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fcharmap.h;h=23661a545e94bfb209c27b6244c3a4710723775f;hb=43e51e6fd8d1e10b5d5b6d62de8da6ec833f806c;hp=b653e97b352781c76aab713b57e14d80f6ef2217;hpb=c0c85097014e5b007075ab71d9b5bee412e28dd5;p=idzebra-moved-to-github.git diff --git a/include/charmap.h b/include/charmap.h index b653e97..23661a5 100644 --- a/include/charmap.h +++ b/include/charmap.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995-1997, Index Data. + * Copyright (c) 1995-1999, Index Data. * * All rights reserved. * @@ -36,7 +36,19 @@ * OF THIS SOFTWARE. * * $Log: charmap.h,v $ - * Revision 1.3 1997-09-05 15:29:59 adam + * Revision 1.6 1999-11-30 13:48:03 adam + * Improved installation. Updated for inclusion of YAZ header files. + * + * Revision 1.5 1999/09/07 07:19:21 adam + * Work on character mapping. Implemented replace rules. + * + * Revision 1.4 1997/10/27 14:33:04 adam + * Moved towards generic character mapping depending on "structure" + * field in abstract syntax file. Fixed a few memory leaks. Fixed + * bug with negative integers when doing searches with relational + * operators. + * + * Revision 1.3 1997/09/05 15:29:59 adam * Changed prototype for chr_map_input - added const. * Added support for C++, headers uses extern "C" for public definitions. * @@ -45,29 +57,35 @@ #ifndef CHARMAP_H #define CHARMAP_H +#include + #ifdef __cplusplus extern "C" { #endif -extern const char *CHR_UNKNOWN; -extern const char *CHR_SPACE; -extern const char *CHR_BASE; +YAZ_EXPORT extern const char *CHR_UNKNOWN; +YAZ_EXPORT extern const char *CHR_SPACE; +YAZ_EXPORT extern const char *CHR_BASE; struct chr_t_entry; typedef struct chr_t_entry chr_t_entry; -typedef struct chrmaptab -{ - chr_t_entry *input; /* mapping table for input data */ - chr_t_entry *query_equiv; /* mapping table for queries */ - unsigned char *output[256]; /* return mapping - for display of registers */ - int base_uppercase; /* Start of upper-case ordinals */ -} chrmaptab, *CHRMAPTAB; +typedef struct chrmaptab_info *chrmaptab; + +YAZ_EXPORT chrmaptab chrmaptab_create(const char *tabpath, const char *name, + int map_only); +YAZ_EXPORT void chrmaptab_destroy (chrmaptab tab); + +YAZ_EXPORT const char **chr_map_input(chrmaptab t, const char **from, int len); +YAZ_EXPORT const char **chr_map_input_x(chrmaptab t, + const char **from, int *len); +YAZ_EXPORT const char **chr_map_input_q(chrmaptab maptab, + const char **from, int len, + const char **qmap); + +YAZ_EXPORT const char *chr_map_output(chrmaptab t, const char **from, int len); -chrmaptab *chr_read_maptab(const char *tabpath, const char *name); -int chr_map_chrs(chr_t_entry *t, char **from, int len, int *read, char **to, - int max); -const char **chr_map_input(chr_t_entry *t, const char **from, int len); +YAZ_EXPORT unsigned char zebra_prim(char **s); #ifdef __cplusplus }