Current News
Archived News
Search News
Discussion Forum


Old Forum
Install Programs More Downloads...
Troubleshooting
Source Code
Format Specs.
Misc. Information
Non-SF Stuff
Links




ShadowFlare [Mon, 14 Mar 2011 12:22:19 +0000 (06:22 -0600)]
.gitignore
SFmpqapi.cpp
linux/SFmpqapi.cbp [new file with mode: 0644]
linux/SFmpqapi.workspace [new file with mode: 0644]
linux/poppack.h [new file with mode: 0644]
linux/pshpack1.h [new file with mode: 0644]
linux/windows.cpp
linux/windows.h

index 9fd747f..df512b6 100644 (file)
@@ -1,5 +1,8 @@
 *Debug/
 *Release/
+.directory
+*.depend
+*.layout
 *.ncb
 *.opt
 *.plg
index 628d29f..863042e 100644 (file)
@@ -1102,7 +1102,7 @@ DWORD SFMPQAPI WINAPI SFileGetFileInfo(MPQHANDLE hFile, DWORD dwInfoType)
        return (DWORD)-1;
 }
 
-DWORD SFMPQAPI WINAPI SFileSetFilePointer(MPQHANDLE hFile, long lDistanceToMove, PLONG lplDistanceToMoveHigh, DWORD dwMoveMethod)
+DWORD SFMPQAPI WINAPI SFileSetFilePointer(MPQHANDLE hFile, LONG lDistanceToMove, PLONG lplDistanceToMoveHigh, DWORD dwMoveMethod)
 {
        if (!hFile) {
                SetLastError(ERROR_INVALID_PARAMETER);
@@ -1154,7 +1154,7 @@ BOOL SFMPQAPI WINAPI SFileReadFile(MPQHANDLE hFile,LPVOID lpBuffer,DWORD nNumber
        }
        if (lpOverlapped)
                if (lpOverlapped->Internal || lpOverlapped->InternalHigh || lpOverlapped->Offset || lpOverlapped->OffsetHigh || lpOverlapped->hEvent)
-                       SFileSetFilePointer(hFile,lpOverlapped->Offset,(long *)&lpOverlapped->OffsetHigh,FILE_BEGIN);
+                       SFileSetFilePointer(hFile,lpOverlapped->Offset,(LONG *)&lpOverlapped->OffsetHigh,FILE_BEGIN);
        if (nNumberOfBytesToRead==0) {
                if (lpNumberOfBytesRead) *lpNumberOfBytesRead = 0;
                if (lpOverlapped) lpOverlapped->InternalHigh = 0;
diff --git a/linux/SFmpqapi.cbp b/linux/SFmpqapi.cbp
new file mode 100644 (file)
index 0000000..3550617
--- /dev/null
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_project_file>
+       <FileVersion major="1" minor="6" />
+       <Project>
+               <Option title="SFmpqapi" />
+               <Option pch_mode="2" />
+               <Option compiler="gcc" />
+               <Build>
+                       <Target title="Debug">
+                               <Option output="bin/Debug/libSFmpqapi" prefix_auto="1" extension_auto="1" />
+                               <Option object_output="obj/Debug/" />
+                               <Option type="3" />
+                               <Option compiler="gcc" />
+                               <Option createDefFile="1" />
+                               <Option createStaticLib="1" />
+                               <Compiler>
+                                       <Add option="-g" />
+                                       <Add option="-D__SYS_ZLIB" />
+                                       <Add option="-D__SYS_BZLIB" />
+                                       <Add directory="./" />
+                               </Compiler>
+                       </Target>
+                       <Target title="Release">
+                               <Option output="bin/Release/libSFmpqapi" prefix_auto="1" extension_auto="1" />
+                               <Option object_output="obj/Release/" />
+                               <Option type="3" />
+                               <Option compiler="gcc" />
+                               <Option createDefFile="1" />
+                               <Option createStaticLib="1" />
+                               <Compiler>
+                                       <Add option="-O2" />
+                                       <Add option="-D__SYS_ZLIB" />
+                                       <Add option="-D__SYS_BZLIB" />
+                                       <Add directory="./" />
+                               </Compiler>
+                               <Linker>
+                                       <Add option="-s" />
+                               </Linker>
+                       </Target>
+               </Build>
+               <Compiler>
+                       <Add option="-Wall" />
+               </Compiler>
+               <Unit filename="../../SComp/SComp.cpp" />
+               <Unit filename="../../SComp/SComp.h" />
+               <Unit filename="../../SComp/SErr.cpp" />
+               <Unit filename="../../SComp/SErr.h" />
+               <Unit filename="../../SComp/SMem.cpp" />
+               <Unit filename="../../SComp/SMem.h" />
+               <Unit filename="../../SComp/crc32.c">
+                       <Option compilerVar="CC" />
+               </Unit>
+               <Unit filename="../../SComp/explode.c">
+                       <Option compilerVar="CC" />
+               </Unit>
+               <Unit filename="../../SComp/huffman.cpp" />
+               <Unit filename="../../SComp/huffman.h" />
+               <Unit filename="../../SComp/implode.c">
+                       <Option compilerVar="CC" />
+               </Unit>
+               <Unit filename="../../SComp/pklib.h" />
+               <Unit filename="../../SComp/wave.cpp" />
+               <Unit filename="../../SComp/wave.h" />
+               <Unit filename="../../SComp/wintypes.h" />
+               <Unit filename="../MpqBlockTable.cpp" />
+               <Unit filename="../MpqBlockTable.h" />
+               <Unit filename="../MpqCrypt.cpp" />
+               <Unit filename="../MpqCrypt.h" />
+               <Unit filename="../MpqHashTable.cpp" />
+               <Unit filename="../MpqHashTable.h" />
+               <Unit filename="../SFTypes.h" />
+               <Unit filename="../SFUtil.cpp" />
+               <Unit filename="../SFUtil.h" />
+               <Unit filename="../SFmpqapi.cpp" />
+               <Unit filename="../SFmpqapi.h" />
+               <Unit filename="windows.cpp" />
+               <Unit filename="windows.h" />
+               <Extensions>
+                       <code_completion />
+                       <debugger />
+                       <envvars />
+               </Extensions>
+       </Project>
+</CodeBlocks_project_file>
diff --git a/linux/SFmpqapi.workspace b/linux/SFmpqapi.workspace
new file mode 100644 (file)
index 0000000..b231451
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
+<CodeBlocks_workspace_file>
+       <Workspace title="Workspace">
+               <Project filename="SFmpqapi.cbp" active="1" />
+       </Workspace>
+</CodeBlocks_workspace_file>
diff --git a/linux/poppack.h b/linux/poppack.h
new file mode 100644 (file)
index 0000000..65898b5
--- /dev/null
@@ -0,0 +1 @@
+#pragma pack(pop)
diff --git a/linux/pshpack1.h b/linux/pshpack1.h
new file mode 100644 (file)
index 0000000..1d81e3f
--- /dev/null
@@ -0,0 +1 @@
+#pragma pack(push,1)
index e9329e2..815f8ab 100644 (file)
@@ -157,14 +157,14 @@ char * strupr(char *lpString)
        return lpString;
 }
 
-char * strdup(const char *lpString)
+/*char * strdup(const char *lpString)
 {
        if (lpString==0) return 0;
        char *lpStrCopy = (char *)malloc(strlen(lpString)+1);
        if (lpStrCopy==0) return 0;
        strcpy(lpStrCopy,lpString);
        return lpStrCopy;
-}
+}*/
 
 int memicmp(const char *lpString1, const char *lpString2, size_t dwSize)
 {
index a4ace25..f377310 100644 (file)
@@ -9,6 +9,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 #include <sys/stat.h>
+#include <stdint.h>
 
 #define LINUX_PORT
 
@@ -21,21 +22,20 @@ extern "C" {
 #define __stdcall
 #define WINAPI __stdcall
 #define APIENTRY __stdcall
-#define __declspec(dllimport)
-#define __declspec(dllexport)
+#define __declspec(x)
 #define __inline inline
 #define __forceinline inline
 
 #define CONST const
 
 // Type defines
-typedef unsigned char BYTE;
-typedef unsigned short int WORD;
-typedef unsigned long int DWORD;
-typedef short int SHORT;
-typedef unsigned short int USHORT;
+typedef uint8_t BYTE;
+typedef uint16_t WORD;
+typedef uint32_t DWORD;
+typedef int16_t SHORT;
+typedef uint16_t USHORT;
 typedef DWORD LCID;
-typedef long int LONG;
+typedef int32_t LONG;
 typedef LONG * PLONG;
 typedef int BOOL;
 typedef void * LPVOID;
@@ -67,6 +67,8 @@ typedef struct _SECURITY_ATTRIBUTES {
 #define TRUE 1
 #define MAX_PATH 260
 #define INVALID_HANDLE_VALUE ((HANDLE)-1)
+#define INVALID_FILE_SIZE ((DWORD)-1)
+#define INVALID_SET_FILE_POINTER ((DWORD)-1)
 #define DLL_PROCESS_ATTACH 1
 #define DLL_THREAD_ATTACH  2
 #define DLL_THREAD_DETACH  3
@@ -114,6 +116,7 @@ typedef struct _SECURITY_ATTRIBUTES {
 #define FILE_BEGIN           0
 #define FILE_CURRENT         1
 #define FILE_END             2
+#define NO_ERROR 0L
 #define ERROR_FILE_NOT_FOUND             2L
 #define ERROR_ACCESS_DENIED              5L
 #define ERROR_INVALID_PARAMETER          87L    // dderror
@@ -138,7 +141,7 @@ BOOL WINAPI DeleteFile(LPCSTR lpFileName);
 // Declarations for C runtime functions
 char * strlwr(char *lpString);
 char * strupr(char *lpString);
-char * strdup(const char *lpString);
+//char * strdup(const char *lpString);
 #define stricmp strcasecmp
 #define strnicmp strncasecmp
 int memicmp(const char *lpString1, const char *lpString2, size_t dwSize);