syslog-ng source
string.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2002-2013 Balabit
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * As an additional exemption you are allowed to compile & link against the
19  * OpenSSL libraries as published by the OpenSSL project. See the file
20  * COPYING for details.
21  *
22  */
23 #ifndef COMPAT_STRING_H_INCLUDED
24 #define COMPAT_STRING_H_INCLUDED
25 
26 #include "compat.h"
27 #include <string.h>
28 #include <stdio.h>
29 
30 #include <stddef.h>
31 
32 #if ! SYSLOG_NG_HAVE_STRTOLL
33 # if SYSLOG_NG_HAVE_STRTOIMAX || defined(strtoimax)
34 /* HP-UX has an strtoimax macro, not a function */
35 #include <inttypes.h>
36 #define strtoll(nptr, endptr, base) strtoimax(nptr, endptr, base)
37 # else
38 /* this requires Glib 2.12 */
39 #define strtoll(nptr, endptr, base) g_ascii_strtoll(nptr, endptr, base)
40 # endif
41 #endif
42 
43 #if ! SYSLOG_NG_HAVE_STRCASESTR
44 char *strcasestr(const char *s, const char *find);
45 #endif
46 
47 #if ! SYSLOG_NG_HAVE_MEMRCHR
48 void *memrchr(const void *s, int c, size_t n);
49 #endif
50 
51 #if ! SYSLOG_NG_HAVE_STRTOK_R
52 char *strtok_r(char *string, const char *delim, char **saveptr);
53 #endif
54 
55 #if ! SYSLOG_NG_HAVE_STRNLEN
56 size_t strnlen(const char *s, size_t maxlen);
57 #endif
58 
59 #if ! SYSLOG_NG_HAVE_GETLINE
60 ssize_t getline(char **buf, size_t *bufsiz, FILE *fp);
61 #endif
62 
63 #endif
char * strcasestr(const char *s, const char *find)
Definition: strcasestr.c:77
ssize_t getline(char **buf, size_t *bufsiz, FILE *fp)
Definition: getline.c:118
void * memrchr(const void *s, int c, size_t n)
Definition: memrchr.c:32
char * strtok_r(char *string, const char *delim, char **saveptr)
Definition: strtok_r.c:28
size_t strnlen(const char *s, size_t maxlen)
Definition: strnlen.c:29