Definition in file pcconfig.h.
Go to the source code of this file.
Data Structures | |
| struct | config_table |
Typedefs | |
| typedef FILE * | WFILE |
| typedef long(* | WattUserConfigFunc )(int pass, const struct config_table *cfg) |
Enumerations | |
| enum | config_tab_types { ARG_ATOI, ARG_ATOB, ARG_ATOW, ARG_ATOIP, ARG_ATOX_B, ARG_ATOX_W, ARG_ATOX_D, ARG_STRDUP, ARG_STRCPY, ARG_RESOLVE, ARG_FUNC } |
Functions | |
| const char * | get_argv0 (void) |
| Return argv[0] as passed to main(). | |
| void | _add_server (WORD *counter, WORD max, DWORD *array, DWORD value) |
| int | netdb_init (void) |
| Called from most <netdb.h> functions in case watt_sock_init() wasn't called first to initialise things. | |
| void | netdb_warn (const char *fname) |
| W32_FUNC int | tcp_config_name (char *name, int max) |
| W32_FUNC long | tcp_config (const char *path) |
| W32_FUNC void | tcp_set_debug_state (WORD x) |
| Used when DEBUG=x is defined in the config file Moved from pctcp.c. | |
| W32_FUNC int | parse_config_table (const struct config_table *tab, const char *section, const char *name, const char *value) |
| Parse the config-table and if a match is found for ('section'+'.'+)'name' either store variable to 'value' or call function with 'value'. | |
| W32_FUNC const char * | ExpandVarStr (const char *str) |
| Return a string with a environment variable expanded (only one). | |
| long | tcp_parse_file (WFILE f, const struct config_table *cfg) |
| void | tcp_inject_config (const struct config_table *cfg, const char *key, const char *value) |
| Callable from a user application to inject config values before the normal WATTCP.CFG is loaded and parsed. | |
| W32_FUNC WattUserConfigFunc | _watt_user_config (WattUserConfigFunc fn) |
| A user application may call the `_watt_user_config()' function prior to calling sock_init() to inject its own configuration values into the tcp_config() parser. | |
Variables | |
| W32_DATA int | sock_inactive |
| W32_DATA int | sock_data_timeout |
| W32_DATA int | sock_delay |
| W32_DATA WORD | multihomes |
| W32_DATA void(* | print_hook )(const char *) |
| W32_DATA void(* | usr_init )(const char *, const char *) |
| W32_DATA void(* | usr_post_init )(void) |
| W32_DATA DWORD | cookies [MAX_COOKIES] |
| W32_DATA WORD | last_cookie |
| W32_DATA int | debug_on |
| W32_DATA int | ctrace_on |
| W32_DATA BOOL | dynamic_host |
| const struct config_table * | watt_init_cfg |
| WattUserConfigFunc | _watt_user_config_fn |
|
|
Convert 'arg_func' below to this type.
|
|
|
A user application may call the `_watt_user_config()' function prior to calling sock_init() to inject its own configuration values into the tcp_config() parser. Useful when running diskless and setting `_watt_no_config = 0'. Example:
In most cases 'pass' can probably be ignored. static long my_config_fn (int pass, const struct config_table *cfg) { // Keyword case is not significant (tcp_inject_config will convert // all keys to uppercase) tcp_inject_config (cfg, "My_IP", "192.168.0.98"); tcp_inject_config (cfg, "NetMask", "255.255.255.0"); tcp_inject_config (cfg, "Gateway", "192.168.0.1"); (void)pass; return (1); // Returning 0 would make tcp_config() return 0 too, // as if the config file was not found } int main (void) { _watt_no_config = 1; _watt_user_config (my_config_fn); if (sock_init()) return (-1); ... } Never called inside Watt-32. Definition at line 186 of file SOCK_INI.C. |
|
|
Return a string with a environment variable expanded (only one). E.g. if environment variable ETC is "c:\network\watt\bin", "$(ETC)\hosts" becomes "c:\network\watt\bin\hosts" If ETC isn't defined, "$(ETC)\hosts" becomes "\hosts".
|
|
||||||||||||||||
|
Callable from a user application to inject config values before the normal WATTCP.CFG is loaded and parsed. See '_watt_user_config' in sock_ini.c. Definition at line 850 of file PCCONFIG.C. |
1.3.8