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.8 2006/04/18 14:10:52 tat Exp $
00006  ***************************************************************************/
00007 
00008 /***************************************************************************
00009  *                                                                         *
00010  *   This program is free software; you can redistribute it and/or modify  *
00011  *   it under the terms of the GNU General Public License as published by  *
00012  *   the Free Software Foundation; either version 2 of the License, or     *
00013  *   (at your option) any later version.                                   *
00014  *                                                                         *
00015  ***************************************************************************/
00016 #ifndef _MIMETIC_LIB_CONFIG_H_
00017 #define _MIMETIC_LIB_CONFIG_H_
00018 #if defined(__unix__) || defined(__linux__) || defined(__unix) || defined(_AIX)
00019 #ifdef HAVE_MIMETIC_CONFIG
00020 #include "config.h"
00021 #endif
00022 #define CONFIG_UNIX
00023 #endif
00024 
00025 /* Mac OS X */
00026 #if defined(__APPLE__) && defined(__MACH__)
00027 #ifdef HAVE_MIMETIC_CONFIG
00028 #include "config.h"
00029 #endif
00030 #define CONFIG_UNIX
00031 #endif
00032 
00033 /* Windows */
00034 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
00035 #include <mimetic/config_win32.h>
00036 #include <process.h>
00037 #include <io.h>
00038 #include <ctime>
00039 #include <cstdio>
00040 typedef unsigned int uint;
00041 #define CONFIG_WIN32
00042 #endif
00043 
00044 #if !defined(CONFIG_WIN32) && !defined(CONFIG_UNIX)
00045 #error "I'm unable to guess platform type. please define CONFIG_WIN32 or CONFIG_UNIX"
00046 #endif
00047 #if defined(CONFIG_WIN32) && defined(CONFIG_UNIX)
00048 #error "I'm unable to guess platform type. please define CONFIG_UNIX or CONFIG_WIN32"
00049 #endif
00050 
00051 #ifdef CONFIG_UNIX
00052 #define PATH_SEPARATOR '/'
00053 typedef unsigned int uint32;
00054 struct newline_traits
00055 {
00056     enum { lf = 0xA, cr = 0xD };
00057     enum { size = 1 };
00058     enum { ch0 = lf, ch1 = 0 };
00059 };
00060 #endif
00061 
00062 #ifdef CONFIG_WIN32
00063 #define PATH_SEPARATOR '\\'
00064 typedef unsigned int uint32;
00065 struct newline_traits
00066 {
00067     enum { lf = 0xA, cr = 0xD };
00068     enum { size = 2 };
00069     enum { ch0 = cr, ch1 = lf };
00070 };
00071 #endif
00072 
00073 #endif