00001 /*****************************************************************************\ 00002 * Copyright (c) 2004 Mark Aylett <mark@emantic.co.uk> * 00003 * * 00004 * Permission is hereby granted, free of charge, to any person obtaining a * 00005 * copy of this software and associated documentation files (the * 00006 * "Software"), to deal in the Software without restriction, including * 00007 * without limitation the rights to use, copy, modify, merge, publish, * 00008 * distribute, sublicense, and/or sell copies of the Software, and to permit * 00009 * persons to whom the Software is furnished to do so, subject to the * 00010 * following conditions: * 00011 * * 00012 * The above copyright notice and this permission notice shall be included * 00013 * in all copies or substantial portions of the Software. * 00014 * * 00015 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 00016 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 00017 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN * 00018 * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 00019 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 00020 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE * 00021 * USE OR OTHER DEALINGS IN THE SOFTWARE. * 00022 \*****************************************************************************/ 00023 00029 #ifndef INCLUDED_MAR_TYPES_C 00030 #define INCLUDED_MAR_TYPES_C 00031 00032 #ifndef INCLUDED_FCNTL 00033 #define INCLUDED_FCNTL 00034 #include <fcntl.h> 00035 #endif /* INCLUDED_FCNTL */ 00036 00037 #ifndef INCLUDED_STDDEF 00038 #define INCLUDED_STDDEF 00039 #include <stddef.h> 00040 #endif /* INCLUDED_STDDEF */ 00041 00042 #ifndef INCLUDED_SYS_TYPES 00043 #define INCLUDED_SYS_TYPES 00044 #include <sys/types.h> 00045 #endif /* INCLUDED_SYS_TYPES */ 00046 00047 #if defined(WIN32) 00048 typedef int mode_t; 00049 typedef int ssize_t; 00050 #endif /* WIN32 */ 00051 00056 typedef char mar_key_t[38]; 00057 00062 typedef struct mar_pair { 00066 mar_key_t key_; 00070 const void* data_; 00074 size_t size_; 00075 } mar_pair_t; 00076 00081 #define MAR_NOMATCH (-2) 00082 00091 #define MAR_RDONLY O_RDONLY 00092 00096 #define MAR_WRONLY O_WRONLY 00097 00101 #define MAR_RDWR O_RDWR 00102 00106 #define MAR_APPEND O_APPEND 00107 00111 #define MAR_CREAT O_CREAT 00112 00116 #define MAR_TRUNC O_TRUNC 00117 00121 #define MAR_EXCL O_EXCL 00122 /* \} */ 00123 00132 #define MAR_SET 0 00133 00137 #define MAR_CUR 1 00138 00142 #define MAR_END 2 00143 /* \} */ 00144 00145 #endif /* INCLUDED_MAR_TYPES_C */ 00146