Imported Upstream version 2.4.3
[platform/upstream/audit.git] / auparse / nvlist.h
1 /*
2 * nvlist.h - Header file for nvlist.c
3 * Copyright (c) 2006-07 Red Hat Inc., Durham, North Carolina.
4 * All Rights Reserved.
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 *
20 * Authors:
21 *   Steve Grubb <sgrubb@redhat.com>
22 */
23
24 #ifndef NVLIST_HEADER
25 #define NVLIST_HEADER
26
27 #include "config.h"
28 #include "private.h"
29 #include <sys/types.h>
30 #include "rnode.h"
31 #include "ellist.h"
32
33
34 void nvlist_create(nvlist *l) hidden;
35 void nvlist_clear(nvlist* l) hidden;
36 static inline unsigned int nvlist_get_cnt(nvlist *l) { return l->cnt; }
37 static inline void nvlist_first(nvlist *l) { l->cur = l->head; }
38 static inline nvnode *nvlist_get_cur(const nvlist *l) { return l->cur; }
39 nvnode *nvlist_next(nvlist *l) hidden;
40 static inline const char *nvlist_get_cur_name(const nvlist *l) {if (l->cur) return l->cur->name; else return NULL;}
41 static inline const char *nvlist_get_cur_val(const nvlist *l) {if (l->cur) return l->cur->val; else return NULL;}
42 static inline const char *nvlist_get_cur_val_interp(const nvlist *l) {if (l->cur) return l->cur->interp_val; else return NULL;}
43 int nvlist_get_cur_type(const rnode *r) hidden;
44 const char *nvlist_interp_cur_val(const rnode *r) hidden;
45 void nvlist_append(nvlist *l, nvnode *node) hidden;
46
47 /* Given a numeric index, find that record. */
48 int nvlist_find_name(nvlist *l, const char *name) hidden;
49
50 #endif
51