aboutsummaryrefslogtreecommitdiff
path: root/src/cookie.h
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2019-11-27 21:33:06 +0300
committerAleksey Veresov <aleksey@veresov.pro>2019-11-27 21:33:06 +0300
commitea25abb295d9b4fbaf0ac23af8ffe71247970f1b (patch)
tree67cba7b2e5f2c759eaa816de51bd35f3b32d1421 /src/cookie.h
parent88081d9a4376b1ee4feed3bc843c46096e087b1e (diff)
downloadmagi-ea25abb295d9b4fbaf0ac23af8ffe71247970f1b.tar
magi-ea25abb295d9b4fbaf0ac23af8ffe71247970f1b.tar.xz
magi-ea25abb295d9b4fbaf0ac23af8ffe71247970f1b.zip
.
Diffstat (limited to 'src/cookie.h')
-rw-r--r--src/cookie.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/cookie.h b/src/cookie.h
index 479ab9f..82c914e 100644
--- a/src/cookie.h
+++ b/src/cookie.h
@@ -2,10 +2,8 @@
#define MAGI_INCLUDED_COOKIE
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Cookie
- */
struct magi_cookie {
+ /* All pointers must be valid as 'free' arguments. */
char * name;
char * data;
char * path;
@@ -14,21 +12,21 @@ struct magi_cookie {
};
struct magi_cookie_list {
- struct magi_cookie_list * next;
+ struct magi_cookie_list * next; /* Must be valid as 'free' arguments. */
struct magi_cookie item;
};
-/* Returns null only in case of error. */
+/* Addition of item to top of list. Null <=> error. */
int magi_cookie_list_add(struct magi_cookie_list ** list,
struct magi_cookie * item);
-/* Searchs for first node in list: node.name == name, name is C-string;
- * Returns node.data if succeed, otherwise result is null. */
-char * magi_cookie_list_get(struct magi_cookie_list * list, const char * name);
+/* First node in list: node.name == name; else null. */
+struct magi_cookie * magi_cookie_list_get(struct magi_cookie_list * list,
+ const char * name);
-/* Destroys list. */
-void magi_cookie_list_free(struct magi_cookie_list * list);
+/* Freeing and invalidation of list. */
+void magi_cookie_list_destroy(struct magi_cookie_list * list);
#endif