Lines Matching refs:datum
62 void cil_symtab_datum_init(struct cil_symtab_datum *datum)
64 datum->name = NULL;
65 datum->fqn = NULL;
66 datum->symtab = NULL;
67 cil_list_init(&datum->nodes, CIL_LIST_ITEM);
70 void cil_symtab_datum_destroy(struct cil_symtab_datum *datum)
72 cil_list_destroy(&datum->nodes, 0);
73 cil_symtab_remove_datum(datum);
76 void cil_symtab_datum_remove_node(struct cil_symtab_datum *datum, struct cil_tree_node *node)
78 if (datum && datum->nodes != NULL) {
79 cil_list_remove(datum->nodes, CIL_NODE, node, 0);
80 if (datum->nodes->head == NULL) {
81 cil_symtab_datum_destroy(datum);
86 /* This both initializes the datum and inserts it into the symtab.
88 int cil_symtab_insert(symtab_t *symtab, hashtab_key_t key, struct cil_symtab_datum *datum, struct cil_tree_node *node)
90 int rc = hashtab_insert(symtab->table, key, (hashtab_datum_t)datum);
92 datum->name = key;
93 datum->fqn = key;
94 datum->symtab = symtab;
95 cil_list_append(datum->nodes, CIL_NODE, node);
97 cil_list_append(datum->nodes, CIL_NODE, node);
99 cil_symtab_error("Failed to insert datum into hashtab\n");
105 void cil_symtab_remove_datum(struct cil_symtab_datum *datum)
107 symtab_t *symtab = datum->symtab;
113 hashtab_remove(symtab->table, datum->name, NULL, NULL);
114 datum->symtab = NULL;
117 int cil_symtab_get_datum(symtab_t *symtab, char *key, struct cil_symtab_datum **datum)
119 *datum = (struct cil_symtab_datum*)hashtab_search(symtab->table, (hashtab_key_t)key);
120 if (*datum == NULL) {
136 struct cil_symtab_datum *datum = d;
137 datum->symtab = NULL;
167 struct cil_complex_symtab_datum *datum)
178 node->datum = datum;
236 *out = curr->datum;