2002-08-07 00:39:45 +08:00
|
|
|
#ifndef _NGX_STRING_H_INCLUDED_
|
|
|
|
#define _NGX_STRING_H_INCLUDED_
|
|
|
|
|
|
|
|
|
|
|
|
#include <ngx_config.h>
|
|
|
|
|
|
|
|
|
2002-12-03 00:09:40 +08:00
|
|
|
typedef struct {
|
2002-12-15 14:25:09 +08:00
|
|
|
size_t len;
|
|
|
|
char *data;
|
2002-12-03 00:09:40 +08:00
|
|
|
} ngx_str_t;
|
|
|
|
|
2002-08-07 00:39:45 +08:00
|
|
|
|
2002-12-26 15:24:21 +08:00
|
|
|
#define ngx_string(str) { sizeof(str) - 1, str }
|
2003-03-12 04:38:13 +08:00
|
|
|
#define ngx_null_string { 0, NULL }
|
2002-12-26 15:24:21 +08:00
|
|
|
|
|
|
|
|
|
|
|
#if (WIN32)
|
2002-12-15 14:25:09 +08:00
|
|
|
|
|
|
|
#define ngx_memzero ZeroMemory
|
|
|
|
|
2003-01-28 23:56:37 +08:00
|
|
|
#define ngx_strncasecmp strnicmp
|
2003-01-09 13:36:00 +08:00
|
|
|
#define ngx_strcasecmp stricmp
|
|
|
|
#define ngx_strncmp strncmp
|
2002-12-27 00:26:23 +08:00
|
|
|
#define ngx_strcmp strcmp
|
2002-12-15 14:25:09 +08:00
|
|
|
|
2003-01-15 15:02:27 +08:00
|
|
|
#define ngx_strlen strlen
|
|
|
|
|
2002-08-07 00:39:45 +08:00
|
|
|
#define ngx_snprintf _snprintf
|
|
|
|
#define ngx_vsnprintf _vsnprintf
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
2002-12-15 14:25:09 +08:00
|
|
|
#define ngx_memzero bzero
|
|
|
|
|
2003-01-28 23:56:37 +08:00
|
|
|
#define ngx_strncasecmp strncasecmp
|
2003-01-10 14:09:20 +08:00
|
|
|
#define ngx_strcasecmp strcasecmp
|
2003-01-09 13:36:00 +08:00
|
|
|
#define ngx_strncmp strncmp
|
2002-12-27 00:26:23 +08:00
|
|
|
#define ngx_strcmp strcmp
|
|
|
|
|
2003-01-15 15:02:27 +08:00
|
|
|
#define ngx_strlen strlen
|
|
|
|
|
2002-08-07 00:39:45 +08:00
|
|
|
#define ngx_snprintf snprintf
|
|
|
|
#define ngx_vsnprintf vsnprintf
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define ngx_memcpy(dst, src, n) memcpy(dst, src, n)
|
|
|
|
#define ngx_cpymem(dst, src, n) memcpy(dst, src, n) + n
|
|
|
|
|
|
|
|
char *ngx_cpystrn(char *dst, char *src, size_t n);
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* _NGX_STRING_H_INCLUDED_ */
|