Code to handle the apt-alike configuration entries
[oweals/opkg-lede.git] / libopkg / cksum_list.h
1 /* cksum_list.h - the opkg package management system
2
3    Copyright (C) 2010,2011 Javier Palacios
4
5    This program is free software; you can redistribute it and/or
6    modify it under the terms of the GNU General Public License as
7    published by the Free Software Foundation; either version 2, or (at
8    your option) any later version.
9
10    This program is distributed in the hope that it will be useful, but
11    WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    General Public License for more details.
14 */
15
16 #ifndef CKSUM_LIST_H
17 #define CKSUM_LIST_H
18
19 typedef struct 
20 {
21   char *name;
22   char *value;
23   int size;
24 } cksum_t;
25
26 int cksum_init(cksum_t *cksum, char **itemlist);
27 void cksum_deinit(cksum_t *cksum);
28
29 #include "void_list.h"
30
31 typedef struct void_list_elt cksum_list_elt_t;
32
33 typedef struct void_list cksum_list_t;
34
35 static inline int cksum_list_empty(cksum_list_t *list)
36 {
37     return void_list_empty ((void_list_t *)list);
38 }
39
40 void cksum_list_init(cksum_list_t *list);
41 void cksum_list_deinit(cksum_list_t *list);
42
43 cksum_t *cksum_list_append(cksum_list_t *list, char **itemlist);
44 const cksum_t *cksum_list_find(cksum_list_t *list, const char *name);
45
46 #endif