Skip to content
Permalink
Browse files
Initial SWIG work.
  • Loading branch information
icculus committed Jan 29, 2010
1 parent aa71266 commit a09a54d0f29b90aafb2d25846eb8d9eabd69e470
Showing with 29 additions and 0 deletions.
  1. +29 −0 src/physfs.h
@@ -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 @@ typedef signed long long PHYSFS_sint64;
#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 @@ PHYSFS_COMPILE_TIME_ASSERT(sint64, sizeof(PHYSFS_sint64) == 8);
#undef PHYSFS_COMPILE_TIME_ASSERT

#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
#endif /* SWIG */


/**
@@ -412,6 +423,10 @@ typedef struct PHYSFS_Version
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 @@ typedef struct PHYSFS_Version
(x)->patch = PHYSFS_VER_PATCH; \
}

#endif /* SWIG */


/**
* \fn void PHYSFS_getLinkedVersion(PHYSFS_Version *ver)
@@ -1373,6 +1390,8 @@ PHYSFS_DECL int PHYSFS_flush(PHYSFS_File *handle);

/* 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_sint64 PHYSFS_swapSBE64(PHYSFS_sint64 val);
*/
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_isInit(void);
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 @@ typedef struct PHYSFS_Allocator
*/
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 int PHYSFS_mount(const char *newDir,
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 void PHYSFS_utf8FromLatin1(const char *src, char *dst,
*/
PHYSFS_DECL const PHYSFS_Allocator *PHYSFS_getAllocator(void);

#endif /* SWIG */


/* Everything above this line is part of the PhysicsFS 2.1 API. */

0 comments on commit a09a54d

Please sign in to comment.