diff options
author | Aleksey Veresov <aleksey@veresov.pro> | 2019-11-27 21:33:06 +0300 |
---|---|---|
committer | Aleksey Veresov <aleksey@veresov.pro> | 2019-11-27 21:33:06 +0300 |
commit | ea25abb295d9b4fbaf0ac23af8ffe71247970f1b (patch) | |
tree | 67cba7b2e5f2c759eaa816de51bd35f3b32d1421 /src/param.h | |
parent | 88081d9a4376b1ee4feed3bc843c46096e087b1e (diff) | |
download | magi-ea25abb295d9b4fbaf0ac23af8ffe71247970f1b.tar magi-ea25abb295d9b4fbaf0ac23af8ffe71247970f1b.tar.xz magi-ea25abb295d9b4fbaf0ac23af8ffe71247970f1b.zip |
.
Diffstat (limited to 'src/param.h')
-rw-r--r-- | src/param.h | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/param.h b/src/param.h index 6fd0ba0..3f8cefe 100644 --- a/src/param.h +++ b/src/param.h @@ -2,31 +2,26 @@ #define MAGI_INCLUDED_PARAM -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Parameter - */ struct magi_param { + /* All pointers must be valid as 'free' arguments. */ char * name; char * data; }; struct magi_param_list { - struct magi_param_list * next; + struct magi_param_list * next; /* Must be valid as 'free' argument. */ struct magi_param item; }; -/* Adds *item to the begining of *list, item and list are dereferencable; - * Returns null in case of error. */ +/* Addition of item to top of list. Null <=> error. */ int magi_param_list_add(struct magi_param_list ** list, struct magi_param * item); -/* Searchs for first node in list: node.name == name, name is C-string; - * Returns node itself if succeed, otherwise result is null. */ -struct magi_param * magi_param_list_get(struct magi_param_list * list, - const char * name); +/* Data of the first node in list: node.name == name; else null. */ +char * magi_param_list_get(struct magi_param_list * list, const char * name); -/* Destroys list; list is not valid after destruction. */ +/* Freeing and invalidation of list. */ void magi_param_list_destroy(struct magi_param_list * list); |