| 1 |
/* simpletypes.h: basic string, boolean, etc., that we use in kpathsea. |
| 2 |
|
| 3 |
This is needed to avoid a loop between types.h and str-llist.h. |
| 4 |
Otherwise, types.h would have to be included before str-llist.h, |
| 5 |
because types.h itself also includes str-llist.h, and its following |
| 6 |
use of str_llist_type would not be defined. So instead we have |
| 7 |
str-llist.h #include this, instead of the full types.h. All follows |
| 8 |
from types.h including nearly everything, so that MetaPost can be a |
| 9 |
threaded library. |
| 10 |
|
| 11 |
Copyright 1993, 1994, 2008, 2010, 2014 Karl Berry. |
| 12 |
|
| 13 |
This library is free software; you can redistribute it and/or |
| 14 |
modify it under the terms of the GNU Lesser General Public |
| 15 |
License as published by the Free Software Foundation; either |
| 16 |
version 2.1 of the License, or (at your option) any later version. |
| 17 |
|
| 18 |
This library is distributed in the hope that it will be useful, |
| 19 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 21 |
Lesser General Public License for more details. |
| 22 |
|
| 23 |
You should have received a copy of the GNU Lesser General Public License |
| 24 |
along with this library; if not, see <http://www.gnu.org/licenses/>. */ |
| 25 |
|
| 26 |
#ifndef KPATHSEA_SIMPLETYPES_H |
| 27 |
#define KPATHSEA_SIMPLETYPES_H |
| 28 |
|
| 29 |
#ifdef __cplusplus |
| 30 |
extern "C" { |
| 31 |
#endif |
| 32 |
|
| 33 |
/* Booleans. */ |
| 34 |
/* NeXT wants to define their own boolean type. */ |
| 35 |
#ifndef HAVE_BOOLEAN |
| 36 |
#define HAVE_BOOLEAN |
| 37 |
typedef int boolean; |
| 38 |
/* `true' and `false' are reserved words in C++. */ |
| 39 |
#ifndef __cplusplus |
| 40 |
#ifndef true |
| 41 |
#define true 1 |
| 42 |
#define false 0 |
| 43 |
#endif /* not true */ |
| 44 |
#endif /* not __cplusplus */ |
| 45 |
#endif /* not HAVE_BOOLEAN */ |
| 46 |
|
| 47 |
/* The X library (among other things) defines `FALSE' and `TRUE', and so |
| 48 |
we only want to define them if necessary, for use by application code. */ |
| 49 |
#ifndef FALSE |
| 50 |
#define FALSE false |
| 51 |
#define TRUE true |
| 52 |
#endif /* FALSE */ |
| 53 |
|
| 54 |
/* The usual null-terminated string. */ |
| 55 |
typedef char *string; |
| 56 |
|
| 57 |
/* A pointer to constant data. (ANSI says `const string' is |
| 58 |
`char * const', which is a constant pointer to non-constant data.) */ |
| 59 |
typedef const char *const_string; |
| 60 |
|
| 61 |
/* A generic pointer. */ |
| 62 |
typedef void *address; |
| 63 |
|
| 64 |
#ifdef __cplusplus |
| 65 |
} |
| 66 |
#endif |
| 67 |
|
| 68 |
#endif /* not KPATHSEA_TYPES_H */ |