aboutsummaryrefslogtreecommitdiffstats
path: root/code/game
diff options
context:
space:
mode:
authortma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2007-09-21 12:33:50 +0000
committertma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2007-09-21 12:33:50 +0000
commit588850eea289baabb8b13fa7f79609b58474a403 (patch)
tree8da5c04fc31a9106ad716fb624f1b018cfbb4f9d /code/game
parentef3e7e01a2280c186da589404386ae3364b08a4a (diff)
downloadioquake3-aero-588850eea289baabb8b13fa7f79609b58474a403.tar.gz
ioquake3-aero-588850eea289baabb8b13fa7f79609b58474a403.zip
* (bug 3318) Restrict color escape characters to alphanumerics
git-svn-id: svn://svn.icculus.org/quake3/trunk@1185 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/game')
-rw-r--r--code/game/bg_lib.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/code/game/bg_lib.h b/code/game/bg_lib.h
index 9d2b623..1354951 100644
--- a/code/game/bg_lib.h
+++ b/code/game/bg_lib.h
@@ -60,6 +60,22 @@ typedef char * va_list;
#define LONG_MAX 2147483647L /* maximum (signed) long value */
#define ULONG_MAX 0xffffffffUL /* maximum unsigned long value */
+#define isalnum(c) (isalpha(c) || isdigit(c))
+#define isalpha(c) (isupper(c) || islower(c))
+#define isascii(c) ((c) > 0 && (c) <= 0x7f)
+#define iscntrl(c) (((c) >= 0) && (((c) <= 0x1f) || ((c) == 0x7f)))
+#define isdigit(c) ((c) >= '0' && (c) <= '9')
+#define isgraph(c) ((c) != ' ' && isprint(c)
+#define islower(c) ((c) >= 'a' && (c) <= 'z')
+#define isprint(c) ((c) >= ' ' && (c) <= '~')
+#define ispunct(c) (((c) > ' ' && (c) <= '~') && !isalnum(c))
+#define isspace(c) ((c) == ' ' || (c) == '\f' || (c) == '\n' || (c) == '\r' || \
+ (c) == '\t' || (c) == '\v')
+#define isupper(c) ((c) >= 'A' && (c) <= 'Z')
+#define isxdigit(c) (isxupper(c) || isxlower(c))
+#define isxlower(c) (isdigit(c) || (c >= 'a' && c <= 'f'))
+#define isxupper(c) (isdigit(c) || (c >= 'A' && c <= 'F'))
+
// Misc functions
typedef int cmp_t(const void *, const void *);
void qsort(void *a, size_t n, size_t es, cmp_t *cmp);