1 /*
2    Global interfaces private to neon.
3    Copyright (C) 2005-2006, Joe Orton <joe@manyfish.co.uk>
4 
5    This library is free software; you can redistribute it and/or
6    modify it under the terms of the GNU Library General Public
7    License as published by the Free Software Foundation; either
8    version 2 of the License, or (at your option) any later version.
9 
10    This library is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    Library General Public License for more details.
14 
15    You should have received a copy of the GNU Library General Public
16    License along with this library; if not, write to the Free
17    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
18    MA 02111-1307, USA
19 
20 */
21 
22 /* NOTE WELL: The interfaces defined in this file are internal to neon
23  * and MUST NOT be used by neon-based applications. */
24 
25 #ifndef NE_INTERNAL_H
26 #define NE_INTERNAL_H 1
27 
28 #include "config.h"
29 
30 #ifdef HAVE_SYS_LIMITS_H
31 #include <sys/limits.h>
32 #endif
33 #ifdef HAVE_LIMITS_H
34 #include <limits.h> /* for UINT_MAX etc */
35 #endif
36 
37 #include "ne_defs.h"
38 
39 #undef _
40 #ifdef NE_HAVE_I18N
41 #include <libintl.h>
42 #define _(str) dgettext(PACKAGE_NAME, str)
43 #else
44 #define _(str) (str)
45 #endif /* NE_ENABLE_NLS */
46 #define N_(str) (str)
47 
48 #if !defined(LONG_LONG_MAX) && defined(LLONG_MAX)
49 #define LONG_LONG_MAX LLONG_MAX
50 #elif !defined(LONG_LONG_MAX) && defined(LONGLONG_MAX)
51 #define LONG_LONG_MAX LONGLONG_MAX
52 #endif
53 
54 #if defined(NE_LFS)
55 
56 #define ne_lseek lseek64
57 #define FMT_NE_OFF_T NE_FMT_OFF64_T
58 #define NE_OFFT_MAX LONG_LONG_MAX
59 #ifdef HAVE_STRTOLL
60 #define ne_strtoff strtoll
61 #else
62 #define ne_strtoff strtoq
63 #endif
64 
65 #else /* !NE_LFS */
66 
67 #define ne_lseek lseek
68 #define FMT_NE_OFF_T NE_FMT_OFF_T
69 
70 #if defined(SIZEOF_LONG_LONG) && defined(LONG_LONG_MAX) \
71     && SIZEOF_OFF_T == SIZEOF_LONG_LONG
72 #define NE_OFFT_MAX LONG_LONG_MAX
73 #else
74 #define NE_OFFT_MAX LONG_MAX
75 #endif
76 
77 #if SIZEOF_OFF_T > SIZEOF_LONG && defined(HAVE_STRTOLL)
78 #define ne_strtoff strtoll
79 #elif SIZEOF_OFF_T > SIZEOF_LONG && defined(HAVE_STRTOQ)
80 #define ne_strtoff strtoq
81 #else
82 #define ne_strtoff strtol
83 #endif
84 #endif /* NE_LFS */
85 
86 #endif /* NE_INTERNAL_H */
87