GnuCOBOL
2.0
A free COBOL compiler
|
#include "config.h"
#include "defaults.h"
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <ctype.h>
#include "cobc.h"
#include "config.def"
Go to the source code of this file.
Data Structures | |
struct | config_struct |
struct | includelist |
Macros | |
#define | CB_CONFIG_ANY(type, var, name) type var = (type)0; |
#define | CB_CONFIG_INT(var, name) unsigned int var = 0; |
#define | CB_CONFIG_STRING(var, name) const char *var = NULL; |
#define | CB_CONFIG_BOOLEAN(var, name) unsigned int var = 0; |
#define | CB_CONFIG_SUPPORT(var, name) enum cb_support var = CB_OK; |
#define | CB_CONFIG_ANY(type, var, name) , {CB_ANY, name, (void *)&var, NULL} |
#define | CB_CONFIG_INT(var, name) , {CB_INT, name, (void *)&var, NULL} |
#define | CB_CONFIG_STRING(var, name) , {CB_STRING, name, (void *)&var, NULL} |
#define | CB_CONFIG_BOOLEAN(var, name) , {CB_BOOLEAN, name, (void *)&var, NULL} |
#define | CB_CONFIG_SUPPORT(var, name) , {CB_SUPPORT, name, (void *)&var, NULL} |
#define | CB_CONFIG_SIZE sizeof(config_table) / sizeof(struct config_struct) |
Enumerations | |
enum | cb_config_type { CB_ANY = 0, CB_INT, CB_STRING, CB_BOOLEAN, CB_SUPPORT } |
Functions | |
static char * | read_string (const char *text) |
static void | invalid_value (const char *fname, const int line, const char *name, const char *val, const char *str, const int max, const int min) |
static void | unsupported_value (const char *fname, const int line, const char *name, const char *val) |
int | cb_load_std (const char *name) |
int | cb_config_entry (char *buff, const char *fname, const int line) |
static int | cb_load_conf_file (const char *conf_file, int isoptional) |
int | cb_load_conf (const char *fname, const int prefix_dir) |
Variables | |
static struct config_struct | config_table [] |
static struct includelist * | conf_includes = ((void*)0) |
#define CB_CONFIG_ANY | ( | type, | |
var, | |||
name | |||
) | type var = (type)0; |
#define CB_CONFIG_BOOLEAN | ( | var, | |
name | |||
) | unsigned int var = 0; |
#define CB_CONFIG_BOOLEAN | ( | var, | |
name | |||
) | , {CB_BOOLEAN, name, (void *)&var, NULL} |
#define CB_CONFIG_SIZE sizeof(config_table) / sizeof(struct config_struct) |
Definition at line 97 of file config.c.
Referenced by cb_config_entry(), and cb_load_conf().
#define CB_CONFIG_SUPPORT | ( | var, | |
name | |||
) | enum cb_support var = CB_OK; |
#define CB_CONFIG_SUPPORT | ( | var, | |
name | |||
) | , {CB_SUPPORT, name, (void *)&var, NULL} |
enum cb_config_type |
Enumerator | |
---|---|
CB_ANY | |
CB_INT | |
CB_STRING | |
CB_BOOLEAN | |
CB_SUPPORT |
Definition at line 33 of file config.c.
int cb_config_entry | ( | char * | buff, |
const char * | fname, | ||
const int | line | ||
) |
Definition at line 153 of file config.c.
References _, add_reserved_word(), CB_ANY, CB_ARCHAIC, CB_ASSIGN_IBM, CB_ASSIGN_MF, CB_BINARY_SIZE_1_2_4_8, CB_BINARY_SIZE_1__8, CB_BINARY_SIZE_2_4_8, CB_BOOLEAN, CB_BYTEORDER_BIG_ENDIAN, CB_BYTEORDER_NATIVE, CB_CONFIG_SIZE, CB_ERROR, CB_IGNORE, CB_INT, CB_OBSOLETE, CB_OK, CB_SKIP, CB_STRING, CB_SUPPORT, CB_UNCONFORMABLE, CB_WARNING, cob_expand_env_string(), cob_free(), COB_MAX_WORDLEN, config_table, configuration_error(), invalid_value(), config_struct::name, includelist::name, NULL, read_string(), remove_reserved_word(), unsupported_value(), config_struct::val, and config_struct::var.
Referenced by cb_load_conf_file(), and process_command_line().
int cb_load_conf | ( | const char * | fname, |
const int | prefix_dir | ||
) |
Definition at line 476 of file config.c.
References _, CB_CONFIG_SIZE, cb_load_conf_file(), cob_config_dir, COB_NORMAL_BUFF, COB_NORMAL_MAX, config_table, configuration_error(), configuration_warning(), includelist::name, NULL, SLASH_CHAR, unlikely, and config_struct::val.
Referenced by cb_load_std(), and process_command_line().
|
static |
Definition at line 351 of file config.c.
References _, cb_config_entry(), cob_config_dir, cob_free(), cob_malloc(), COB_NORMAL_BUFF, COB_NORMAL_MAX, COB_SMALL_BUFF, conf_includes, configuration_error(), F_OK, line, includelist::name, includelist::next, NULL, and SLASH_CHAR.
Referenced by cb_load_conf().
int cb_load_std | ( | const char * | name | ) |
Definition at line 147 of file config.c.
References cb_load_conf().
Referenced by process_command_line().
|
static |
Definition at line 120 of file config.c.
References _, and configuration_error().
Referenced by cb_config_entry().
|
static |
Definition at line 102 of file config.c.
References cobc_main_strdup().
Referenced by cb_config_entry().
|
static |
Definition at line 138 of file config.c.
References _, and configuration_error().
Referenced by cb_config_entry().
|
static |
Referenced by cb_load_conf_file().
|
static |
Referenced by cb_config_entry(), and cb_load_conf().