| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
#ifndef INI_DEFINES_H |
| 23 |
#define INI_DEFINES_H |
| 24 |
|
| 25 |
#include <stdint.h> |
| 26 |
|
| 27 |
#define NAME_OVERHEAD 10 |
| 28 |
|
| 29 |
#define SLASH "/" |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
#define FILE_ERROR_SET "ini_file_error_set" |
| 34 |
|
| 35 |
|
| 36 |
#define WARNING_TXT _("Warning") |
| 37 |
#define ERROR_TXT _("Error") |
| 38 |
|
| 39 |
#define WRONG_COLLECTION _("Passed in list is not a list of parse errors.\n") |
| 40 |
#define FAILED_TO_PROCCESS _("Internal Error. Failed to process error list.\n") |
| 41 |
#define ERROR_HEADER _("Parsing errors and warnings in file: %s\n") |
| 42 |
|
| 43 |
#define WRONG_GRAMMAR _("Passed in list is not a list of grammar errors.\n") |
| 44 |
#define FAILED_TO_PROC_G _("Internal Error. Failed to process list of grammar errors.\n") |
| 45 |
#define ERROR_HEADER_G _("Logical errors and warnings in file: %s\n") |
| 46 |
|
| 47 |
#define WRONG_VALIDATION _("Passed in list is not a list of validation errors.\n") |
| 48 |
#define FAILED_TO_PROC_V _("Internal Error. Failed to process list of validation errors.\n") |
| 49 |
#define ERROR_HEADER_V _("Validation errors and warnings in file: %s\n") |
| 50 |
|
| 51 |
#define LINE_FORMAT _("%s (%d) on line %d: %s") |
| 52 |
#define MAX_ERROR_LINE 120 |
| 53 |
|
| 54 |
|
| 55 |
#define RET_PAIR 0 |
| 56 |
#define RET_COMMENT 1 |
| 57 |
#define RET_SECTION 2 |
| 58 |
#define RET_INVALID 3 |
| 59 |
#define RET_EMPTY 4 |
| 60 |
#define RET_EOF 5 |
| 61 |
#define RET_ERROR 6 |
| 62 |
|
| 63 |
#define INI_ERROR "errors" |
| 64 |
#define INI_METADATA "meta" |
| 65 |
#define INI_ERROR_NAME "errname" |
| 66 |
#define INI_CONFIG_NAME "INI" |
| 67 |
|
| 68 |
#define INI_SECTION_KEY "[" |
| 69 |
|
| 70 |
|
| 71 |
#define MAX_VALUE PATH_MAX |
| 72 |
#define BUFFER_SIZE MAX_KEY + MAX_VALUE + 3 |
| 73 |
|
| 74 |
|
| 75 |
#define CONVERSION_BUFFER 80 |
| 76 |
|
| 77 |
|
| 78 |
#define INI_VALUE_BLOCK 100 |
| 79 |
|
| 80 |
|
| 81 |
#define INI_WRAP_BOUNDARY 80 |
| 82 |
|
| 83 |
|
| 84 |
#define COL_CLASS_INI_BASE 20000 |
| 85 |
#define COL_CLASS_INI_CONFIG COL_CLASS_INI_BASE + 0 |
| 86 |
#define COL_CLASS_INI_SECTION COL_CLASS_INI_BASE + 1 |
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
#define INI_DEFAULT_SECTION "default" |
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
#define COL_CLASS_INI_PERROR COL_CLASS_INI_BASE + 2 |
| 102 |
|
| 103 |
|
| 104 |
|
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
#define COL_CLASS_INI_META COL_CLASS_INI_BASE + 4 |
| 109 |
|
| 110 |
|
| 111 |
#define INI_FAMILY_PARSING 0 |
| 112 |
#define INI_FAMILY_VALIDATION 1 |
| 113 |
#define INI_FAMILY_GRAMMAR 2 |
| 114 |
|
| 115 |
#define INI_MV1S_MASK 0x000F |
| 116 |
|
| 117 |
#define INI_MV2S_MASK 0x00F0 |
| 118 |
|
| 119 |
#define INI_MS_MASK 0x0F00 |
| 120 |
#define INI_MS_MODE_MASK 0x0300 |
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
typedef const char * (*error_fn)(int error); |
| 125 |
|
| 126 |
int ini_flags_have(uint32_t flag, uint32_t flags); |
| 127 |
|
| 128 |
#endif |