2001-07-28 04:44:27 +00:00
|
|
|
#ifndef __FIXER_H__
|
|
|
|
#define __FIXER_H__
|
|
|
|
|
2001-07-29 03:12:22 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2001-07-28 04:44:27 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2001-07-29 20:57:33 +00:00
|
|
|
#include <limits.h>
|
2001-07-28 04:44:27 +00:00
|
|
|
#include <inttypes.h> // int64_t
|
|
|
|
|
|
|
|
#define PACKED __attribute__((packed))
|
|
|
|
|
|
|
|
#ifndef min
|
|
|
|
#define min(a, b) (((a) < (b)) ? (a) : (b))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef max
|
|
|
|
#define max(a, b) (((a) > (b)) ? (a) : (b))
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define __cdecl
|
|
|
|
|
|
|
|
#define TRUE 1
|
|
|
|
#define FALSE 0
|
|
|
|
|
|
|
|
#define stricmp strcasecmp
|
|
|
|
#define _stricmp strcasecmp
|
|
|
|
|
2001-07-28 23:13:49 +00:00
|
|
|
#define strnicmp strncasecmp
|
|
|
|
#define _strnicmp strncasecmp
|
|
|
|
|
|
|
|
#define lstrlen strlen
|
|
|
|
#define lstrcat strcat
|
|
|
|
|
|
|
|
#define _tcslen strlen
|
|
|
|
#define _tcscpy strcpy
|
|
|
|
|
|
|
|
/* #define _mbclen strlen */
|
|
|
|
size_t _mbclen(const unsigned char *s);
|
|
|
|
|
2001-08-12 02:30:17 +00:00
|
|
|
#define RGBA_MAKE(r, g, b, a) ((((a) << 24) | ((r) << 16) | ((g) << 8) | (b)))
|
2001-07-28 23:13:49 +00:00
|
|
|
|
2001-07-29 20:57:33 +00:00
|
|
|
#define MAX_PATH PATH_MAX
|
|
|
|
|
2001-08-05 05:51:56 +00:00
|
|
|
void FixFilename(char *str);
|
|
|
|
|
2001-07-28 04:44:27 +00:00
|
|
|
/* windows junk */
|
|
|
|
typedef int GUID;
|
|
|
|
typedef int DPID;
|
|
|
|
typedef int HINSTANCE;
|
|
|
|
typedef int WPARAM;
|
|
|
|
typedef int LPARAM;
|
|
|
|
typedef int HANDLE;
|
|
|
|
|
|
|
|
typedef int BOOL;
|
2001-07-28 23:13:49 +00:00
|
|
|
typedef unsigned char BYTE;
|
|
|
|
typedef unsigned short WORD;
|
|
|
|
typedef unsigned int DWORD;
|
|
|
|
typedef long LONG;
|
|
|
|
typedef char TCHAR;
|
2001-07-29 02:29:46 +00:00
|
|
|
typedef DWORD * LPDWORD;
|
|
|
|
typedef char * LPTSTR;
|
2001-07-28 23:13:49 +00:00
|
|
|
|
|
|
|
#define TEXT(x) x
|
2001-07-28 04:44:27 +00:00
|
|
|
|
|
|
|
typedef struct RECT
|
|
|
|
{
|
|
|
|
int left;
|
|
|
|
int top;
|
|
|
|
int right;
|
|
|
|
int bottom;
|
|
|
|
} RECT;
|
|
|
|
|
|
|
|
typedef RECT RECT_AVP;
|
|
|
|
|
|
|
|
typedef int64_t __int64;
|
|
|
|
|
|
|
|
typedef int FILETIME;
|
|
|
|
|
|
|
|
typedef struct SYSTEMTIME
|
|
|
|
{
|
|
|
|
//#warning "TODO: SYSTEMTIME format is not correct"
|
|
|
|
int wHour;
|
|
|
|
int wMinute;
|
|
|
|
int wSecond;
|
|
|
|
int wYear;
|
|
|
|
int wMonth;
|
|
|
|
int wDay;
|
|
|
|
} SYSTEMTIME;
|
2001-07-28 23:13:49 +00:00
|
|
|
|
2001-08-18 20:04:08 +00:00
|
|
|
#define VK_BACK 1
|
|
|
|
#define VK_END 2
|
|
|
|
#define VK_HOME 3
|
|
|
|
#define VK_LEFT 4
|
|
|
|
#define VK_UP 5
|
|
|
|
#define VK_RIGHT 6
|
|
|
|
#define VK_DOWN 7
|
|
|
|
#define VK_INSERT 8
|
|
|
|
#define VK_DELETE 9
|
|
|
|
#define VK_TAB 10
|
|
|
|
|
2001-07-29 20:57:33 +00:00
|
|
|
#define INVALID_HANDLE_VALUE -1
|
2001-08-05 05:51:56 +00:00
|
|
|
#define GENERIC_WRITE 0x0001
|
|
|
|
#define CREATE_ALWAYS 0x0002
|
|
|
|
#define FILE_FLAG_RANDOM_ACCESS 0x0004
|
|
|
|
#define GENERIC_READ 0x0008
|
|
|
|
#define OPEN_EXISTING 0x0010
|
|
|
|
#define FILE_ATTRIBUTE_READONLY 0x0020
|
|
|
|
#define FILE_CURRENT 0x0040
|
|
|
|
#define FILE_BEGIN 0x0080
|
|
|
|
#define FILE_END 0x0100
|
|
|
|
#define FILE_SHARE_READ 0x0200
|
|
|
|
#define FILE_ATTRIBUTE_DIRECTORY 0x0400
|
|
|
|
#define FILE_SHARE_WRITE 0x0800
|
|
|
|
#define OPEN_ALWAYS 0x1000
|
|
|
|
#define FILE_ATTRIBUTE_NORMAL 0x2000
|
|
|
|
|
2001-07-28 23:13:49 +00:00
|
|
|
|
|
|
|
HANDLE CreateFile(const char *file, int write, int x, int y, int flags, int flags2, int z);
|
|
|
|
HANDLE CreateFileA(const char *file, int write, int x, int y, int flags, int flags2, int z);
|
2001-08-03 05:30:40 +00:00
|
|
|
int WriteFile(HANDLE file, const void *data, int len, /* unsigned long */ void *byteswritten, int x);
|
2001-07-29 02:29:46 +00:00
|
|
|
int ReadFile(HANDLE file, void *data, int len, /* unsigned long */ void *bytesread, int x);
|
2001-07-28 23:13:49 +00:00
|
|
|
int GetFileSize(HANDLE file, int x);
|
|
|
|
int CloseHandle(HANDLE file);
|
|
|
|
int DeleteFile(const char *file);
|
|
|
|
int DeleteFileA(const char *file);
|
2001-07-29 20:57:33 +00:00
|
|
|
int GetDiskFreeSpace(int x, unsigned long *a, unsigned long *b, unsigned long *c, unsigned long *d);
|
2001-07-28 23:13:49 +00:00
|
|
|
int CreateDirectory(char *dir, int x);
|
|
|
|
int MoveFile(const char *newfile, const char *oldfile);
|
|
|
|
int MoveFileA(const char *newfile, const char *oldfile);
|
|
|
|
int CopyFile(const char *newfile, const char *oldfile, int x);
|
|
|
|
int GetFileAttributes(const char *file);
|
|
|
|
int GetFileAttributesA(const char *file);
|
|
|
|
int SetFilePointer(HANDLE file, int x, int y, int z);
|
|
|
|
int SetEndOfFile(HANDLE file);
|
|
|
|
|
2001-08-08 06:14:20 +00:00
|
|
|
unsigned int timeGetTime();
|
|
|
|
unsigned int GetTickCount();
|
|
|
|
|
2001-07-29 03:12:22 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
2001-07-28 04:44:27 +00:00
|
|
|
#endif
|