File: comment.h

package info (click to toggle)
cmus 2.2.0-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,196 kB
  • ctags: 2,714
  • sloc: ansic: 24,078; sh: 1,024; makefile: 209; python: 26
file content (30 lines) | stat: -rw-r--r-- 878 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef _COMMENT_H
#define _COMMENT_H

struct keyval {
	char *key;
	char *val;
};

struct growing_keyvals {
	struct keyval *comments;
	int alloc;
	int count;
};

#define GROWING_KEYVALS(name) struct growing_keyvals name = { NULL, 0, 0 }

struct keyval *comments_dup(const struct keyval *comments);
void comments_free(struct keyval *comments);

/* case insensitive key */
const char *comments_get_val(const struct keyval *comments, const char *key);
const char *comments_get_albumartist(const struct keyval *comments);
int comments_get_int(const struct keyval *comments, const char *key);
int comments_get_date(const struct keyval *comments, const char *key);

int comments_add(struct growing_keyvals *c, const char *key, char *val);
int comments_add_const(struct growing_keyvals *c, const char *key, const char *val);
void comments_terminate(struct growing_keyvals *c);

#endif