2 * ausearch-llist.c - Minimal linked list library
3 * Copyright (c) 2005 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>
26 #include "auditctl-llist.h"
28 void list_create(llist *l)
35 void list_first(llist *l)
40 void list_last(llist *l)
42 register lnode* window;
49 window = window->next;
53 lnode *list_next(llist *l)
57 l->cur = l->cur->next;
61 void list_append(llist *l, struct audit_rule_data *r, size_t sz)
65 newnode = malloc(sizeof(lnode));
68 void *rr = malloc(sz);
78 // if we are at top, fix this up
81 else // Otherwise add pointer to newnode
82 l->cur->next = newnode;
84 // make newnode current
89 void list_clear(llist* l)
92 register lnode* current;
96 nextnode=current->next;