MCPcopy Create free account
hub / github.com/acl-dev/acl / header_split

Function header_split

lib_acl_cpp/src/mime/internal/header_opts.cpp:197–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195}
196
197HEADER_NV *header_split(const char *s)
198{
199 HEADER_NV *header;
200
201#define SKIP_SPACE(x) { \
202 while (*(x) == ' ' || *(x) == '\t') \
203 (x)++; \
204}
205 SKIP_SPACE(s);
206 if (*s == 0)
207 return (NULL);
208
209 header = (HEADER_NV*) acl_mycalloc(1, sizeof(HEADER_NV));
210 header->name = acl_mystrdup(s);
211 char *ptr = strchr(header->name, ':');
212 if (ptr == NULL) {
213 header_nv_free(header);
214 return (NULL);
215 }
216 *ptr++ = 0;
217 SKIP_SPACE(ptr);
218 if (*ptr == 0) {
219 header_nv_free(header);
220 return (NULL);
221 }
222 header->value = ptr;
223 return (header);
224}
225
226void header_nv_free(HEADER_NV *header)
227{

Callers 1

mime_header_lineFunction · 0.85

Calls 1

header_nv_freeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…