Home | History | Annotate | Download | only in genprops
      1 /*
      2 *******************************************************************************
      3 *
      4 *   Copyright (C) 1999-2008, International Business Machines
      5 *   Corporation and others.  All Rights Reserved.
      6 *
      7 *******************************************************************************
      8 *   file name:  genprops.h
      9 *   encoding:   US-ASCII
     10 *   tab size:   8 (not used)
     11 *   indentation:4
     12 *
     13 *   created on: 1999dec13
     14 *   created by: Markus W. Scherer
     15 */
     16 
     17 #ifndef __GENPROPS_H__
     18 #define __GENPROPS_H__
     19 
     20 #include "unicode/utypes.h"
     21 #include "utrie.h"
     22 #include "propsvec.h"
     23 
     24 /* file definitions */
     25 #define DATA_NAME "uprops"
     26 #define DATA_TYPE "icu"
     27 
     28 /* character properties */
     29 typedef struct {
     30     uint32_t code;
     31     int32_t numericValue; /* see numericType */
     32     uint32_t denominator; /* 0: no value */
     33     uint8_t generalCategory, numericType, exponent;
     34 } Props;
     35 
     36 /* global flags */
     37 extern UBool beVerbose, haveCopyright;
     38 
     39 extern const char *const
     40 genCategoryNames[];
     41 
     42 /* properties vectors in props2.c */
     43 extern UPropsVectors *pv;
     44 
     45 /* prototypes */
     46 U_CFUNC void
     47 writeUCDFilename(char *basename, const char *filename, const char *suffix);
     48 
     49 U_CFUNC UBool
     50 isToken(const char *token, const char *s);
     51 
     52 U_CFUNC int32_t
     53 getTokenIndex(const char *const tokens[], int32_t countTokens, const char *s);
     54 
     55 extern void
     56 setUnicodeVersion(const char *v);
     57 
     58 extern void
     59 initStore(void);
     60 
     61 extern void
     62 exitStore(void);
     63 
     64 extern uint32_t
     65 makeProps(Props *p);
     66 
     67 extern void
     68 addProps(uint32_t c, uint32_t props);
     69 
     70 extern uint32_t
     71 getProps(uint32_t c);
     72 
     73 extern void
     74 repeatProps(uint32_t first, uint32_t last, uint32_t props);
     75 
     76 extern void
     77 generateData(const char *dataDir, UBool csource);
     78 
     79 /* props2.c */
     80 U_CFUNC void
     81 initAdditionalProperties(void);
     82 
     83 U_CFUNC void
     84 exitAdditionalProperties(void);
     85 
     86 U_CFUNC void
     87 generateAdditionalProperties(char *filename, const char *suffix, UErrorCode *pErrorCode);
     88 
     89 U_CFUNC int32_t
     90 writeAdditionalData(FILE *f, uint8_t *p, int32_t capacity, int32_t indexes[16]);
     91 
     92 #endif
     93