diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/General.h | 12 | ||||
-rw-r--r-- | include/Handle.h | 6 | ||||
-rw-r--r-- | include/Makefile.am | 2 | ||||
-rw-r--r-- | include/String.h | 7 | ||||
-rw-r--r-- | include/generic.h | 48 |
5 files changed, 30 insertions, 45 deletions
diff --git a/include/General.h b/include/General.h deleted file mode 100644 index 2b645c9..0000000 --- a/include/General.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef __GENERAL_H__ -#define __GENERAL_H__ - -#define MAX(__a,__b) ((__a)<(__b)?(__b):(__a)) -#define MIN(__a,__b) ((__a)>(__b)?(__b):(__a)) - -#define BITCOUNT(x) (((BX_(x)+(BX_(x)>>4)) & 0x0F0F0F0F) % 255) -#define BX_(x) ((x) - (((x)>>1)&0x77777777) \ - - (((x)>>2)&0x33333333) \ - - (((x)>>3)&0x11111111)) - -#endif diff --git a/include/Handle.h b/include/Handle.h index 9744b7e..e545109 100644 --- a/include/Handle.h +++ b/include/Handle.h @@ -5,9 +5,7 @@ #include <sys/types.h> #include <time.h> -#ifdef HAVE_ZLIB #include <zlib.h> -#endif #include <unistd.h> #include <iostream> #include <String.h> @@ -34,9 +32,7 @@ class Handle : public Base { int GetHandle(); virtual bool CanWatch() const; virtual void Dup(const Handle &); -#ifdef HAVE_ZLIB virtual void SetZ(int = 9) throw (GeneralException); -#endif protected: Handle(int h); int GetHandle() const; @@ -46,10 +42,8 @@ class Handle : public Base { ssize_t uread(void *, size_t); int h; bool closed, nonblock; -#ifdef HAVE_ZLIB gzFile zfile; int z; -#endif }; Handle & operator<<(Handle &, const String &); diff --git a/include/Makefile.am b/include/Makefile.am index 5d895be..d50604f 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,5 +1,5 @@ #includedir = $(prefix)/include/@PACKAGE@ pkginclude_HEADERS = \ Exceptions.h Handle.h String.h Output.h Socket.h HttpServ.h Variables.h Menu.h \ -Action.h Message.h Form.h Confirm.h Table.h IRC.h Task.h Buffer.h General.h \ +Action.h Message.h Form.h Confirm.h Table.h IRC.h Task.h Buffer.h \ CopyJob.h ReadJob.h Regex.h TaskMan.h InPipe.h OutPipe.h Input.h Image.h Main.h diff --git a/include/String.h b/include/String.h index 72fc135..d8959b9 100644 --- a/include/String.h +++ b/include/String.h @@ -5,6 +5,7 @@ #include <iostream> #include <string.h> #include <Exceptions.h> +#include <generic.h> class String : public Base { public: @@ -16,10 +17,8 @@ class String : public Base { String(char); String(int); String(unsigned int); -#ifdef USE_LONG_LONG - String(long long); - String(unsigned long long); -#endif + String(int64); + String(uint64); String(double); ~String(); const char * set(const char *, ...); diff --git a/include/generic.h b/include/generic.h index 62a9942..a8f3be5 100644 --- a/include/generic.h +++ b/include/generic.h @@ -1,27 +1,5 @@ -/* - * PSX-Tools Bundle Pack - * Copyright (C) 2002 Nicolas "Pixel" Noble - * - * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - #ifndef __GENERIC_H__ #define __GENERIC_H__ -#ifdef __cplusplus -#include "String.h" -#endif #define M_BARE -1 #define M_ERROR 0 @@ -77,6 +55,16 @@ typedef Uint16 Word; typedef Uint32 DWord; #endif +#if defined __linux__ || defined __solaris__ || defined __CYGWIN32__ +typedef long long int64; +typedef unsigned long long uint64; +#elif defined _WIN32 +typedef _int64 int64; +typedef unsigned _int64 int64; +#else +#error Unsupported platform (need 64 bits ints definition) +#endif + #if defined __linux__ || defined __CYGWIN32__ #define PACKED __attribute__((packed)) #else @@ -87,6 +75,7 @@ extern char verbosity; char ** split(char * s, char t); #ifdef __cplusplus +#include <String.h> void printm(int level, String fmt, ...); #ifndef MAX @@ -114,6 +103,11 @@ inline T MIN(T a, T b) { #endif +#define BITCOUNT(x) (((BX_(x)+(BX_(x)>>4)) & 0x0F0F0F0F) % 255) +#define BX_(x) ((x) - (((x)>>1)&0x77777777) \ + - (((x)>>2)&0x33333333) \ + - (((x)>>3)&0x11111111)) + #include <sys/types.h> #include <sys/stat.h> @@ -125,4 +119,14 @@ inline T MIN(T a, T b) { #error Unknow compiler/platform #endif +#if defined __linux__ || defined __solaris__ || defined __CYGWIN32__ +typedef long long int64; +typedef unsigned long long uint64; +#elif defined _WIN32 +typedef _int64 int64; +typedef unsigned _int64 int64; +#else +#error Unsupported platform (need 64 bits ints definition) +#endif + #endif |