Add trimwhitespace(), keyval sorting and alloc to misc functions

- features required by the LastFM module
This commit is contained in:
ejurgensen
2014-08-15 22:56:39 +02:00
parent d5efc2dcb3
commit 21cf3ab7d3
2 changed files with 119 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ struct onekeyval {
char *value;
struct onekeyval *next;
struct onekeyval *sort;
};
struct keyval {
@@ -40,6 +41,9 @@ safe_hextou64(const char *str, uint64_t *val);
/* Key/value functions */
struct keyval *
keyval_alloc(void);
int
keyval_add(struct keyval *kv, const char *name, const char *value);
@@ -55,6 +59,9 @@ keyval_get(struct keyval *kv, const char *name);
void
keyval_clear(struct keyval *kv);
void
keyval_sort(struct keyval *kv);
char *
m_realpath(const char *pathname);
@@ -62,6 +69,9 @@ m_realpath(const char *pathname);
char *
unicode_fixup_string(char *str);
char *
trimwhitespace(const char *str);
uint32_t
djb_hash(void *data, size_t len);