Watt-32 tcp/ip  2.2 dev-rel.10
pcconfig.h
Go to the documentation of this file.
1 
3 #ifndef _w32_PCCONFIG_H
4 #define _w32_PCCONFIG_H
5 
6 #if !defined(USE_BUFFERED_IO)
7 #include <fcntl.h> /* Defines O_RDONLY and O_BINARY, needed by FOPEN_x macros */
8 #endif
9 
10 #define sock_inactive W32_NAMESPACE (sock_inactive)
11 #define sock_data_timeout W32_NAMESPACE (sock_data_timeout)
12 #define sock_delay W32_NAMESPACE (sock_delay)
13 #define multihomes W32_NAMESPACE (multihomes)
14 #define print_hook W32_NAMESPACE (print_hook)
15 #define usr_post_init W32_NAMESPACE (usr_post_init)
16 #define cookies W32_NAMESPACE (cookies)
17 #define last_cookie W32_NAMESPACE (last_cookie)
18 #define ctrace_on W32_NAMESPACE (ctrace_on)
19 #define dynamic_host W32_NAMESPACE (dynamic_host)
20 #define get_argv0 W32_NAMESPACE (get_argv0)
21 #define parse_config_table W32_NAMESPACE (parse_config_table)
22 #define expand_var_str W32_NAMESPACE (expand_var_str)
23 
24 extern int sock_inactive;
25 extern int sock_data_timeout;
26 extern int sock_delay;
27 extern WORD multihomes;
28 
29 extern void (W32_CALL *print_hook) (const char *);
30 
31 extern DWORD cookies [MAX_COOKIES];
32 extern WORD last_cookie;
33 extern int ctrace_on;
34 extern BOOL dynamic_host;
35 extern int stkwalk_details;
36 extern int fortify_fail_rate;
37 
38 extern const struct config_table *watt_init_cfg;
39 
40 extern const char *get_argv0 (void);
41 extern void _add_server (WORD *counter, DWORD *array, int array_dim, DWORD value);
42 extern int netdb_init (void);
43 extern void netdb_warn (const char *fname);
44 extern const char *expand_var_str (const char *str);
45 
46 /*
47  * Using buffered I/O speeds up reading config-file, but uses more data/code.
48  * Non-DOSX targets where memory is tight doesn't have "#define USE_BUFFERED_IO"
49  * by default (see config.h)
50  */
51 #if defined(USE_BUFFERED_IO) /* The normal case */
52  typedef FILE* WFILE;
53 
54  #define FOPEN_BIN(fil,name) (fil = fopen (name, "rb"))
55  #define FOPEN_TXT(fil,name) (fil = fopen (name, "rt"))
56  #define FOPEN_APP(fil,name) (fil = fopen (name, "at"))
57  #define FREAD(ptr,fil) fread ((char*)(ptr), 1, 1, fil)
58  #define FCLOSE(fil) fclose (fil)
59 
60 #else /* Use these when memory is tight */
61  typedef int WFILE;
62 
63  #define FOPEN_BIN(fil,name) (fil = open (name, O_RDONLY|O_BINARY), (fil != -1))
64  #define FOPEN_TXT(fil,name) (fil = open (name, O_RDONLY|O_TEXT), (fil != -1))
65  #define FOPEN_APP(fil,name) UNIMPLEMENTED()
66  #define FREAD(ptr,fil) read (fil, (char*)(ptr), 1)
67  #define FCLOSE(fil) close (fil)
68 #endif
69 
70 extern long tcp_parse_file (WFILE fil, const struct config_table *cfg);
71 
72 #endif
73 
void(W32_CALL *print_hook)(const char *)
Hook to a function called after we're initialised.
const char * get_argv0(void)
Return argv[0] as passed to main().
Definition: pcconfig.c:668
const char * expand_var_str(const char *str)
Return a string with a environment variable expanded (only one).
Definition: pcconfig.c:231
int netdb_init(void)
Called from most <netdb.h> functions in case watt_sock_init() wasn't called first to initialise things...
Definition: pcconfig.c:1215