2 * ausearch-int.h - Header file for ausearch-int.c
3 * Copyright (c) 2005,2008 Red Hat Inc., Durham, North Carolina.
6 * This software may be freely redistributed and/or modified under the
7 * terms of the GNU General Public License as published by the Free
8 * Software Foundation; either version 2, or (at your option) any
11 * This program 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
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; see the file COPYING. If not, write to the
18 * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * Steve Grubb <sgrubb@redhat.com>
29 /* This is the node of the linked list. Number & item are the only elements
30 * at this time. Any data elements that are per item goes here. */
31 typedef struct _int_node{
32 int num; // The number
33 unsigned int hits; // The number of times this was attempted to be added
34 int aux1; // Extra spot for data
35 struct _int_node* next; // Next string node pointer
38 /* This is the linked list head. Only data elements that are 1 per
41 int_node *head; // List head
42 int_node *cur; // Pointer to current node
43 unsigned int cnt; // How many items in this list
46 void ilist_create(ilist *l);
47 static inline void ilist_first(ilist *l) { l->cur = l->head; }
48 int_node *ilist_next(ilist *l);
49 static inline int_node *ilist_get_cur(ilist *l) { return l->cur; }
50 void ilist_append(ilist *l, int num, unsigned int hits, int aux);
51 void ilist_clear(ilist* l);
53 /* append a number if its not already on the list */
54 int ilist_add_if_uniq(ilist *l, int num, int aux);
55 void ilist_sort_by_hits(ilist *l);