src/server/util/util.h

Sat, 24 Sep 2022 16:19:24 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 24 Sep 2022 16:19:24 +0200
branch
webdav
changeset 384
f9e9f2b3e299
parent 382
9e2289c77b04
child 386
b91f8efadb63
permissions
-rw-r--r--

remove debug code

1
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 /*
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
3 *
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
4 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
5 *
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
6 * THE BSD LICENSE
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
7 *
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
8 * Redistribution and use in source and binary forms, with or without
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
9 * modification, are permitted provided that the following conditions are met:
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
10 *
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
11 * Redistributions of source code must retain the above copyright notice, this
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
12 * list of conditions and the following disclaimer.
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
13 * Redistributions in binary form must reproduce the above copyright notice,
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
14 * this list of conditions and the following disclaimer in the documentation
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
15 * and/or other materials provided with the distribution.
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
16 *
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
17 * Neither the name of the nor the names of its contributors may be
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
18 * used to endorse or promote products derived from this software without
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
19 * specific prior written permission.
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
20 *
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
25 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
26 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
27 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
30 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
32 */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
33
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
34 #ifndef BASE_UTIL_H
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
35 #define BASE_UTIL_H
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
36
14
b8bf95b39952 New source folder layout
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 1
diff changeset
37 #include "../daemon/netsite.h"
91
fac51f87def0 ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 63
diff changeset
38 #include <ucx/string.h>
58
66c22e54aa90 webdav uses the vfs api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 48
diff changeset
39 #include "pool.h"
148
d861ee1455bf removes some unused stuff
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 127
diff changeset
40
d861ee1455bf removes some unused stuff
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 127
diff changeset
41 #ifdef XP_UNIX
48
37a512d7b8f6 fixed some memory leaks
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 24
diff changeset
42 #include <pwd.h>
148
d861ee1455bf removes some unused stuff
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 127
diff changeset
43 #endif
1
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
44
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
45 #ifndef NOINTNSAPI
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
46 #define INTNSAPI
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
47 #endif /* !NOINTNSAPI */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
48
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
49 /*
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
50 * util.h: A hodge podge of utility functions and standard functions which
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
51 * are unavailable on certain systems
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
52 *
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
53 * Rob McCool
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
54 */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
55
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
56 /* Needed for various reentrant functions */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
57 #define DEF_CTIMEBUF 26
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
58 #define DEF_ERRBUF 256
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
59 #define DEF_PWBUF 1024
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
60
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
61 #ifndef BASE_BUFFER_H
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
62 //include "buffer.h" /* filebuf for getline */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
63 #endif /* !BASE_BUFFER_H */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
64
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
65 /*
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
66 * UTIL_ITOA_SIZE is the minimum size for buffers passed to util_itoa().
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
67 */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
68 #define UTIL_ITOA_SIZE 12
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
69
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
70 /*
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
71 * UTIL_I64TOA_SIZE is the minimum size for buffers passed to util_i64toa().
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
72 */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
73 #define UTIL_I64TOA_SIZE 21
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
74
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
75 /* --- Begin common function prototypes --- */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
76
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
77 #ifdef INTNSAPI
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
78
24
1a7853a4257e removed some NSPR dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 14
diff changeset
79 #ifdef __cplusplus
1a7853a4257e removed some NSPR dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 14
diff changeset
80 extern "C" {
1a7853a4257e removed some NSPR dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 14
diff changeset
81 #endif
1
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
82
127
84e206063b64 adds minimal websocket implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 119
diff changeset
83 size_t util_base64decode(char *bufcoded, size_t codedbytes, char *bufout);
84e206063b64 adds minimal websocket implementation
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 119
diff changeset
84 char* util_base64encode(char *in, size_t len);
62
c47e081b6c0f added keyfile based authentication
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 58
diff changeset
85
1
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
86 NSAPI_PUBLIC
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
87 int INTutil_init_PRNetAddr(PRNetAddr * naddr, char * ipstr, int iplen, int type);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
88
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
89 NSAPI_PUBLIC
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
90 int INTutil_getline(filebuffer *buf, int lineno, int maxlen, char *l);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
91
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
92 NSAPI_PUBLIC char **INTutil_env_create(char **env, int n, int *pos);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
93
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
94 NSAPI_PUBLIC char *INTutil_env_str(const char *name, const char *value);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
95
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
96 NSAPI_PUBLIC void INTutil_env_replace(char **env, const char *name, const char *value);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
97
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
98 NSAPI_PUBLIC void INTutil_env_free(char **env);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
99
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
100 NSAPI_PUBLIC char **INTutil_env_copy(char **src, char **dst);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
101
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
102 NSAPI_PUBLIC char *INTutil_env_find(char **env, const char *name);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
103
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
104 NSAPI_PUBLIC char **util_argv_parse(const char *cmdline);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
105
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
106 NSAPI_PUBLIC char *INTutil_hostname(void);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
107
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
108 NSAPI_PUBLIC int INTutil_chdir2path(char *path);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
109
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
110 NSAPI_PUBLIC int INTutil_chdir(const char *path);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
111
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
112 NSAPI_PUBLIC char *INTutil_getcwd(void);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
113
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
114 NSAPI_PUBLIC int INTutil_is_mozilla(char *ua, char *major, char *minor);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
115
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
116 NSAPI_PUBLIC int INTutil_is_url(const char *url);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
117
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
118 NSAPI_PUBLIC int INTutil_mstr2num(const char *s);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
119
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
120 NSAPI_PUBLIC int INTutil_later_than(const struct tm *lms, const char *ims);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
121
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
122 NSAPI_PUBLIC int INTutil_time_equal(const struct tm *lms, const char *ims);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
123
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
124 NSAPI_PUBLIC int INTutil_str_time_equal(const char *t1, const char *t2);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
125
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
126 NSAPI_PUBLIC int INTutil_uri_is_evil(const char *t);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
127
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
128 NSAPI_PUBLIC int INTutil_uri_is_evil_internal(const char *t, int, int);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
129
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
130 NSAPI_PUBLIC void INTutil_uri_parse(char *uri);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
131
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
132 #ifdef XP_WIN32
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
133 NSAPI_PUBLIC int INTutil_uri_unescape_and_normalize(pool_handle_t *pool, char *s, char *unnormalized);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
134 #endif /* XP_WIN32 */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
135
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
136 NSAPI_PUBLIC void INTutil_uri_normalize_slashes(char *s);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
137
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
138 NSAPI_PUBLIC void INTutil_uri_unescape (char *s);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
139
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
140 NSAPI_PUBLIC int INTutil_uri_unescape_strict (char *s);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
141
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
142 NSAPI_PUBLIC int INTutil_uri_unescape_plus (const char *src, char *trg, int len);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
143
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
144 NSAPI_PUBLIC char *INTutil_uri_escape(char *d, const char *s);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
145
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
146 NSAPI_PUBLIC char *INTutil_uri_strip_params(char *uri);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
147
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
148 NSAPI_PUBLIC char* util_canonicalize_uri(pool_handle_t *pool, const char *uri, int len, int *pcanonlen);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
149
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
150 NSAPI_PUBLIC char* util_canonicalize_redirect(pool_handle_t *pool, const char *baseUri, const char *newUri);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
151
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
152 NSAPI_PUBLIC char *INTutil_url_escape(char *d, const char *s);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
153
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
154 NSAPI_PUBLIC char *INTutil_sh_escape(char *s);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
155
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
156 NSAPI_PUBLIC int INTutil_mime_separator(char *sep);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
157
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
158 NSAPI_PUBLIC int INTutil_itoa(int i, char *a);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
159
24
1a7853a4257e removed some NSPR dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 14
diff changeset
160 NSAPI_PUBLIC int INTutil_i64toa(int64_t i, char *a);
1
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
161
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
162
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
163 NSAPI_PUBLIC
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
164 int INTutil_vsprintf(char *s, register const char *fmt, va_list args);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
165
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
166 NSAPI_PUBLIC int INTutil_sprintf(char *s, const char *fmt, ...);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
167
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
168 NSAPI_PUBLIC int INTutil_vsnprintf(char *s, int n, register const char *fmt,
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
169 va_list args);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
170
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
171 NSAPI_PUBLIC int INTutil_snprintf(char *s, int n, const char *fmt, ...);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
172
338
c62ea2a2133b add util_asprintf and util_vasprintf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 285
diff changeset
173 NSAPI_PUBLIC int util_vasprintf(pool_handle_t *pool, char **s, const char *fmt,
c62ea2a2133b add util_asprintf and util_vasprintf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 285
diff changeset
174 va_list args);
c62ea2a2133b add util_asprintf and util_vasprintf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 285
diff changeset
175
c62ea2a2133b add util_asprintf and util_vasprintf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 285
diff changeset
176 NSAPI_PUBLIC int util_asprintf(pool_handle_t *pool, char **s, const char *fmt, ...);
c62ea2a2133b add util_asprintf and util_vasprintf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 285
diff changeset
177
1
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
178 NSAPI_PUBLIC int util_strlftime(char *dst, size_t dstsize, const char *format, const struct tm *t);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
179
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
180 NSAPI_PUBLIC int INTutil_strftime(char *s, const char *format, const struct tm *t);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
181
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
182 NSAPI_PUBLIC char *INTutil_strtok(char *s1, const char *s2, char **lasts);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
183
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
184 NSAPI_PUBLIC struct tm *INTutil_localtime(const time_t *clock, struct tm *res);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
185
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
186 NSAPI_PUBLIC char *INTutil_ctime(const time_t *clock, char *buf, int buflen);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
187
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
188 NSAPI_PUBLIC char *INTutil_strerror(int errnum, char *msg, int buflen);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
189
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
190 NSAPI_PUBLIC struct tm *INTutil_gmtime(const time_t *clock, struct tm *res);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
191
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
192 NSAPI_PUBLIC char *INTutil_asctime(const struct tm *tm,char *buf, int buflen);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
193
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
194 NSAPI_PUBLIC char *INTutil_cookie_find(char *cookie, const char *name);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
195
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
196 NSAPI_PUBLIC char *INTutil_cookie_next(char *cookie, char **name, char **value);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
197
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
198 NSAPI_PUBLIC char *INTutil_cookie_next_av_pair(char *cookie, char **name, char **value);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
199
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
200 NSAPI_PUBLIC void INTutil_random(void *buf, size_t sz);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
201
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
202 NSAPI_PUBLIC PRBool INTutil_format_http_version(const char *v, int *protv_num, char *buffer, int size);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
203
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
204 NSAPI_PUBLIC int INTutil_getboolean(const char *v, int def);
256
19259b6c5cf7 replace old server config loader
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 148
diff changeset
205 int util_getboolean_s(scstr_t s, int def);
24
1a7853a4257e removed some NSPR dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 14
diff changeset
206
119
155cbab9eefd adds support for CGI with request bodies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 106
diff changeset
207 // new
282
cfb588e27198 add support for getstat parameter in pg readdir
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 278
diff changeset
208 NSAPI_PUBLIC int util_strtoint(const char *str, int64_t *value);
278
38bf7b42b58c implement pg_vfs_open
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 274
diff changeset
209 NSAPI_PUBLIC const char* util_resource_name(const char *url);
285
96e53bd94958 add support for O_CREAT flag in postgresql vfs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 282
diff changeset
210 NSAPI_PUBLIC char* util_parent_path(const char *path);
382
9e2289c77b04 disable pg large object IO functions for collections
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 338
diff changeset
211 NSAPI_PUBLIC char* util_parent_path_pool(pool_handle_t *pool, const char *path);
119
155cbab9eefd adds support for CGI with request bodies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 106
diff changeset
212
24
1a7853a4257e removed some NSPR dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 14
diff changeset
213 // TODO
1a7853a4257e removed some NSPR dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 14
diff changeset
214 //NSAPI_PUBLIC PRIntervalTime INTutil_getinterval(const char *v, PRIntervalTime def);
1
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
215
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
216 #ifdef NEED_STRCASECMP
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
217 NSAPI_PUBLIC int INTutil_strcasecmp(const char *one, const char *two);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
218 #endif /* NEED_STRCASECMP */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
219
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
220 #ifdef NEED_STRNCASECMP
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
221 NSAPI_PUBLIC int INTutil_strncasecmp(const char *one, const char *two, int n);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
222 #endif /* NEED_STRNCASECMP */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
223
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
224 NSAPI_PUBLIC char *INTutil_strcasestr(char *str, const char *substr);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
225
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
226 NSAPI_PUBLIC size_t util_strlcpy(char *dst, const char *src, size_t dstsize);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
227
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
228 NSAPI_PUBLIC size_t util_strlcat(char *dst, const char *src, size_t dstsize);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
229
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
230 NSAPI_PUBLIC char *INTutil_uuencode(const char *src, int len);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
231
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
232 NSAPI_PUBLIC char *INTutil_uudecode(const char *src);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
233
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
234 NSAPI_PUBLIC char *util_strlower(char *s);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
235
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
236 NSAPI_PUBLIC char *util_decrement_string(char *s);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
237
24
1a7853a4257e removed some NSPR dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 14
diff changeset
238 NSAPI_PUBLIC int64_t util_atoi64(const char *a);
1
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
239
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
240 NSAPI_PUBLIC int util_qtoi(const char *q, const char **p);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
241
58
66c22e54aa90 webdav uses the vfs api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 48
diff changeset
242 /* path utils */
66c22e54aa90 webdav uses the vfs api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 48
diff changeset
243 NSAPI_PUBLIC
66c22e54aa90 webdav uses the vfs api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 48
diff changeset
244 sstr_t util_path_append(pool_handle_t *pool, char *path, char *child);
63
66442f81f823 supports file system ACLs on Solaris
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 62
diff changeset
245 NSAPI_PUBLIC
66442f81f823 supports file system ACLs on Solaris
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 62
diff changeset
246 sstr_t util_path_remove_last(sstr_t path);
96
0185b13bf41f added document-root and pfx2dir nametrans safs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 91
diff changeset
247 NSAPI_PUBLIC
0185b13bf41f added document-root and pfx2dir nametrans safs
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 91
diff changeset
248 void util_add_ppath(sstr_t root, sstr_t path, pblock *vars);
58
66c22e54aa90 webdav uses the vfs api
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 48
diff changeset
249
99
b9a6af0ae41a ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 96
diff changeset
250 /* ucx utils */
b9a6af0ae41a ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 96
diff changeset
251 UcxAllocator util_pool_allocator(pool_handle_t *pool);
b9a6af0ae41a ucx update
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 96
diff changeset
252
104
a8acbb12f27c implemented range requests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 99
diff changeset
253 int util_isdate(char *str);
a8acbb12f27c implemented range requests
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 99
diff changeset
254
1
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
255 /* --- End common function prototypes --- */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
256
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
257 /* --- Begin Unix-only function prototypes --- */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
258
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
259 #ifdef XP_UNIX
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
260
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
261 NSAPI_PUBLIC int INTutil_can_exec(struct stat *finfo, uid_t uid, gid_t gid);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
262
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
263 NSAPI_PUBLIC
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
264 struct passwd *INTutil_getpwnam(const char *name, struct passwd *result,
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
265 char *buffer, int buflen);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
266
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
267 NSAPI_PUBLIC
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
268 struct passwd *INTutil_getpwuid(uid_t uid, struct passwd *result,
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
269 char *buffer, int buflen);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
270
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
271 NSAPI_PUBLIC pid_t INTutil_waitpid(pid_t pid, int *statptr, int options);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
272
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
273 #endif /* XP_UNIX */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
274
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
275 /* --- End Unix-only function prototypes --- */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
276
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
277 /* --- Begin Windows-only function prototypes --- */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
278
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
279 #ifdef XP_WIN32
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
280
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
281 NSAPI_PUBLIC
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
282 VOID INTutil_delete_directory(char *FileName, BOOL delete_directory);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
283
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
284 #endif /* XP_WIN32 */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
285
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
286 /* --- End Windows-only function prototypes --- */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
287
24
1a7853a4257e removed some NSPR dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 14
diff changeset
288 #ifdef __cplusplus
1a7853a4257e removed some NSPR dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 14
diff changeset
289 }
1a7853a4257e removed some NSPR dependencies
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 14
diff changeset
290 #endif
1
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
291
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
292 #ifdef __cplusplus
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
293
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
294 NSAPI_PUBLIC char *util_host_port_suffix(char *h);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
295
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
296 NSAPI_PUBLIC const char *util_host_port_suffix(const char *h);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
297
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
298 #endif
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
299
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
300 #define util_init_PRNetAddr INTutil_init_PRNetAddr
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
301 #define util_getline INTutil_getline
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
302 #define util_env_create INTutil_env_create
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
303 #define util_env_str INTutil_env_str
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
304 #define util_env_replace INTutil_env_replace
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
305 #define util_env_free INTutil_env_free
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
306 #define util_env_copy INTutil_env_copy
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
307 #define util_env_find INTutil_env_find
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
308 #define util_hostname INTutil_hostname
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
309 #define util_chdir2path INTutil_chdir2path
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
310 #define util_chdir INTutil_chdir
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
311 #define util_getcwd INTutil_getcwd
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
312 #define util_is_mozilla INTutil_is_mozilla
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
313 #define util_is_url INTutil_is_url
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
314 #define util_mstr2num INTutil_mstr2num
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
315 #define util_later_than INTutil_later_than
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
316 #define util_time_equal INTutil_time_equal
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
317 #define util_str_time_equal INTutil_str_time_equal
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
318 #define util_uri_is_evil INTutil_uri_is_evil
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
319 #define util_uri_is_evil_internal INTutil_uri_is_evil_internal
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
320 #define util_uri_parse INTutil_uri_parse
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
321 #ifdef XP_WIN32
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
322 #define util_uri_unescape_and_normalize INTutil_uri_unescape_and_normalize
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
323 #endif /* XP_WIN32 */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
324 #define util_uri_normalize_slashes INTutil_uri_normalize_slashes
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
325 #define util_uri_unescape INTutil_uri_unescape
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
326 #define util_uri_unescape_strict INTutil_uri_unescape_strict
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
327 #define util_uri_unescape_plus INTutil_uri_unescape_plus
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
328
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
329 #define util_uri_escape INTutil_uri_escape
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
330 #define util_uri_strip_params INTutil_uri_strip_params
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
331 #define util_url_escape INTutil_url_escape
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
332 #define util_sh_escape INTutil_sh_escape
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
333 #define util_mime_separator INTutil_mime_separator
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
334 #define util_itoa INTutil_itoa
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
335 #define util_i64toa INTutil_i64toa
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
336 #define util_vsprintf INTutil_vsprintf
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
337 #define util_sprintf INTutil_sprintf
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
338 #define util_vsnprintf INTutil_vsnprintf
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
339 #define util_snprintf INTutil_snprintf
338
c62ea2a2133b add util_asprintf and util_vasprintf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 285
diff changeset
340 #define util_vasprintf INTutil_vasprintf
c62ea2a2133b add util_asprintf and util_vasprintf
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 285
diff changeset
341 #define util_asprintf INTutil_asprintf
1
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
342 #define util_strftime INTutil_strftime
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
343 #define util_strcasecmp INTutil_strcasecmp
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
344 #define util_strncasecmp INTutil_strncasecmp
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
345 #define util_strcasestr INTutil_strcasestr
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
346 #define util_strtok INTutil_strtok
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
347 #define util_localtime INTutil_localtime
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
348 #define util_ctime INTutil_ctime
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
349 #define util_strerror INTutil_strerror
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
350 #define util_gmtime INTutil_gmtime
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
351 #define util_asctime INTutil_asctime
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
352 #define util_uuencode INTutil_uuencode
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
353 #define util_uudecode INTutil_uudecode
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
354
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
355 #ifdef XP_UNIX
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
356 #define util_can_exec INTutil_can_exec
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
357 #define util_getpwnam INTutil_getpwnam
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
358 #define util_getpwuid INTutil_getpwuid
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
359 #define util_waitpid INTutil_waitpid
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
360 #endif /* XP_UNIX */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
361
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
362 #ifdef XP_WIN32
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
363 #define util_delete_directory INTutil_delete_directory
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
364 #endif /* XP_WIN32 */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
365
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
366 #ifdef NEED_STRCASECMP
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
367 #define util_strcasecmp INTutil_strcasecmp
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
368 #define strcasecmp INTutil_strcasecmp
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
369 #endif /* NEED_STRCASECMP */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
370
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
371 #ifdef NEED_STRINGS_H /* usually for strcasecmp */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
372 #include <strings.h>
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
373 #endif
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
374
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
375 #ifdef NEED_STRNCASECMP
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
376 #define util_strncasecmp INTutil_strncasecmp
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
377 #define strncasecmp INTutil_strncasecmp
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
378 #endif /* NEED_STRNCASECMP */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
379
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
380 #define util_cookie_find INTutil_cookie_find
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
381 #define util_cookie_next INTutil_cookie_next
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
382 #define util_cookie_next_av_pair INTutil_cookie_next_av_pair
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
383
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
384 #define util_random INTutil_random
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
385 #define util_format_http_version INTutil_format_http_version
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
386 #define util_getboolean INTutil_getboolean
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
387 #define util_getinterval INTutil_getinterval
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
388
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
389 #ifdef XP_WIN32
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
390 void set_fullpathname(PRBool b);
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
391 #endif /* XP_WIN32 */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
392 #endif /* INTNSAPI */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
393
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
394 #endif /* !BASE_UTIL_H */
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
395
3c066d52342d added source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
396

mercurial