Remove a harmless but pointless line in the code to handle the --user argument.
[privoxy.git] / miscutil.h
1 #ifndef MISCUTIL_H_INCLUDED
2 #define MISCUTIL_H_INCLUDED
3 #define MISCUTIL_H_VERSION "$Id: miscutil.h,v 1.30 2008/04/17 14:53:31 fabiankeil Exp $"
4 /*********************************************************************
5  *
6  * File        :  $Source: /cvsroot/ijbswa/current/miscutil.h,v $
7  *
8  * Purpose     :  zalloc, hash_string, safe_strerror, strcmpic,
9  *                strncmpic, and MinGW32 strdup functions.  These are
10  *                each too small to deserve their own file but don't 
11  *                really fit in any other file.
12  *
13  * Copyright   :  Written by and Copyright (C) 2001-2007 the SourceForge
14  *                Privoxy team. http://www.privoxy.org/
15  *
16  *                Based on the Internet Junkbuster originally written
17  *                by and Copyright (C) 1997 Anonymous Coders and 
18  *                Junkbusters Corporation.  http://www.junkbusters.com
19  *
20  *                This program is free software; you can redistribute it 
21  *                and/or modify it under the terms of the GNU General
22  *                Public License as published by the Free Software
23  *                Foundation; either version 2 of the License, or (at
24  *                your option) any later version.
25  *
26  *                This program is distributed in the hope that it will
27  *                be useful, but WITHOUT ANY WARRANTY; without even the
28  *                implied warranty of MERCHANTABILITY or FITNESS FOR A
29  *                PARTICULAR PURPOSE.  See the GNU General Public
30  *                License for more details.
31  *
32  *                The GNU General Public License should be included with
33  *                this file.  If not, you can view it at
34  *                http://www.gnu.org/copyleft/gpl.html
35  *                or write to the Free Software Foundation, Inc., 59
36  *                Temple Place - Suite 330, Boston, MA  02111-1307, USA.
37  *
38  *********************************************************************/
39
40
41 #include "project.h"
42
43 #if defined(__cplusplus)
44 extern "C" {
45 #endif
46
47 extern const char *basedir;
48 extern void *zalloc(size_t size);
49
50 #if defined(unix)
51 extern void write_pid_file(void);
52 #endif /* unix */
53
54 extern unsigned int hash_string(const char* s);
55
56 extern char *safe_strerror(int err);
57
58 extern int strcmpic(const char *s1, const char *s2);
59 extern int strncmpic(const char *s1, const char *s2, size_t n);
60
61 extern jb_err string_append(char **target_string, const char *text_to_append);
62 extern jb_err string_join  (char **target_string,       char *text_to_append);
63
64 extern char *string_toupper(const char *string);
65 extern char *chomp(char *string);
66 extern char *bindup(const char *string, size_t len);
67
68 extern char *make_path(const char * dir, const char * file);
69
70 long int pick_from_range(long int range);
71
72 #ifdef __MINGW32__
73 extern char *strdup(const char *s);
74 #endif /* def __MINGW32__ */
75
76 #ifndef HAVE_SNPRINTF
77 extern int snprintf(char *, size_t, const char *, /*args*/ ...);
78 #endif /* ndef HAVE_SNPRINTF */
79
80 #if !defined(HAVE_TIMEGM) && defined(HAVE_TZSET) && defined(HAVE_PUTENV)
81 time_t timegm(struct tm *tm);
82 #endif /* !defined(HAVE_TIMEGM) && defined(HAVE_TZSET) && defined(HAVE_PUTENV) */
83
84 /* Here's looking at you, Ulrich. */
85 #if !defined(HAVE_STRLCPY)
86 size_t privoxy_strlcpy(char *destination, const char *source, size_t size);
87 #define strlcpy privoxy_strlcpy
88 #define USE_PRIVOXY_STRLCPY 1
89 #define HAVE_STRLCPY 1
90 #endif /* ndef HAVE_STRLCPY*/
91
92 #ifndef HAVE_STRLCAT
93 size_t privoxy_strlcat(char *destination, const char *source, size_t size);
94 #define strlcat privoxy_strlcat
95 #endif /* ndef HAVE_STRLCAT */
96
97 /* Revision control strings from this header and associated .c file */
98 extern const char miscutil_rcs[];
99 extern const char miscutil_h_rcs[];
100
101 #if defined(__cplusplus)
102 }
103 #endif
104
105 #endif /* ndef MISCUTIL_H_INCLUDED */
106
107 /*
108   Local Variables:
109   tab-width: 3
110   end:
111 */