1 /* nv_pair_list.h - the itsy package management system
5 Copyright (C) 2001 University of Southern California
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License as
9 published by the Free Software Foundation; either version 2, or (at
10 your option) any later version.
12 This program is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
18 #ifndef NV_PAIR_LIST_H
19 #define NV_PAIR_LIST_H
22 #include "void_list.h"
24 typedef struct nv_pair_list_elt nv_pair_list_elt_t
;
25 struct nv_pair_list_elt
27 nv_pair_list_elt_t
*next
;
31 typedef struct nv_pair_list nv_pair_list_t
;
34 nv_pair_list_elt_t pre_head
;
35 nv_pair_list_elt_t
*head
;
36 nv_pair_list_elt_t
*tail
;
39 static inline int nv_pair_list_empty(nv_pair_list_t
*list
)
41 if (list
->head
== NULL
)
47 int nv_pair_list_elt_init(nv_pair_list_elt_t
*elt
, nv_pair_t
*data
);
48 void nv_pair_list_elt_deinit(nv_pair_list_elt_t
*elt
);
50 int nv_pair_list_init(nv_pair_list_t
*list
);
51 void nv_pair_list_deinit(nv_pair_list_t
*list
);
53 nv_pair_t
*nv_pair_list_append(nv_pair_list_t
*list
,
54 const char *name
, const char *value
);
55 int nv_pair_list_push(nv_pair_list_t
*list
, nv_pair_t
*data
);
56 nv_pair_list_elt_t
*nv_pair_list_pop(nv_pair_list_t
*list
);
57 char *nv_pair_list_find(nv_pair_list_t
*list
, char *name
);