| 1 |
/** |
| 2 |
* This file is part of the Detox package. |
| 3 |
* |
| 4 |
* Copyright (c) Doug Harple <[email protected]> |
| 5 |
* |
| 6 |
* For the full copyright and license information, please view the LICENSE |
| 7 |
* file that was distributed with this source code. |
| 8 |
*/ |
| 9 |
|
| 10 |
#ifndef __DETOX_STRUCT_H |
| 11 |
#define __DETOX_STRUCT_H |
| 12 |
|
| 13 |
#include <stdlib.h> |
| 14 |
|
| 15 |
#define MAX_PATH_LEN 256 |
| 16 |
|
| 17 |
enum { |
| 18 |
FILTER_ISO8859_1 = 1, |
| 19 |
FILTER_LOWER, |
| 20 |
FILTER_MAX_LENGTH, |
| 21 |
FILTER_SAFE, |
| 22 |
FILTER_UNCGI, |
| 23 |
FILTER_UTF_8, |
| 24 |
FILTER_WIPEUP |
| 25 |
}; |
| 26 |
|
| 27 |
typedef struct { |
| 28 |
char **files; |
| 29 |
int max; |
| 30 |
int count; |
| 31 |
int ptr; |
| 32 |
} filelist_t; |
| 33 |
|
| 34 |
typedef struct { |
| 35 |
unsigned int key; |
| 36 |
char *data; |
| 37 |
} table_row_t; |
| 38 |
|
| 39 |
typedef struct { |
| 40 |
int length; |
| 41 |
int used; |
| 42 |
|
| 43 |
int max_data_length; |
| 44 |
|
| 45 |
char *default_translation; |
| 46 |
|
| 47 |
table_row_t *rows; |
| 48 |
|
| 49 |
int hits; |
| 50 |
int misses; |
| 51 |
int overwrites; |
| 52 |
int seeks; |
| 53 |
|
| 54 |
int use_hash; |
| 55 |
int builtin; |
| 56 |
int max_key; |
| 57 |
} table_t; |
| 58 |
|
| 59 |
typedef struct filter_t_ref { |
| 60 |
struct filter_t_ref *next; |
| 61 |
int cleaner; |
| 62 |
char *filename; |
| 63 |
char *builtin; |
| 64 |
int remove_trailing; |
| 65 |
size_t max_length; |
| 66 |
table_t *table; |
| 67 |
} filter_t; |
| 68 |
|
| 69 |
/* |
| 70 |
* Holds information about all of the defined sequences |
| 71 |
*/ |
| 72 |
typedef struct sequence_t_ref { |
| 73 |
struct sequence_t_ref *next; |
| 74 |
char *name; |
| 75 |
filter_t *filters; |
| 76 |
char *source_filename; |
| 77 |
} sequence_t; |
| 78 |
|
| 79 |
/* |
| 80 |
* Holds the result of a config file parse |
| 81 |
*/ |
| 82 |
typedef struct { |
| 83 |
sequence_t *sequences; |
| 84 |
filelist_t *files_to_ignore; |
| 85 |
} config_file_t; |
| 86 |
|
| 87 |
/** |
| 88 |
* Holds options that affect the entire operation of the program. |
| 89 |
*/ |
| 90 |
typedef struct { |
| 91 |
int dry_run; |
| 92 |
int is_inline_bin; |
| 93 |
int is_inline_mode; |
| 94 |
int list_sequences; |
| 95 |
int recurse; |
| 96 |
int special; |
| 97 |
int verbose; |
| 98 |
|
| 99 |
sequence_t *sequence_to_use; |
| 100 |
filelist_t *files_to_ignore; |
| 101 |
|
| 102 |
char *sequence_name; |
| 103 |
|
| 104 |
char *check_config_file; |
| 105 |
|
| 106 |
filelist_t *files; |
| 107 |
} options_t; |
| 108 |
|
| 109 |
#endif /* __DETOX_STRUCT_H */ |