[core] macros CONST_LEN_STR and CONST_STR_LEN

personal/stbuehler/ci-build
Glenn Strauss 2019-10-20 18:57:18 -04:00
parent e06ac39c81
commit be04c1239f
3 changed files with 2 additions and 4 deletions

View File

@ -214,7 +214,8 @@ void buffer_append_path_len(buffer *b, const char *a, size_t alen); /* join stri
#define BUFFER_INTLEN_PTR(x) (x)->used ? (int)((x)->used - 1) : 0, (x)->ptr
#define CONST_STR_LEN(x) x, (x) ? sizeof(x) - 1 : 0
#define CONST_LEN_STR(x) (uint32_t)sizeof(x)-1, x
#define CONST_STR_LEN(x) x, (uint32_t)sizeof(x) - 1
#define CONST_BUF_LEN(x) ((x) ? (x)->ptr : NULL), buffer_string_length(x)

View File

@ -19,7 +19,6 @@ typedef struct keyvlenvalue {
int8_t http_headers_off[] = {
-1, -1, -1, -1, 0, 4, 5, 9, 10, 11, 12, -1, 15, 16, 20, 21, 23, 25
};
#define CONST_LEN_STR(x) (unsigned int)(sizeof(x)-1), x
static const keyvlenvalue http_headers[] = {
{ HTTP_HEADER_HOST, CONST_LEN_STR("Host") }
,{ HTTP_HEADER_DATE, CONST_LEN_STR("Date") }

View File

@ -5,8 +5,6 @@
#include <string.h>
#define CONST_LEN_STR(x) (unsigned int)sizeof(x)-1, (x)
typedef struct {
int key;
unsigned int vlen;