#ifndef COMMENT_H #define COMMENT_H #include "list.h" struct comment { struct list_head node; /* ASCII */ char *key; /* UTF8 */ char *utf8_val; /* current locale's charset */ char *val; }; void comments_free(struct list_head *comment_head); void comments_remove(struct list_head *comment_head, const struct list_head *delete_head); void comments_uniq(struct list_head *comment_head); struct comment *comment_get(const struct list_head *comment_head, const char *name); /* val is in the current locale's charset format */ void comment_add(struct list_head *comment_head, const char *key, const char *val); /* val is UTF-8 */ void comment_add_utf8(struct list_head *comment_head, const char *key, const char *utf8_val); /* v is in v_charset format */ void comment_add_any(struct list_head *comment_head, const char *key, const char *v, const char *v_charset); void comments_print(const struct list_head *comment_head); #endif