Encapsulate token API.

This commit is contained in:
Jan Vidar Krey
2010-07-18 19:43:11 +02:00
parent 56e5557146
commit d41d649353
3 changed files with 52 additions and 39 deletions

View File

@@ -20,14 +20,18 @@
#ifndef HAVE_UHUB_CONFIG_TOKEN_H
#define HAVE_UHUB_CONFIG_TOKEN_H
struct linked_list;
struct cfg_tokens;
struct linked_list* cfg_tokenize(const char* line);
void cfg_tokens_free(struct linked_list*);
struct cfg_tokens* cfg_tokenize(const char* line);
void cfg_tokens_free(struct cfg_tokens*);
size_t cfg_token_count(const char* line);
char* cfg_token_get(const char* line, size_t token);
char* cfg_token_add(const char* line, char* new_token);
int cfg_token_add(struct cfg_tokens*, char* new_token);
size_t cfg_token_count(struct cfg_tokens*);
char* cfg_token_get(struct cfg_tokens*, size_t offset);
char* cfg_token_get_first(struct cfg_tokens*);
char* cfg_token_get_next(struct cfg_tokens*);
#endif /* HAVE_UHUB_CONFIG_TOKEN_H */