1 /*+++++++++++++++++
2   linklist.h - header file for linklist.c
3   markus@mhoenicka.de 7-11-00
4   $Id: linklist.h,v 1.7.2.1 2004/09/26 21:07:05 mhoenicka Exp $
5 
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 2 of the License, or
9    (at your option) any later version.
10 
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.
15 
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, write to the Free Software
18    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 
20   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
21 
22 #define LILIFSTRING_SIZE 256
23 
24 /*********************************************************************
25  linked list for file descriptors
26 ********************************************************************/
27 
28 typedef struct olili {
29   int fd;                        /* file descriptor */
30   struct olili *ptr_next;  /* pointer to next element in the list */
31 } Olili;
32 
33 int insert_olili(Olili *ptr_first, int value);
34 
35 int delete_olili(Olili *ptr_first, int value);
36 
37 int max_olili(Olili *ptr_first);
38 
39 /*********************************************************************
40  linked list for allocated memory
41 ********************************************************************/
42 
43 typedef struct lilimem {
44   void **ptr_mem; /* pointer to the pointer to the allocated memory */
45   struct lilimem *ptr_next; /* pointer to the next element in the list */
46   char varname[32]; /* name of the pointer to the allocated memory */
47 } Lilimem;
48 
49 int insert_lilimem(Lilimem *ptr_first, void** ptr_mem, char* varname);
50 
51 int delete_lilimem(Lilimem *ptr_first, char* varname);
52 
53 int delete_all_lilimem(Lilimem *ptr_first);
54 
55 /*********************************************************************
56  linked list for decoding html form data
57 ********************************************************************/
58 
59 typedef struct liliform {
60   char name[32]; /* name of the item */
61   char* value; /* ptr to allocated memory with the value of the item */
62   struct liliform *ptr_next; /* pointer to the next element in the list */
63 } Liliform;
64 
65 int insert_liliform(Liliform *ptr_first, char* name, char* value);
66 int append_liliform(Liliform *ptr_first, char* name, char* value);
67 
68 Liliform* get_liliform(Liliform* ptr_first, char* name);
69 Liliform* get_nliliform(Liliform* ptr_first, char* name, size_t n);
70 Liliform* get_next_liliform(Liliform* ptr_first);
71 
72 int delete_all_liliform(Liliform *ptr_first);
73 
74 /*********************************************************************
75  linked list for reading non-standard field mapping for BibTeX data
76 ********************************************************************/
77 
78 typedef struct lilibib {
79   char* name; /* name of the item */
80   char* value; /* ptr to allocated memory with the value of the item */
81   struct lilibib *ptr_next; /* pointer to the next element in the list */
82 } Lilibib;
83 
84 int insert_lilibib(Lilibib *ptr_first, char* name, char* value);
85 
86 Lilibib* get_next_lilibib(Lilibib* ptr_first);
87 
88 Lilibib* get_lilibib(Lilibib* ptr_first, char* name);
89 
90 int delete_all_lilibib(Lilibib *ptr_first);
91 
92 /*********************************************************************
93  linked list for ID values
94 ********************************************************************/
95 
96 typedef struct lilid {
97   unsigned long long value; /*  value of the item */
98   char is_duplicate; /* set to 1 if id is a duplicate */
99   char is_existent; /* set to 1 if id exists */
100   struct lilid *ptr_next; /* pointer to the next element in the list */
101 } Lilid;
102 
103 int insert_lilid(Lilid *ptr_first, unsigned long long value);
104 
105 Lilid* get_next_lilid(Lilid* ptr_first);
106 
107 unsigned long long count_lilid(Lilid* ptr_first);
108 
109 int delete_all_lilid(Lilid *ptr_first);
110 
111 /*********************************************************************
112  linked list for tokenizing strings
113 ********************************************************************/
114 
115 typedef struct lilistring {
116   char* token; /* ptr to allocated memory with the value of the item */
117   struct lilistring *ptr_next; /* pointer to the next element in the list */
118 } Lilistring;
119 
120 int insert_lilistring(Lilistring *ptr_first, char* token);
121 
122 int append_lilistring(Lilistring *ptr_first, char* token);
123 
124 Lilistring* get_next_lilistring(Lilistring* ptr_first);
125 
126 int delete_all_lilistring(Lilistring *ptr_first);
127 
128 int count_lilistring(Lilistring* ptr_first);
129 
130 /*********************************************************************
131  linked list for fixed-size strings
132 ********************************************************************/
133 
134 typedef struct lilifstring {
135   char token[LILIFSTRING_SIZE]; /* ptr to allocated memory with the value of the item */
136   struct lilifstring *ptr_next; /* pointer to the next element in the list */
137 } Lilifstring;
138 
139 int append_lilifstring(Lilifstring *ptr_first, char* token);
140 
141 Lilifstring* get_next_lilifstring(Lilifstring* ptr_first);
142 
143 int delete_all_lilifstring(Lilifstring *ptr_first);
144 
145 char* find_lilifstring(Lilifstring* ptr_first, char* token);
146 
147 
148 
149