diff options
| author | 2023-06-05 18:22:04 +0200 | |
|---|---|---|
| committer | 2023-06-05 18:22:04 +0200 | |
| commit | e788a5bf8fde50cc8ba30390f829bb78e18add4d (patch) | |
| tree | 532fefe102889758dfdec12108df2fd52f53543c /snac.c | |
| parent | Moved srv_running variable to httpd.c. (diff) | |
| download | penes-snac2-e788a5bf8fde50cc8ba30390f829bb78e18add4d.tar.gz penes-snac2-e788a5bf8fde50cc8ba30390f829bb78e18add4d.tar.xz penes-snac2-e788a5bf8fde50cc8ba30390f829bb78e18add4d.zip | |
Some prototype tweaks.
Diffstat (limited to '')
| -rw-r--r-- | snac.c | 16 |
1 files changed, 8 insertions, 8 deletions
| @@ -22,9 +22,9 @@ | |||
| 22 | #include <sys/time.h> | 22 | #include <sys/time.h> |
| 23 | #include <sys/stat.h> | 23 | #include <sys/stat.h> |
| 24 | 24 | ||
| 25 | d_char *srv_basedir = NULL; | 25 | xs_str *srv_basedir = NULL; |
| 26 | d_char *srv_config = NULL; | 26 | xs_dict *srv_config = NULL; |
| 27 | d_char *srv_baseurl = NULL; | 27 | xs_str *srv_baseurl = NULL; |
| 28 | 28 | ||
| 29 | int dbglevel = 0; | 29 | int dbglevel = 0; |
| 30 | 30 | ||
| @@ -48,7 +48,7 @@ int valid_status(int status) | |||
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | 50 | ||
| 51 | d_char *tid(int offset) | 51 | xs_str *tid(int offset) |
| 52 | /* returns a time-based Id */ | 52 | /* returns a time-based Id */ |
| 53 | { | 53 | { |
| 54 | struct timeval tv; | 54 | struct timeval tv; |
| @@ -82,7 +82,7 @@ int validate_uid(const char *uid) | |||
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | 84 | ||
| 85 | void srv_debug(int level, d_char *str) | 85 | void srv_debug(int level, xs_str *str) |
| 86 | /* logs a debug message */ | 86 | /* logs a debug message */ |
| 87 | { | 87 | { |
| 88 | if (xs_str_in(str, srv_basedir) != -1) { | 88 | if (xs_str_in(str, srv_basedir) != -1) { |
| @@ -99,11 +99,11 @@ void srv_debug(int level, d_char *str) | |||
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | 101 | ||
| 102 | void snac_debug(snac *snac, int level, d_char *str) | 102 | void snac_debug(snac *snac, int level, xs_str *str) |
| 103 | /* prints a user debugging information */ | 103 | /* prints a user debugging information */ |
| 104 | { | 104 | { |
| 105 | xs *o_str = str; | 105 | xs *o_str = str; |
| 106 | d_char *msg = xs_fmt("[%s] %s", snac->uid, o_str); | 106 | xs_str *msg = xs_fmt("[%s] %s", snac->uid, o_str); |
| 107 | 107 | ||
| 108 | if (xs_str_in(msg, snac->basedir) != -1) { | 108 | if (xs_str_in(msg, snac->basedir) != -1) { |
| 109 | /* replace long basedir references with ~ */ | 109 | /* replace long basedir references with ~ */ |
| @@ -114,7 +114,7 @@ void snac_debug(snac *snac, int level, d_char *str) | |||
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | 116 | ||
| 117 | d_char *hash_password(const char *uid, const char *passwd, const char *nonce) | 117 | xs_str *hash_password(const char *uid, const char *passwd, const char *nonce) |
| 118 | /* hashes a password */ | 118 | /* hashes a password */ |
| 119 | { | 119 | { |
| 120 | xs *d_nonce = NULL; | 120 | xs *d_nonce = NULL; |