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

Function tok822_alloc

lib_acl_cpp/src/mime/internal/tok822_node.cpp:58–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56/* tok822_alloc - allocate and initialize token */
57
58TOK822 *tok822_alloc(int type, const char *strval)
59{
60 TOK822 *tp;
61
62#define CONTAINER_TOKEN(x) \
63 ((x) == TOK822_ADDR || (x) == TOK822_STARTGRP)
64
65 tp = (TOK822 *) acl_mymalloc(sizeof(*tp));
66 tp->type = type;
67 tp->next = tp->prev = tp->head = tp->tail = tp->owner = 0;
68 tp->vstr = (type < TOK822_MINTOK || CONTAINER_TOKEN(type) ? 0 :
69 strval == 0 ? acl_vstring_alloc(10) :
70 acl_vstring_strcpy(acl_vstring_alloc(strlen(strval) + 1), strval));
71 return (tp);
72}
73
74/* tok822_free - destroy token */
75

Callers 4

tok822_scan_limitFunction · 0.85
tok822_parse_limitFunction · 0.85
tok822_groupFunction · 0.85
tok822_scan_addrFunction · 0.85

Calls 2

acl_vstring_allocFunction · 0.85
acl_vstring_strcpyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…