summaryrefslogtreecommitdiff
path: root/src/qcommon/q_shared.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qcommon/q_shared.h')
-rw-r--r--src/qcommon/q_shared.h82
1 files changed, 50 insertions, 32 deletions
diff --git a/src/qcommon/q_shared.h b/src/qcommon/q_shared.h
index 84e2c2b4..b325b49a 100644
--- a/src/qcommon/q_shared.h
+++ b/src/qcommon/q_shared.h
@@ -28,16 +28,14 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// A user mod should never modify this file
#define PRODUCT_NAME "tremulous"
-#define PRODUCT_VERSION "1.1.0"
-#ifdef SVN_VERSION
-# define Q3_VERSION PRODUCT_NAME " " SVN_VERSION
-#else
-# define Q3_VERSION PRODUCT_NAME " " PRODUCT_VERSION
+#ifdef _MSC_VER
+# define PRODUCT_VERSION "1.1.0"
#endif
#define CLIENT_WINDOW_TITLE "Tremulous " PRODUCT_VERSION
#define CLIENT_WINDOW_MIN_TITLE "Tremulous"
+#define Q3_VERSION PRODUCT_NAME " " PRODUCT_VERSION
#define MAX_TEAMNAME 32
@@ -90,9 +88,13 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
**********************************************************************/
+#ifdef Q3_VM
+
#include "../game/bg_lib.h"
-#ifndef Q3_VM
+typedef int intptr_t;
+
+#else
#include <assert.h>
#include <math.h>
@@ -104,30 +106,38 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#include <ctype.h>
#include <limits.h>
+// vsnprintf is ISO/IEC 9899:1999
+// abstracting this to make it portable
+#ifdef _WIN32
+ #define Q_vsnprintf _vsnprintf
+ #define Q_snprintf _snprintf
+#else
+ #define Q_vsnprintf vsnprintf
+ #define Q_snprintf snprintf
+#endif
+
+#ifdef _MSC_VER
+ #include <io.h>
+
+ typedef __int64 int64_t;
+ typedef __int32 int32_t;
+ typedef __int16 int16_t;
+ typedef __int8 int8_t;
+ typedef unsigned __int64 uint64_t;
+ typedef unsigned __int32 uint32_t;
+ typedef unsigned __int16 uint16_t;
+ typedef unsigned __int8 uint8_t;
+#else
+ #include <stdint.h>
#endif
+#endif
+
+
#include "q_platform.h"
//=============================================================
-#ifdef Q3_VM
- typedef int intptr_t;
-#else
- #ifndef _MSC_VER
- #include <stdint.h>
- #else
- #include <io.h>
- typedef __int64 int64_t;
- typedef __int32 int32_t;
- typedef __int16 int16_t;
- typedef __int8 int8_t;
- typedef unsigned __int64 uint64_t;
- typedef unsigned __int32 uint32_t;
- typedef unsigned __int16 uint16_t;
- typedef unsigned __int8 uint8_t;
- #endif
-#endif
-
typedef unsigned char byte;
typedef enum {qfalse, qtrue} qboolean;
@@ -727,6 +737,8 @@ int Q_isprint( int c );
int Q_islower( int c );
int Q_isupper( int c );
int Q_isalpha( int c );
+qboolean Q_isanumber( const char *s );
+qboolean Q_isintegral( float f );
// portable case insensitive compare
int Q_stricmp (const char *s1, const char *s2);
@@ -745,6 +757,8 @@ void Q_strcat( char *dest, int size, const char *src );
int Q_PrintStrlen( const char *string );
// removes color sequences from string
char *Q_CleanStr( char *string );
+// Count the number of char tocount encountered in string
+int Q_CountChar(const char *string, char tocount);
//=============================================
@@ -833,15 +847,19 @@ default values.
// nothing outside the Cvar_*() functions should modify these fields!
typedef struct cvar_s {
- char *name;
- char *string;
- char *resetString; // cvar_restart will reset to this value
- char *latchedString; // for CVAR_LATCH vars
- int flags;
+ char *name;
+ char *string;
+ char *resetString; // cvar_restart will reset to this value
+ char *latchedString; // for CVAR_LATCH vars
+ int flags;
qboolean modified; // set each time the cvar is changed
- int modificationCount; // incremented each time the cvar is changed
- float value; // atof( string )
- int integer; // atoi( string )
+ int modificationCount; // incremented each time the cvar is changed
+ float value; // atof( string )
+ int integer; // atoi( string )
+ qboolean validate;
+ qboolean integral;
+ float min;
+ float max;
struct cvar_s *next;
struct cvar_s *hashNext;
} cvar_t;