dictre.h
author viric <viriketo@gmail.com>
Fri, 30 Mar 2012 18:54:55 +0200
changeset 31 2bcc08d0f1d8
parent 24 026a2ba0ce16
permissions -rw-r--r--
Fixing an error message
viric@10
     1
enum {
viric@14
     2
    MAXWORD=200,
viric@24
     3
    MAXDEF=100000,
viric@17
     4
    END_OF_URL=-2,
viric@17
     5
    HTTP_DECODE_ERROR=-3
viric@10
     6
};
viric@10
     7
viric@15
     8
enum Case
viric@15
     9
{
viric@15
    10
    LCASE = 0,
viric@15
    11
    UCASE = 1
viric@15
    12
};
viric@15
    13
viric@0
    14
struct Words
viric@0
    15
{
viric@0
    16
    struct Word *first;
viric@0
    17
    int length;
viric@0
    18
};
viric@0
    19
viric@0
    20
struct Word
viric@0
    21
{
viric@0
    22
    char *w;
viric@0
    23
    int def;
viric@0
    24
};
viric@0
    25
viric@0
    26
struct Def
viric@0
    27
{
viric@0
    28
    char *d;
viric@0
    29
    int offset;
viric@0
    30
    int length;
viric@0
    31
};
viric@0
    32
viric@17
    33
struct Dict
viric@17
    34
{
viric@17
    35
    unsigned char *index;
viric@17
    36
    int indexfd;
viric@17
    37
    int indexsize;
viric@17
    38
    FILE *defs;
viric@21
    39
    int trim_first_line;
viric@21
    40
    int trim_last_newlines;
viric@17
    41
};
viric@17
    42
viric@0
    43
/* write.c */
viric@0
    44
void write_dictionary(const char *name);
viric@0
    45
viric@0
    46
/* dict.c */
viric@0
    47
char * get_word(FILE *index);
viric@0
    48
int get_int(FILE *index);
viric@0
    49
char * get_def(FILE *fdefs, int offset, int length);
viric@8
    50
int str2int(const char *str);
viric@8
    51
int num_to_ia5(char *dest, int n);
viric@0
    52
viric@0
    53
/* filter.c */
viric@0
    54
void filter_all(const char *filter_par);
viric@0
    55
viric@0
    56
/* sort.c */
viric@0
    57
int sort_words();
viric@0
    58
/* load.c */
viric@0
    59
void load_init();
viric@0
    60
void load_dictionary(FILE *index, FILE *fdefs);
viric@0
    61
void print_words();
viric@2
    62
viric@2
    63
/* fastmalloc */
viric@2
    64
void * fastmalloc(int newsize);
viric@5
    65
viric@5
    66
/* repeated.c */
viric@5
    67
void new_hashdef(struct Def *ptr, int index);
viric@5
    68
int def_repeated(struct Def *ptr);
viric@5
    69
void init_repeated();
viric@5
    70
void remove_def(int i);
viric@10
    71
viric@10
    72
viric@10
    73
/* FOR ZPROCESS */
viric@10
    74
/* zdefs.c */
viric@10
    75
void zprocess_def(const char *root, char *def);
viric@10
    76
viric@10
    77
viric@10
    78
/* zhash.c */
viric@10
    79
void insert_word(const char *word, const char *unflexed);
viric@10
    80
void init_wordlist();
viric@10
    81
void dump_wordlist();
viric@10
    82
viric@10
    83
/* zrus.c */
viric@10
    84
char * mix_accents(char *a, const char *b);
viric@10
    85
void remove_accent(unsigned char *dest, const unsigned char *from);
viric@14
    86
int until_newword(const unsigned char *str, int *index);
viric@14
    87
int until_noword(const char *str, int *index);
viric@14
    88
int skip_newline(const char *str, int *index);
viric@14
    89
int is_ASCII(unsigned char c);
viric@15
    90
int get_case(enum Case *vcase, const char *str);
viric@15
    91
void get_lowcase_str(char *inout, const char *str);
viric@15
    92
void reapply_case(char *out, const char *in, const enum Case *vcase);
viric@16
    93
void remove_jo(char *str);
viric@14
    94
viric@14
    95
/* find.c */
viric@17
    96
void init_dictionary(struct Dict *d, const char *base);
viric@17
    97
void end_dictionary(struct Dict *d);
viric@17
    98
void find_def(struct Dict *d, const char *word, char * def);
viric@17
    99
viric@17
   100
/* http_dec.c */
viric@17
   101
int http_getc(FILE *f);