diff options
| author | cbdev <cb@cbcdn.com> | 2019-06-20 08:19:29 +0200 |
|---|---|---|
| committer | cbdev <cb@cbcdn.com> | 2019-06-20 08:19:29 +0200 |
| commit | e60aa0c5779bce199020236c0ac3a4beace571cb (patch) | |
| tree | 52b5df2816b944ceeeb6bb2762d6e7bd5cea457b /config.c | |
| parent | 303e464579e2fc9961d4d9f4841e916f9aa8963f (diff) | |
| download | websocksy-e60aa0c5779bce199020236c0ac3a4beace571cb.tar.gz websocksy-e60aa0c5779bce199020236c0ac3a4beace571cb.tar.bz2 websocksy-e60aa0c5779bce199020236c0ac3a4beace571cb.zip | |
Implement additional framing functions (Fixes #3)
Diffstat (limited to 'config.c')
| -rw-r--r-- | config.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -6,11 +6,13 @@ #include "config.h" #include "plugin.h" +/* Configuration file parser state */ static enum /*_config_file_section*/ { cfg_main, cfg_backend } config_section = cfg_main; +/* Evaluate a single line within a configuration file */ static int config_file_line(ws_config* config, char* key, char* value, size_t line_no){ if(!strcmp(key, "port")){ free(config->port); @@ -37,6 +39,7 @@ static int config_file_line(ws_config* config, char* key, char* value, size_t li return 0; } +/* Read and parse a configuration file */ int config_parse_file(ws_config* config, char* filename){ ssize_t line_current; size_t line_alloc = 0, line_no = 1, key_len; @@ -105,6 +108,7 @@ int config_parse_file(ws_config* config, char* filename){ return 0; } +/* Parse an argument list */ int config_parse_arguments(ws_config* config, int argc, char** argv){ size_t u; char* option = NULL, *value = NULL; |
