| 56 | /* tok822_alloc - allocate and initialize token */ |
| 57 | |
| 58 | TOK822 *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 |
no test coverage detected
searching dependent graphs…