FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
list.h
1 /***************************************************************
2  Copyright (C) 2006-2009 Hewlett-Packard Development Company, L.P.
3 
4  This program is free software; you can redistribute it and/or
5  modify it under the terms of the GNU General Public License
6  version 2 as published by the Free Software Foundation.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License along
14  with this program; if not, write to the Free Software Foundation, Inc.,
15  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 
17  ***************************************************************/
18 #ifndef _LIST_H
19 #define _LIST_H
20 #include "nomos.h"
21 void listInit(list_t *l, int size, char *label);
22 void listClear(list_t *l, int deallocFlag);
23 item_t *listGetItem(list_t *l, char *s);
24 item_t *listAppend(list_t *l, char *s);
25 
26 #ifdef notdef
27 item_t *listLookupName(list_t *l, char *s);
28 item_t *listLookupAlias(list_t *l, char *s);
29 #endif /* notdef */
30 
32 void listIterationReset(list_t *l);
33 int listDelete(list_t *l, item_t *p);
34 void listSort(list_t *l, int sortType);
35 int listCount(list_t *l);
36 void listDump(list_t *l, int verbose);
37 
38 #define DEALLOC_LIST 1
39 #define NOTOUCH_LIST 0
40 
41 #endif /* _LIST_H */
tricky data structure used for a list of 'items'
Definition: nomos.h:287
item_t * listAppend(list_t *l, char *s)
Utility list that isn't sorted - faster for unpacking archives and maintaining lists of files (we onl...
Definition: list.c:327
int s
The socket that the CLI will use to communicate.
Definition: fo_cli.c:48
void listInit(list_t *l, int size, char *label)
intialize a list, if the list is not empty, empty it (initialize it to zero's).
Definition: list.c:67
item_t * listGetItem(list_t *l, char *s)
get an item from the itemlist. If the item is not in the itemlist, then add it to the itemlist...
Definition: list.c:259
int listDelete(list_t *l, item_t *p)
Delete an item from list.
Definition: list.c:550
int verbose
The verbose flag for the cli.
Definition: fo_cli.c:49
void listIterationReset(list_t *l)
Rest list ix to -1.
Definition: list.c:526
void listSort(list_t *l, int sortType)
Sort the list as per the sortType passed.
Definition: list.c:644
list_t type structure used to keep various lists. (e.g. there are multiple lists).
Definition: nomos.h:321
Nomos header file.
int listCount(list_t *l)
Definition: list.c:813
void listDump(list_t *l, int verbose)
print the passed in list
Definition: list.c:842
void listClear(list_t *l, int deallocFlag)
Destroy list_t.
Definition: list.c:119
item_t * listIterate(list_t *l)
return a pointer to listitem, returns a NULL_ITEM when no more items to return.
Definition: list.c:490