From 3eca787a2b83ff8cf60d2be9e588d4a558b85a85 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Sat, 3 Apr 2004 20:49:23 +0000 Subject: Sorted the headers properly. --- src/compat.c | 9 +----- src/compat.h | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/list.c | 6 ---- src/main.c | 8 +---- src/misc.c | 5 --- src/ntfsx.c | 5 --- src/scrounge.c | 7 +---- src/search.c | 2 +- src/unicode.c | 4 +-- src/usuals.h | 34 ++++++++++++++------ 10 files changed, 126 insertions(+), 51 deletions(-) diff --git a/src/compat.c b/src/compat.c index b183a99..14b85e4 100644 --- a/src/compat.c +++ b/src/compat.c @@ -17,15 +17,8 @@ * Send bug reports to: */ -#include -#include -#include -#include #include "compat.h" - -#ifdef HAVE_STRING_H -#include -#endif +#include "usuals.h" /* * We need to get a better check for this one. diff --git a/src/compat.h b/src/compat.h index 373d359..8f75ef2 100644 --- a/src/compat.h +++ b/src/compat.h @@ -83,6 +83,103 @@ typedef unsigned int uint; #define HAVE_UINT #endif +#ifndef HAVE_UINT64 + #ifdef _WIN32 + typedef unsigned __int64 uint64; + #else + #ifdef HAVE_64BITLONGLONG + typedef unsigned long long uint64; + #else + #ifdef HAVE_64BITLONG + typedef unsigned long uint64; + #else + #error ERROR: Must have a compiler that can handle 64 bit integers + #endif + #endif + #endif +#endif + +#ifndef HAVE_UINT32 + #ifdef _WIN32 + typedef unsigned __int32 uint32; + #else + #ifdef HAVE_32BITLONG + typedef unsigned long uint32; + #else + #ifdef HAVE_32BITINT + typedef unsigned int uint32; + #else + #error ERROR: Couldn't find a 32 bit integer to use + #endif + #endif + #endif +#endif + +#ifndef HAVE_UINT16 + #ifdef _WIN32 + typedef unsigned __int16 uint16; + #else + #ifdef HAVE_16BITSHORT + typedef unsigned short uint16; + #else + #ifdef HAVE_16BITINT + typedef unsigned int uint16; + #else + #error ERROR: Couldn't find a 16 bit integer to use + #endif + #endif + #endif +#endif + +#ifndef HAVE_INT64 + #ifdef _WIN32 + typedef signed __int64 int64; + #else + #ifdef HAVE_64BITLONGLONG + typedef signed long long int64; + #else + #ifdef HAVE_64BITLONG + typedef signed long int64; + #else + #error ERROR: Must have a compiler that can handle 64 bit integers + #endif + #endif + #endif +#endif + +#ifndef HAVE_INT32 + #ifdef _WIN32 + typedef signed __int32 int32; + #else + #ifdef HAVE_32BITLONG + typedef signed long int32; + #else + #ifdef HAVE_32BITINT + typedef signed int int32; + #else + #error ERROR: Couldn't find a 32 bit integer to use + #endif + #endif + #endif +#endif + +#ifndef HAVE_INT16 + #ifdef _WIN32 + typedef signed __int16 int16; + #else + #ifdef HAVE_16BITSHORT + typedef signed short int16; + #else + #ifdef HAVE_16BITINT + typedef signed int int16; + #else + #error ERROR: Couldn't find a 16 bit integer to use + #endif + #endif + #endif +#endif + + #ifdef HAVE_UNISTD_H #include #endif diff --git a/src/list.c b/src/list.c index f93f3c0..97ac912 100644 --- a/src/list.c +++ b/src/list.c @@ -17,12 +17,6 @@ * Send bug reports to: */ -#include -#include -#include -#include -#include - #include "usuals.h" #include "drive.h" #include "ntfs.h" diff --git a/src/main.c b/src/main.c index 5cde040..b6156d0 100644 --- a/src/main.c +++ b/src/main.c @@ -17,13 +17,7 @@ * Send bug reports to: */ -#include -#include -#include -#include -#include -#include - +#include "usuals.h" #include "scrounge.h" #include "compat.h" diff --git a/src/misc.c b/src/misc.c index 0bb65ac..0778467 100644 --- a/src/misc.c +++ b/src/misc.c @@ -17,11 +17,6 @@ * Send bug reports to: */ -#include -#include -#include -#include - #include "usuals.h" #include "compat.h" #include "memref.h" diff --git a/src/ntfsx.c b/src/ntfsx.c index a3209e1..5d9a526 100644 --- a/src/ntfsx.c +++ b/src/ntfsx.c @@ -17,11 +17,6 @@ * Send bug reports to: */ -#include -#include -#include -#include - #include "scrounge.h" #include "memref.h" #include "ntfs.h" diff --git a/src/scrounge.c b/src/scrounge.c index 66297a8..8baf688 100644 --- a/src/scrounge.c +++ b/src/scrounge.c @@ -17,12 +17,7 @@ * Send bug reports to: */ -#include -#include -#include -#include -#include - +#include "usuals.h" #include "scrounge.h" #include "ntfs.h" #include "ntfsx.h" diff --git a/src/search.c b/src/search.c index 4ab9823..2d9ee35 100644 --- a/src/search.c +++ b/src/search.c @@ -18,7 +18,7 @@ */ -#include +#include "usuals.h" #include "drive.h" void scroungeSearch(partitioninfo* pi) diff --git a/src/unicode.c b/src/unicode.c index a8fc612..ea64574 100644 --- a/src/unicode.c +++ b/src/unicode.c @@ -1,9 +1,7 @@ +#include "usuals.h" #include -#include -#include "sablo.h" - /* * Transcode UCS2 to UTF8. * diff --git a/src/usuals.h b/src/usuals.h index 0697956..699adb3 100644 --- a/src/usuals.h +++ b/src/usuals.h @@ -20,18 +20,33 @@ #ifndef __USUALS_H__ #define __USUALS_H__ -#include "debug.h" -#include "compat.h" +#include + +#ifdef _WIN32 + #include <../config.win32.h> +#else + #include <../config.h> +#endif + +#ifdef HAVE_IO_H +#include +#endif + +#include +#include +#include #include -typedef unsigned __int64 uint64; -typedef unsigned long uint32; -typedef unsigned short uint16; -typedef unsigned char byte; +#ifdef HAVE_STRING_H +#include +#endif + +#ifdef _WIN32 +#include +#endif -typedef signed __int64 int64; -typedef signed long int32; -typedef signed short int16; +#include "debug.h" +#include "compat.h" #ifndef NULL #define NULL 0 @@ -46,7 +61,6 @@ typedef signed short int16; #define HIGHDWORD(i64) (DWORD)((i64) >> 32) #define LOWDWORD(i64) (DWORD)((i64) & 0xFFFFFFFF) - #define INTERSECTS(b1, e1, b2, e2) \ ((b1) < (e2) && (e1) > (b2)) -- cgit v1.2.3