src/server/util/util.h

changeset 415
d938228c382e
parent 386
b91f8efadb63
equal deleted inserted replaced
414:99a34860c105 415:d938228c382e
33 33
34 #ifndef BASE_UTIL_H 34 #ifndef BASE_UTIL_H
35 #define BASE_UTIL_H 35 #define BASE_UTIL_H
36 36
37 #include "../daemon/netsite.h" 37 #include "../daemon/netsite.h"
38 #include <ucx/string.h> 38 #include <cx/string.h>
39 #include "pool.h" 39 #include "pool.h"
40 40
41 #ifdef XP_UNIX 41 #ifdef XP_UNIX
42 #include <pwd.h> 42 #include <pwd.h>
43 #endif 43 #endif
200 NSAPI_PUBLIC void INTutil_random(void *buf, size_t sz); 200 NSAPI_PUBLIC void INTutil_random(void *buf, size_t sz);
201 201
202 NSAPI_PUBLIC PRBool INTutil_format_http_version(const char *v, int *protv_num, char *buffer, int size); 202 NSAPI_PUBLIC PRBool INTutil_format_http_version(const char *v, int *protv_num, char *buffer, int size);
203 203
204 NSAPI_PUBLIC int INTutil_getboolean(const char *v, int def); 204 NSAPI_PUBLIC int INTutil_getboolean(const char *v, int def);
205 int util_getboolean_s(scstr_t s, int def); 205 int util_getboolean_s(cxstring s, int def);
206 206
207 // new 207 // new
208 NSAPI_PUBLIC int util_strtoint(const char *str, int64_t *value); 208 NSAPI_PUBLIC int util_strtoint(const char *str, int64_t *value);
209 NSAPI_PUBLIC const char* util_resource_name(const char *url); 209 NSAPI_PUBLIC const char* util_resource_name(const char *url);
210 NSAPI_PUBLIC char* util_parent_path(const char *path); 210 NSAPI_PUBLIC char* util_parent_path(const char *path);
239 239
240 NSAPI_PUBLIC int util_qtoi(const char *q, const char **p); 240 NSAPI_PUBLIC int util_qtoi(const char *q, const char **p);
241 241
242 /* path utils */ 242 /* path utils */
243 NSAPI_PUBLIC 243 NSAPI_PUBLIC
244 sstr_t util_path_append(pool_handle_t *pool, char *path, char *child); 244 cxmutstr util_path_append(pool_handle_t *pool, char *path, char *child);
245 NSAPI_PUBLIC 245 NSAPI_PUBLIC
246 sstr_t util_path_remove_last(sstr_t path); 246 cxmutstr util_path_remove_last(cxmutstr path);
247 NSAPI_PUBLIC 247 NSAPI_PUBLIC
248 void util_add_ppath(sstr_t root, sstr_t path, pblock *vars); 248 void util_add_ppath(cxmutstr root, cxmutstr path, pblock *vars);
249 249
250 /* ucx utils */ 250
251 UcxAllocator util_pool_allocator(pool_handle_t *pool); 251 int util_isdate(const char *str);
252
253 int util_isdate(char *str);
254 252
255 /* --- End common function prototypes --- */ 253 /* --- End common function prototypes --- */
256 254
257 /* --- Begin Unix-only function prototypes --- */ 255 /* --- Begin Unix-only function prototypes --- */
258 256

mercurial