All pastes #331119 Raw Edit

Mine

public cpp v1 · immutable
#331119 ·published 2007-01-28 15:54 UTC
rendered paste body
/* * zim - a communication platform for *nix and Windows * * Copyright (C) 2006,2007 Juergen Gegenfurtner * * This program is free software; you can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with this program; * if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA * *//* Special Thanks: *         Xodox, *         */   #ifndef _CONFIG_HPP#define _CONFIG_HPP#include <iostream> // cout, cerr, ..#include <string>   // String Class operations#include <cstdlib>  // String Operations#ifdef _PROFILING     #include <ctime>    // time handling#endif#ifdef _ZIM_CORE_HPP     #include <cstring>     #define zBUF 1024     #define zIM_USER_ER_END -5     enum{         zIM_OK = 0,         zIM_FAIL = -1,              };     #include "zim_core_user.hpp"     #include "zim_statuscodes.hpp"     #ifdef _ZIM_CORE_USER_HPP            // Noch mehr Bla Bla     #endif#endif#ifdef _ZIM_SOCKET_SELECT_HPP          #include <sys/time.h>       #include <fstream>       #include <cstring>       #ifdef __unix         #include <sys/select.h>       #endif       /* zSockSelect Macros */       #define zSELBUF 1024       #define zIM_MSG_TIMEOUT_SEC 10       #define zIM_MSG_TIMEOUT_USEC 0       #define zSELECTPORT 31337              enum{           zSELECT_INIT = -1,           zSELECT_OK   = 0,           zSELECT_ER   = 1200,           zSELECT_NEW_USER,           zSELECT_FAIL,                           };#endif#ifdef _ZIM_MYSQLLIB_HPP     #include "mysql/mysql.h"       /* zMYSQL Debug Mode */     #define zMYSQL_DEBUG     /* zMYSQL Macros */     #define zBUF 1024     #define zMYSQL_ERROR -2     #define zMYSQL_DESTROYED -1     #define zMYSQL_GENERATED 0     #define zMYSQL_CONNECTED 1     #define zMYSQL_DISCONNECTED 2         enum {          zMYSQL_INIT=1000,          zMYSQL_OK=512,          zMYSQL_ERROR_HOST_BLOCKED=100,          zMYSQL_ERROR_SERVER_UR,      // UR = Userlimit reached          zMYSQL_ERROR_RESTRICTED,          zMYSQL_ERROR_DB_UNAVAILABLE,          zMYSQL_ERROR_NO_DB_SELECTED,          zMYSQL_ERROR_UNKNOWN_CMD,          zMYSQL_ERROR_TB_EXIST,          zMYSQL_ERROR_TB_UNAVAILABLE,          zMYSQL_ERROR_NAME_INCORRECT,          zMYSQL_ERROR_TOO_MUCH,     };#endif#ifdef _ZIM_SOCKET_HPP     /* zSocket Debug Mode */     #define zSOCKET_DEBUG     /* zSocket Macros */     #define zCONNECTIONS 5     #define zRECV 1024     #define zSEND 1024          enum {          zSOCK_OK=612,          zSOCK_ER_UNKNOWN_HOST=200,          zSOCK_ER_ACCEPT_FAILED,          zSOCK_ER_LISTEN_FAILED,          zSOCK_ER_CON_FAILED,          zSOCK_ER_BIND_FAILED,          zSOCK_ER_CREATE_FAILED,          zSOCK_ER_WINSOCK_FAILED,          zSOCK_ER_SEND_FAILED,          zSOCK_ER_RECV_FAILED,          zSOCK_ER_SOCKET_BROKEN,          zSOCK_ER_SEND_SENDVAR_TOO_LITTLE,          zSOCK_ER_SEND_SENDVAR_TOO_BIG,      };          #ifdef _WIN32         // these librarys are relevant to work with sockets          // under windows ;-)         // #pragma comment(lib,"ws2_32")	     // #pragma comment(lib,"wsock32")         #include <winsock.h>         #include <windows.h>         #include <io.h>     #else         #include <sys/types.h>	     #include <sys/socket.h>      	 #include <netinet/in.h>         #include <netdb.h>         #include <arpa/inet.h>         #include <unistd.h>     #endif#endif/* use debug-mode, if defined *///#define DEBUGMODE #endif