]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - common.h
added GAME_FNIGGIUM and GAME_SETHERAL
[xonotic/darkplaces.git] / common.h
index dad626ca71ebf8e339cf7274d0bcbfb99297fe54..e30c140303e2ad7b223b628bd0b1af609651b9e9 100644 (file)
--- a/common.h
+++ b/common.h
@@ -170,17 +170,20 @@ extern    struct cvar_s   registered;
 #define GAME_TEU 7
 #define GAME_BATTLEMECH 8
 #define GAME_ZYMOTIC 9
+#define GAME_FNIGGIUM 10
+#define GAME_SETHERAL 11
 
 extern int gamemode;
 extern char *gamename;
 extern char *gamedirname;
 extern char com_modname[MAX_OSPATH];
 
-// LordHavoc: useful...
-void COM_ToLowerString(const char *in, char *out);
-void COM_ToUpperString(const char *in, char *out);
+void COM_ToLowerString (const char *in, char *out, size_t size_out);
+void COM_ToUpperString (const char *in, char *out, size_t size_out);
 int COM_StringBeginsWith(const char *s, const char *match);
 
+int COM_ReadAndTokenizeLine(const char **text, char **argv, int maxargc, char *tokenbuf, int tokenbufsize, const char *commentprefix);
+
 typedef struct stringlist_s
 {
        struct stringlist_s *next;
@@ -193,5 +196,28 @@ void freedirectory(stringlist_t *list);
 
 char *SearchInfostring(const char *infostring, const char *key);
 
+
+// strlcat and strlcpy, from OpenBSD
+// Most (all?) BSDs already have them
+#if !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__FreeBSD__)
+
+/*
+ * Appends src to string dst of size siz (unlike strncat, siz is the
+ * full size of dst, not space left).  At most siz-1 characters
+ * will be copied.  Always NUL terminates (unless siz <= strlen(dst)).
+ * Returns strlen(src) + MIN(siz, strlen(initial dst)).
+ * If retval >= siz, truncation occurred.
+ */
+size_t strlcat(char *dst, const char *src, size_t siz);
+
+/*
+ * Copy src to string dst of size siz.  At most siz-1 characters
+ * will be copied.  Always NUL terminates (unless siz == 0).
+ * Returns strlen(src); if retval >= siz, truncation occurred.
+ */
+size_t strlcpy(char *dst, const char *src, size_t siz);
+
+#endif  // #if !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__FreeBSD__)
+
 #endif