#include "document.h" typedef enum config_types { C_DEBUG, C_CPL, C_LPP, C_TOP_MARGIN, C_LEFT_MARGIN, C_FONT_SIZE, C_FONT_FACE, C_PAGE_MODE, C_TITLE, C_AUTHOR, C_SUBJECT, C_EXTRA_KEY, C_EXTRA_DATA, C_UNKNOWN } config_types; typedef struct config_thingy { char *keyword; config_types val; } config_thingy; /* Gotta match */ #define TOTAL_KEYWORDS 13 config_thingy conflist[] = { { "debug", C_DEBUG }, { "chars_per_line", C_CPL }, { "lines_per_page", C_LPP }, { "top_margin", C_TOP_MARGIN }, { "left_margin", C_LEFT_MARGIN }, { "font_size", C_FONT_SIZE }, { "font_face", C_FONT_FACE }, { "author", C_AUTHOR }, { "subject", C_SUBJECT }, { "title", C_TITLE }, { "extra_key", C_EXTRA_KEY }, { "extra_data", C_EXTRA_DATA }, { "page_mode", C_PAGE_MODE } }; config_types resolve_keyword( const char *kw ); int parse_config( document *d, const char *config_file );