string.h
changeset 4299 b86602eaaff1
parent 4200 a45420ba0c23
child 4300 687a17c9c557
--- a/string.h	Sat Aug 19 09:23:48 2006 +0000
+++ b/string.h	Sat Aug 19 09:31:22 2006 +0000
@@ -32,16 +32,16 @@
 /** Convert the given string to lowercase */
 void strtolower(char *str);
 
+typedef enum CharSetFilter {  //valid char filtering
+	CS_ALPHANUMERAL,   //both numeric and alphabetic
+	CS_NUMERAL,        //only numeric ones.
+	CS_ALPHA,          //only alphabetic values
+} CharSetFilter;
+
 /** Only allow valid ascii-function codes. Filter special codes like BELL and
  * so on [we need a special filter here later]
  * @param key character to be checked
  * @return true or false depending if the character is printable/valid or not */
-static inline bool IsValidAsciiChar(byte key)
-{
-	// XXX This filter stops certain crashes, but may be too restrictive.
-	return (key >= ' ' && key < 127) || (key >= 160 &&
-		key != 0xAA && key != 0xAC && key != 0xAD && key != 0xAF &&
-		key != 0xB5 && key != 0xB6 && key != 0xB7 && key != 0xB9);
-}
+bool IsValidAsciiChar(byte key, CharSetFilter afilter);
 
 #endif /* STRING_H */