Deleted
Added
nxt_string.h (354:8fc82db3530b) | nxt_string.h (703:2d536dde84d2) |
---|---|
1 2/* 3 * Copyright (C) Igor Sysoev 4 * Copyright (C) NGINX, Inc. 5 */ 6 7#ifndef _NXT_STRING_H_INCLUDED_ 8#define _NXT_STRING_H_INCLUDED_ --- 10 unchanged lines hidden (view full) --- 19#define \ 20nxt_isdigit(c) \ 21 ((u_char) ((c) - '0') <= 9) 22 23 24#define NXT_CR (u_char) 13 25#define NXT_LF (u_char) 10 26#define NXT_CRLF "\x0d\x0a" | 1 2/* 3 * Copyright (C) Igor Sysoev 4 * Copyright (C) NGINX, Inc. 5 */ 6 7#ifndef _NXT_STRING_H_INCLUDED_ 8#define _NXT_STRING_H_INCLUDED_ --- 10 unchanged lines hidden (view full) --- 19#define \ 20nxt_isdigit(c) \ 21 ((u_char) ((c) - '0') <= 9) 22 23 24#define NXT_CR (u_char) 13 25#define NXT_LF (u_char) 10 26#define NXT_CRLF "\x0d\x0a" |
27#define NXT_CRLF_SIZE (sizeof(NXT_CRLF) - 1) | 27#define NXT_CRLF_SIZE nxt_length(NXT_CRLF) |
28 29 30#define NXT_LINEFEED_SIZE 1 31 32#define \ 33nxt_linefeed(p) \ 34 *p++ = NXT_LF 35 --- 75 unchanged lines hidden (view full) --- 111 112 113typedef struct { 114 size_t length; 115 u_char *start; 116} nxt_str_t; 117 118 | 28 29 30#define NXT_LINEFEED_SIZE 1 31 32#define \ 33nxt_linefeed(p) \ 34 *p++ = NXT_LF 35 --- 75 unchanged lines hidden (view full) --- 111 112 113typedef struct { 114 size_t length; 115 u_char *start; 116} nxt_str_t; 117 118 |
119#define nxt_string(str) { sizeof(str) - 1, (u_char *) str } | 119#define nxt_string(str) { nxt_length(str), (u_char *) str } |
120#define nxt_string_zero(str) { sizeof(str), (u_char *) str } 121#define nxt_null_string { 0, NULL } 122 123 124#define \ 125nxt_str_set(str, text) \ 126 do { \ | 120#define nxt_string_zero(str) { sizeof(str), (u_char *) str } 121#define nxt_null_string { 0, NULL } 122 123 124#define \ 125nxt_str_set(str, text) \ 126 do { \ |
127 (str)->length = sizeof(text) - 1; \ | 127 (str)->length = nxt_length(text); \ |
128 (str)->start = (u_char *) text; \ 129 } while (0) 130 131 132#define \ 133nxt_str_null(str) \ 134 do { \ 135 (str)->length = 0; \ --- 48 unchanged lines hidden --- | 128 (str)->start = (u_char *) text; \ 129 } while (0) 130 131 132#define \ 133nxt_str_null(str) \ 134 do { \ 135 (str)->length = 0; \ --- 48 unchanged lines hidden --- |