suricata
util-fmemopen.h
Go to the documentation of this file.
1 /* Copyright (C) 2007-2010 Open Information Security Foundation
2  *
3  * You can copy, redistribute or modify this Program under the terms of
4  * the GNU General Public License version 2 as published by the Free
5  * Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * version 2 along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17 
18 /**
19  * \file
20  *
21  * \author Pablo Rincon Crespo <pablo.rincon.crespo@gmail.com>
22  * Based on FMem.c of Alexandre Flori (2008/10/17 AF)
23  */
24 
25 #ifndef __FMEMOPEN_H__
26 #define __FMEMOPEN_H__
27 #include <stdio.h>
28 #include <stdlib.h>
29 #include <string.h>
30 
31 /* Include this file only for OSX / BSD compilations */
32 #ifdef OS_DARWIN
33 #define USE_FMEM_WRAPPER 1
34 #endif
35 
36 #ifdef OS_FREEBSD
37 #define USE_FMEM_WRAPPER 1
38 #endif
39 
40 #ifdef __OpenBSD__
41 #define USE_FMEM_WRAPPER 1
42 #endif
43 
44 #ifdef OS_WIN32
45 #define USE_FMEM_WRAPPER 1
46 #endif
47 
48 #ifdef USE_FMEM_WRAPPER
49 FILE *SCFmemopen(void *, size_t, const char *);
50 #else
51 /* Else use the normal fmemopen */
52 #define SCFmemopen fmemopen
53 #endif
54 
55 #endif /* __FMEMOPEN_H__ */
#define SCFmemopen
Definition: util-fmemopen.h:52