In get_log_timestamp(), use the ISO 8601 date format %Y-%m-%d.
[privoxy.git] / list.h
1 #ifndef LIST_H_INCLUDED
2 #define LIST_H_INCLUDED
3 #define LIST_H_VERSION "$Id: list.h,v 1.16 2009/05/16 13:27:20 fabiankeil 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-2007 the SourceForge
13  *                Privoxy team. http://www.privoxy.org/
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  *********************************************************************/
38
39
40 #include "project.h"
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45
46
47 /*
48  * struct list
49  *
50  * A linked list class.
51  */
52
53 extern void init_list    (struct list *the_list);
54 extern void destroy_list (struct list *the_list);
55
56 extern jb_err enlist                 (struct list *the_list, const char *str);
57 extern jb_err enlist_unique          (struct list *the_list, const char *str, size_t num_significant_chars);
58 extern jb_err enlist_unique_header   (struct list *the_list, const char *name, const char *value);
59 extern jb_err enlist_first           (struct list *the_list, const char *str);
60 extern jb_err list_append_list_unique(struct list *dest,     const struct list *src);
61 extern jb_err list_duplicate         (struct list *dest,     const struct list *src);
62
63 extern int    list_remove_item(struct list *the_list, const char *str);
64 extern int    list_remove_list(struct list *dest,     const struct list *src);
65 extern void   list_remove_all (struct list *the_list);
66
67 extern int    list_is_empty(const struct list *the_list);
68
69 extern char * list_to_text(const struct list *the_list);
70
71 extern int    list_contains_item(const struct list *the_list, const char *str);
72
73 /*
74  * struct map
75  *
76  * A class which maps names to values.
77  *
78  * Note: You must allocate this through new_map() and free it
79  * through free_map().
80  */
81
82 extern struct map * new_map  (void);
83 extern void         free_map (struct map * the_map);
84
85 extern jb_err       map      (struct map * the_map,
86                               const char * name, int name_needs_copying,
87                               const char * value, int value_needs_copying);
88 extern jb_err       unmap    (struct map *the_map,
89                               const char *name);
90 extern const char * lookup   (const struct map * the_map, const char * name);
91
92
93 /* Revision control strings from this header and associated .c file */
94 extern const char list_rcs[];
95 extern const char list_h_rcs[];
96
97 #ifdef __cplusplus
98 } /* extern "C" */
99 #endif
100
101 #endif /* ndef LIST_H_INCLUDED */
102
103 /*
104   Local Variables:
105   tab-width: 3
106   end:
107 */