Lines Matching defs:tag
3 * tag.c - allocation/initialization/free routines for tag structs
22 blkid_tag tag;
24 if (!(tag = (blkid_tag) calloc(1, sizeof(struct blkid_struct_tag))))
27 INIT_LIST_HEAD(&tag->bit_tags);
28 INIT_LIST_HEAD(&tag->bit_names);
30 return tag;
34 void blkid_debug_dump_tag(blkid_tag tag)
36 if (!tag) {
37 printf(" tag: NULL\n");
41 printf(" tag: %s=\"%s\"\n", tag->bit_name, tag->bit_val);
45 void blkid_free_tag(blkid_tag tag)
47 if (!tag)
50 DBG(DEBUG_TAG, printf(" freeing tag %s=%s\n", tag->bit_name,
51 tag->bit_val ? tag->bit_val : "(NULL)"));
52 DBG(DEBUG_TAG, blkid_debug_dump_tag(tag));
54 list_del(&tag->bit_tags); /* list of tags for this device */
55 list_del(&tag->bit_names); /* list of tags with this type */
57 free(tag->bit_name);
58 free(tag->bit_val);
59 free(tag);
63 * Find the desired tag on a device. If value is NULL, then the
64 * first such tag is returned, otherwise return only exact tag if found.
84 * Find the desired tag type in the cache.
85 * We return the head tag for this tag type.
99 printf(" found cache tag head %s\n", type));
108 * Set a tag on an existing device.
135 /* Existing tag not present, add to device */
153 printf(" creating new cache tag head %s\n", name));
199 DBG(DEBUG_TAG, printf("trying to parse '%s' as a tag\n", token));
269 blkid_tag tag;
276 tag = list_entry(iter->p, struct blkid_struct_tag, bit_tags);
277 *type = tag->bit_name;
278 *value = tag->bit_val;