Main Page   Class Hierarchy   Alphabetical List   Compound List   Examples  
libconfig.h
00001 /***************************************************************************
00002     copyright            : (C) by 2002-2004 Stefano Barbato
00003     email                : stefano@codesink.org
00004 
00005     $Id: libconfig.h,v 1.10 2009-02-16 18:08:59 tat Exp $
00006  ***************************************************************************/
00007 #ifndef _MIMETIC_LIB_CONFIG_H_
00008 #define _MIMETIC_LIB_CONFIG_H_
00009 #if defined(__unix__) || defined(__linux__) || defined(__unix) || defined(_AIX)
00010 #ifdef HAVE_MIMETIC_CONFIG
00011 #include "config.h"
00012 #endif
00013 #define CONFIG_UNIX
00014 #endif
00015 
00016 /* Mac OS X */
00017 #if defined(__APPLE__) && defined(__MACH__)
00018 typedef unsigned int uint;
00019 #ifdef HAVE_MIMETIC_CONFIG
00020 #include "config.h"
00021 #endif
00022 #define CONFIG_UNIX
00023 #endif
00024 
00025 /* Windows */
00026 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
00027 #include <mimetic/config_win32.h>
00028 #include <process.h>
00029 #include <io.h>
00030 #include <ctime>
00031 #include <cstdio>
00032 typedef unsigned int uint;
00033 #define CONFIG_WIN32
00034 #endif
00035 
00036 #if !defined(CONFIG_WIN32) && !defined(CONFIG_UNIX)
00037 #error "I'm unable to guess platform type. please define CONFIG_WIN32 or CONFIG_UNIX"
00038 #endif
00039 #if defined(CONFIG_WIN32) && defined(CONFIG_UNIX)
00040 #error "I'm unable to guess platform type. please define CONFIG_UNIX or CONFIG_WIN32"
00041 #endif
00042 
00043 #ifdef CONFIG_UNIX
00044 #include <cstdlib>
00045 #define PATH_SEPARATOR '/'
00046 typedef unsigned int uint32;
00047 struct newline_traits
00048 {
00049     enum { lf = 0xA, cr = 0xD };
00050     enum { size = 1 };
00051     enum { ch0 = lf, ch1 = 0 };
00052 };
00053 #endif
00054 
00055 #ifdef CONFIG_WIN32
00056 #define PATH_SEPARATOR '\\'
00057 typedef unsigned int uint32;
00058 struct newline_traits
00059 {
00060     enum { lf = 0xA, cr = 0xD };
00061     enum { size = 2 };
00062     enum { ch0 = cr, ch1 = lf };
00063 };
00064 #endif
00065 
00066 #endif