Replaced "list_share" with "list" - the tiny memory gain was not
[privoxy.git] / list.h
1 #ifndef _LIST_H
2 #define _LIST_H
3 #define LIST_H_VERSION "$Id: list.h,v 1.1 2001/05/31 21:11:53 jongfoster Exp $"
4 /*********************************************************************
5  *
6  * File        :  $Source: /cvsroot/ijbswa/current/list.h,v $
7  *
8  * Purpose     :  Declares functions to handle lists.
9  *                Functions declared include:
10  *                   `destroy_list', `enlist' and `list_to_text'
11  *
12  * Copyright   :  Written by and Copyright (C) 2001 the SourceForge
13  *                IJBSWA team.  http://ijbswa.sourceforge.net
14  *
15  *                Based on the Internet Junkbuster originally written
16  *                by and Copyright (C) 1997 Anonymous Coders and 
17  *                Junkbusters Corporation.  http://www.junkbusters.com
18  *
19  *                This program is free software; you can redistribute it 
20  *                and/or modify it under the terms of the GNU General
21  *                Public License as published by the Free Software
22  *                Foundation; either version 2 of the License, or (at
23  *                your option) any later version.
24  *
25  *                This program is distributed in the hope that it will
26  *                be useful, but WITHOUT ANY WARRANTY; without even the
27  *                implied warranty of MERCHANTABILITY or FITNESS FOR A
28  *                PARTICULAR PURPOSE.  See the GNU General Public
29  *                License for more details.
30  *
31  *                The GNU General Public License should be included with
32  *                this file.  If not, you can view it at
33  *                http://www.gnu.org/copyleft/gpl.html
34  *                or write to the Free Software Foundation, Inc., 59
35  *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
36  *
37  * Revisions   :
38  *    $Log: list.h,v $
39  *    Revision 1.1  2001/05/31 21:11:53  jongfoster
40  *    - Moved linked list support to new "list.c" file.
41  *      Structure definitions are still in project.h,
42  *      function prototypes are now in "list.h".
43  *    - Added support for "struct list_share", which is identical
44  *      to "struct list" except it saves memory by not duplicating
45  *      the strings.  Obviously, this only works if there is some
46  *      other way of managing the memory used by the strings.
47  *      (These list_share lists are used for lists which last
48  *      for only 1 request, and where all the list entries are
49  *      just coming directly from entries in the actionsfile.)
50  *      Note that you still need to destroy list_share lists
51  *      properly to free the nodes - it's only the strings
52  *      which are shared.
53  *
54  *
55  *********************************************************************/
56 \f
57
58 #include "project.h"
59
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63
64
65 extern void  enlist(struct list *h, const char *s);
66 extern void  enlist_unique(struct list *header, const char *str);
67
68 extern void  destroy_list(struct list *h);
69
70 extern char *list_to_text(struct list *h);
71
72 extern int   list_remove_item(struct list *header, const char *str);
73 extern int   list_remove_list(struct list *header, const struct list *to_remove);
74
75 extern void  list_append_list_unique(struct list *dest, const struct list *src);
76
77 extern void  list_duplicate(struct list *dest, const struct list *src);
78
79
80 /* Revision control strings from this header and associated .c file */
81 extern const char list_rcs[];
82 extern const char list_h_rcs[];
83
84 #ifdef __cplusplus
85 } /* extern "C" */
86 #endif
87
88 #endif /* ndef _LIST_H */
89
90 /*
91   Local Variables:
92   tab-width: 3
93   end:
94 */