Mercurial > hg > nginx
comparison src/core/ngx_string.h @ 290:87e73f067470
nginx-0.0.2-2004-03-16-10:10:12 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 16 Mar 2004 07:10:12 +0000 |
parents | f81d075ad172 |
children | a472bfb778b3 |
comparison
equal
deleted
inserted
replaced
289:0750faf8d7e3 | 290:87e73f067470 |
---|---|
5 #include <ngx_config.h> | 5 #include <ngx_config.h> |
6 #include <ngx_core.h> | 6 #include <ngx_core.h> |
7 | 7 |
8 | 8 |
9 typedef struct { | 9 typedef struct { |
10 size_t len; | 10 size_t len; |
11 char *data; | 11 u_char *data; |
12 } ngx_str_t; | 12 } ngx_str_t; |
13 | 13 |
14 | 14 |
15 #define ngx_string(str) { sizeof(str) - 1, str } | 15 #define ngx_string(str) { sizeof(str) - 1, (u_char *) str } |
16 #define ngx_null_string { 0, NULL } | 16 #define ngx_null_string { 0, NULL } |
17 | 17 |
18 | 18 |
19 #if (WIN32) | 19 #if (WIN32) |
20 | 20 |
24 #define ngx_snprintf _snprintf | 24 #define ngx_snprintf _snprintf |
25 #define ngx_vsnprintf _vsnprintf | 25 #define ngx_vsnprintf _vsnprintf |
26 | 26 |
27 #else | 27 #else |
28 | 28 |
29 #define ngx_strncasecmp strncasecmp | 29 #define ngx_strncasecmp(s1, s2, n) \ |
30 #define ngx_strcasecmp strcasecmp | 30 strncasecmp((const char *) s1, (const char *) s2, n) |
31 #define ngx_strcasecmp(s1, s2) \ | |
32 strcasecmp((const char *) s1, (const char *) s2) | |
31 | 33 |
32 #define ngx_snprintf snprintf | 34 #define ngx_snprintf snprintf |
33 #define ngx_vsnprintf vsnprintf | 35 #define ngx_vsnprintf vsnprintf |
34 | 36 |
35 #endif | 37 #endif |
36 | 38 |
37 | 39 |
38 #define ngx_strncmp strncmp | 40 #define ngx_strncmp(s1, s2, n) \ |
41 strncmp((const char *) s1, (const char *) s2, n) | |
39 | 42 |
40 /* msvc and icc compile strcmp() to inline loop */ | 43 /* msvc and icc compile strcmp() to inline loop */ |
41 #define ngx_strcmp strcmp | 44 #define ngx_strcmp(s1, s2) strcmp((const char *) s1, (const char *) s2) |
42 | 45 |
43 #define ngx_strstr strstr | 46 #define ngx_strstr(s1, s2) strstr((const char *) s1, (const char *) s2) |
44 #define ngx_strlen strlen | 47 #define ngx_strlen(s) strlen((const char *) s) |
45 | 48 |
46 /* | 49 /* |
47 * msvc and icc compile memset() to inline "rep stos" | 50 * msvc and icc compile memset() to inline "rep stos" |
48 * while ZeroMemory and bzero are calls. | 51 * while ZeroMemory and bzero are calls. |
49 * | 52 * |
51 */ | 54 */ |
52 #define ngx_memzero(buf, n) memset(buf, 0, n) | 55 #define ngx_memzero(buf, n) memset(buf, 0, n) |
53 | 56 |
54 /* msvc and icc compile memcpy() to inline "rep movs" */ | 57 /* msvc and icc compile memcpy() to inline "rep movs" */ |
55 #define ngx_memcpy(dst, src, n) memcpy(dst, src, n) | 58 #define ngx_memcpy(dst, src, n) memcpy(dst, src, n) |
56 #define ngx_cpymem(dst, src, n) ((char *) memcpy(dst, src, n)) + n | 59 #define ngx_cpymem(dst, src, n) ((u_char *) memcpy(dst, src, n)) + n |
57 | 60 |
58 /* msvc and icc compile memcmp() to inline loop */ | 61 /* msvc and icc compile memcmp() to inline loop */ |
59 #define ngx_memcmp memcmp | 62 #define ngx_memcmp memcmp |
60 | 63 |
61 char *ngx_cpystrn(char *dst, char *src, size_t n); | 64 u_char *ngx_cpystrn(u_char *dst, u_char *src, size_t n); |
62 int ngx_rstrncmp(char *s1, char *s2, size_t n); | 65 ngx_int_t ngx_rstrncmp(u_char *s1, u_char *s2, size_t n); |
63 int ngx_atoi(char *line, size_t n); | 66 ngx_int_t ngx_atoi(u_char *line, size_t n); |
64 | 67 |
65 void ngx_md5_text(char *text, u_char *md5); | 68 void ngx_md5_text(u_char *text, u_char *md5); |
66 | 69 |
67 | 70 |
68 #define ngx_qsort qsort | 71 #define ngx_qsort qsort |
69 | 72 |
70 | 73 |