diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/dms.h | 142 |
1 files changed, 142 insertions, 0 deletions
diff --git a/include/dms.h b/include/dms.h new file mode 100644 index 0000000..1c9a5dd --- /dev/null +++ b/include/dms.h | |||
| @@ -0,0 +1,142 @@ | |||
| 1 | /* | ||
| 2 | * DMS Tools and Utilities | ||
| 3 | * Copyright (C) 2010 David M. Syzdek <david@syzdek.net>. | ||
| 4 | * | ||
| 5 | * @SYZDEK_LICENSE_HEADER_START@ | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License Version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 19 | * | ||
| 20 | * @SYZDEK_LICENSE_HEADER_END@ | ||
| 21 | */ | ||
| 22 | /** | ||
| 23 | * @file lib/dms.h defines API for libdms.la | ||
| 24 | */ | ||
| 25 | #ifndef _DMS_H | ||
| 26 | #define _DMS_H 1 | ||
| 27 | |||
| 28 | ////////////// | ||
| 29 | // // | ||
| 30 | // Macros // | ||
| 31 | // // | ||
| 32 | ////////////// | ||
| 33 | |||
| 34 | /* | ||
| 35 | * The macros "BEGIN_C_DECLS" and "END_C_DECLS" are taken verbatim | ||
| 36 | * from section 7.1 of the Libtool 1.5.14 manual. | ||
| 37 | */ | ||
| 38 | /* BEGIN_C_DECLS should be used at the beginning of your declarations, | ||
| 39 | so that C++ compilers don't mangle their names. Use END_C_DECLS at | ||
| 40 | the end of C declarations. */ | ||
| 41 | #undef BEGIN_C_DECLS | ||
| 42 | #undef END_C_DECLS | ||
| 43 | #if defined(__cplusplus) || defined(c_plusplus) | ||
| 44 | # define BEGIN_C_DECLS extern "C" { ///< exports as C functions | ||
| 45 | # define END_C_DECLS } ///< exports as C functions | ||
| 46 | #else | ||
| 47 | # define BEGIN_C_DECLS /* empty */ ///< exports as C functions | ||
| 48 | # define END_C_DECLS /* empty */ ///< exports as C functions | ||
| 49 | #endif | ||
| 50 | |||
| 51 | |||
| 52 | /* | ||
| 53 | * The macro "PARAMS" is taken verbatim from section 7.1 of the | ||
| 54 | * Libtool 1.5.14 manual. | ||
| 55 | */ | ||
| 56 | /* PARAMS is a macro used to wrap function prototypes, so that | ||
| 57 | compilers that don't understand ANSI C prototypes still work, | ||
| 58 | and ANSI C compilers can issue warnings about type mismatches. */ | ||
| 59 | #undef PARAMS | ||
| 60 | #if defined (__STDC__) || defined (_AIX) \ | ||
| 61 | || (defined (__mips) && defined (_SYSTYPE_SVR4)) \ | ||
| 62 | || defined(WIN32) || defined (__cplusplus) | ||
| 63 | # define PARAMS(protos) protos ///< wraps function arguments in order to support ANSI C | ||
| 64 | #else | ||
| 65 | # define PARAMS(protos) () ///< wraps function arguments in order to support ANSI C | ||
| 66 | #endif | ||
| 67 | |||
| 68 | |||
| 69 | /* | ||
| 70 | * The following macro is taken verbatim from section 5.40 of the GCC | ||
| 71 | * 4.0.2 manual. | ||
| 72 | */ | ||
| 73 | #if __STDC_VERSION__ < 199901L | ||
| 74 | # if __GNUC__ >= 2 | ||
| 75 | # define __func__ __FUNCTION__ | ||
| 76 | # else | ||
| 77 | # define __func__ "<unknown>" | ||
| 78 | # endif | ||
| 79 | #endif | ||
| 80 | |||
| 81 | |||
| 82 | // Exports function type | ||
| 83 | #ifdef WIN32 | ||
| 84 | # ifdef DMS_LIBS_DYNAMIC | ||
| 85 | # define DMS_F(type) extern __declspec(dllexport) type ///< used for library calls | ||
| 86 | # define DMS_V(type) extern __declspec(dllexport) type ///< used for library calls | ||
| 87 | # else | ||
| 88 | # define DMS_F(type) extern __declspec(dllimport) type ///< used for library calls | ||
| 89 | # define DMS_V(type) extern __declspec(dllimport) type ///< used for library calls | ||
| 90 | # endif | ||
| 91 | #else | ||
| 92 | # ifdef DMS_LIBS_DYNAMIC | ||
| 93 | # define DMS_F(type) type ///< used for library calls | ||
| 94 | # define DMS_V(type) type ///< used for library calls | ||
| 95 | # else | ||
| 96 | # define DMS_F(type) extern type ///< used for library calls | ||
| 97 | # define DMS_V(type) extern type ///< used for library calls | ||
| 98 | # endif | ||
| 99 | #endif | ||
| 100 | |||
| 101 | |||
| 102 | /////////////// | ||
| 103 | // // | ||
| 104 | // Headers // | ||
| 105 | // // | ||
| 106 | /////////////// | ||
| 107 | |||
| 108 | #include <inttypes.h> | ||
| 109 | |||
| 110 | |||
| 111 | /////////////////// | ||
| 112 | // // | ||
| 113 | // Definitions // | ||
| 114 | // // | ||
| 115 | /////////////////// | ||
| 116 | |||
| 117 | #define DMS_TRUE 0x01 | ||
| 118 | #define DMS_FALSE 0x00 | ||
| 119 | #define DMS_YES 0x01 | ||
| 120 | #define DMS_NO 0x00 | ||
| 121 | |||
| 122 | |||
| 123 | ///////////////// | ||
| 124 | // // | ||
| 125 | // Datatypes // | ||
| 126 | // // | ||
| 127 | ///////////////// | ||
| 128 | |||
| 129 | |||
| 130 | ////////////////// | ||
| 131 | // // | ||
| 132 | // Prototypes // | ||
| 133 | // // | ||
| 134 | ////////////////// | ||
| 135 | BEGIN_C_DECLS | ||
| 136 | |||
| 137 | // returns version info string for library | ||
| 138 | DMS_F(const char *) dms_version PARAMS((void)); | ||
| 139 | |||
| 140 | |||
| 141 | END_C_DECLS | ||
| 142 | #endif /* end of header file */ \ No newline at end of file | ||
