Initial SWIG work.
authorRyan C. Gordon <icculus@icculus.org>
Fri, 29 Jan 2010 04:17:44 -0500
changeset 1026 1648054f2986
parent 1025 b91967e1dc40
child 1027 3ab4702d6313
Initial SWIG work.
src/physfs.h
--- a/src/physfs.h	Fri Jan 29 03:18:03 2010 -0500
+++ b/src/physfs.h	Fri Jan 29 04:17:44 2010 -0500
@@ -212,12 +212,21 @@
 #ifndef _INCLUDE_PHYSFS_H_
 #define _INCLUDE_PHYSFS_H_
 
+#ifdef SWIG
+%module physfs
+%{
+#include "physfs.h"
+%}
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 #if defined(PHYSFS_DECL)
 /* do nothing. */
+#elif (defined SWIG)
+#define PHYSFS_DECL extern
 #elif (defined _MSC_VER)
 #define PHYSFS_DECL __declspec(dllexport)
 #elif (defined __SUNPRO_C)
@@ -303,6 +312,7 @@
 #endif
 
 
+#ifndef SWIG
 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
 /* Make sure the types really have the right sizes */
 #define PHYSFS_COMPILE_TIME_ASSERT(name, x)               \
@@ -323,6 +333,7 @@
 #undef PHYSFS_COMPILE_TIME_ASSERT
 
 #endif  /* DOXYGEN_SHOULD_IGNORE_THIS */
+#endif  /* SWIG */
 
 
 /**
@@ -412,6 +423,10 @@
     PHYSFS_uint8 patch; /**< patchlevel */
 } PHYSFS_Version;
 
+
+
+#ifndef SWIG  /* not available from scripting languages. */
+
 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
 #define PHYSFS_VER_MAJOR 2
 #define PHYSFS_VER_MINOR 1
@@ -444,6 +459,8 @@
     (x)->patch = PHYSFS_VER_PATCH; \
 }
 
+#endif  /* SWIG */
+
 
 /**
  * \fn void PHYSFS_getLinkedVersion(PHYSFS_Version *ver)
@@ -1373,6 +1390,8 @@
 
 /* Byteorder stuff... */
 
+#ifndef SWIG  /* not available from scripting languages. */
+
 /**
  * \fn PHYSFS_sint16 PHYSFS_swapSLE16(PHYSFS_sint16 val)
  * \brief Swap littleendian signed 16 to platform's native byte order.
@@ -1537,6 +1556,8 @@
  */
 PHYSFS_DECL PHYSFS_uint64 PHYSFS_swapUBE64(PHYSFS_uint64 val);
 
+#endif  /* SWIG */
+
 
 /**
  * \fn int PHYSFS_readSLE16(PHYSFS_File *file, PHYSFS_sint16 *val)
@@ -1972,6 +1993,8 @@
 PHYSFS_DECL int PHYSFS_symbolicLinksPermitted(void);
 
 
+#ifndef SWIG  /* not available from scripting languages. */
+
 /**
  * \struct PHYSFS_Allocator
  * \brief PhysicsFS allocation function pointers.
@@ -2031,6 +2054,8 @@
  */
 PHYSFS_DECL int PHYSFS_setAllocator(const PHYSFS_Allocator *allocator);
 
+#endif  /* SWIG */
+
 
 /**
  * \fn int PHYSFS_mount(const char *newDir, const char *mountPoint, int appendToPath)
@@ -2101,6 +2126,8 @@
 PHYSFS_DECL const char *PHYSFS_getMountPoint(const char *dir);
 
 
+#ifndef SWIG  /* not available from scripting languages. */
+
 /**
  * \typedef PHYSFS_StringCallback
  * \brief Function signature for callbacks that report strings.
@@ -2440,6 +2467,8 @@
  */
 PHYSFS_DECL const PHYSFS_Allocator *PHYSFS_getAllocator(void);
 
+#endif  /* SWIG */
+
 
 /* Everything above this line is part of the PhysicsFS 2.1 API. */