comparison src/core/ngx_string.h @ 441:da8c5707af39

nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused files
author Igor Sysoev <igor@sysoev.ru>
date Tue, 28 Sep 2004 08:34:51 +0000
parents 8ac40cae79f0
children 42d11f017717
comparison
equal deleted inserted replaced
440:f390d1775430 441:da8c5707af39
1
2 /*
3 * Copyright (C) 2002-2004 Igor Sysoev
4 */
5
6
1 #ifndef _NGX_STRING_H_INCLUDED_ 7 #ifndef _NGX_STRING_H_INCLUDED_
2 #define _NGX_STRING_H_INCLUDED_ 8 #define _NGX_STRING_H_INCLUDED_
3 9
4 10
5 #include <ngx_config.h> 11 #include <ngx_config.h>
17 23
18 24
19 #if (WIN32) 25 #if (WIN32)
20 26
21 #define ngx_strncasecmp(s1, s2, n) \ 27 #define ngx_strncasecmp(s1, s2, n) \
22 strnicmp((const char *) s1, (const char *) s2, n) 28 strnicmp((const char *) s1, (const char *) s2, n)
23 #define ngx_strcasecmp(s1, s2) \ 29 #define ngx_strcasecmp(s1, s2) \
24 stricmp((const char *) s1, (const char *) s2) 30 stricmp((const char *) s1, (const char *) s2)
25 31
26 #define ngx_snprintf _snprintf 32 #define ngx_snprintf _snprintf
27 #define ngx_vsnprintf _vsnprintf 33 #define ngx_vsnprintf _vsnprintf
28 34
29 #else 35 #else
30 36
31 #define ngx_strncasecmp(s1, s2, n) \ 37 #define ngx_strncasecmp(s1, s2, n) \
32 strncasecmp((const char *) s1, (const char *) s2, n) 38 strncasecmp((const char *) s1, (const char *) s2, n)
33 #define ngx_strcasecmp(s1, s2) \ 39 #define ngx_strcasecmp(s1, s2) \
34 strcasecmp((const char *) s1, (const char *) s2) 40 strcasecmp((const char *) s1, (const char *) s2)
35 41
36 #define ngx_snprintf snprintf 42 #define ngx_snprintf snprintf
37 #define ngx_vsnprintf vsnprintf 43 #define ngx_vsnprintf vsnprintf
38 44
39 #endif 45 #endif
40 46
41 47
42 #define ngx_strncmp(s1, s2, n) \ 48 #define ngx_strncmp(s1, s2, n) \
43 strncmp((const char *) s1, (const char *) s2, n) 49 strncmp((const char *) s1, (const char *) s2, n)
44 50
45 /* msvc and icc compile strcmp() to inline loop */ 51 /* msvc and icc compile strcmp() to inline loop */
46 #define ngx_strcmp(s1, s2) strcmp((const char *) s1, (const char *) s2) 52 #define ngx_strcmp(s1, s2) strcmp((const char *) s1, (const char *) s2)
47 53
48 #define ngx_strstr(s1, s2) strstr((const char *) s1, (const char *) s2) 54 #define ngx_strstr(s1, s2) strstr((const char *) s1, (const char *) s2)
49 #define ngx_strlen(s) strlen((const char *) s) 55 #define ngx_strlen(s) strlen((const char *) s)
50 56
51 /* 57 /*
52 * msvc and icc compile memset() to inline "rep stos" 58 * msvc and icc compile memset() to the inline "rep stos"
53 * while ZeroMemory and bzero are calls. 59 * while ZeroMemory() and bzero() are the calls.
54 * 60 * icc may also inline several mov's of a zeroed register for small blocks.
55 * icc can also inline mov's of a zeroed register for small blocks.
56 */ 61 */
57 #define ngx_memzero(buf, n) memset(buf, 0, n) 62 #define ngx_memzero(buf, n) memset(buf, 0, n)
58 63
59 /* msvc and icc compile memcpy() to inline "rep movs" */ 64 /* msvc and icc compile memcpy() to the inline "rep movs" */
60 #define ngx_memcpy(dst, src, n) memcpy(dst, src, n) 65 #define ngx_memcpy(dst, src, n) memcpy(dst, src, n)
61 #define ngx_cpymem(dst, src, n) ((u_char *) memcpy(dst, src, n)) + n 66 #define ngx_cpymem(dst, src, n) ((u_char *) memcpy(dst, src, n)) + n
62 67
63 /* msvc and icc compile memcmp() to inline loop */ 68 /* msvc and icc compile memcmp() to the inline loop */
64 #define ngx_memcmp memcmp 69 #define ngx_memcmp memcmp
65 70
66 u_char *ngx_cpystrn(u_char *dst, u_char *src, size_t n); 71 u_char *ngx_cpystrn(u_char *dst, u_char *src, size_t n);
67 ngx_int_t ngx_rstrncmp(u_char *s1, u_char *s2, size_t n); 72 ngx_int_t ngx_rstrncmp(u_char *s1, u_char *s2, size_t n);
68 73