aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorEugene Sandulenko2016-08-01 00:27:28 +0300
committerGitHub2016-08-01 00:27:28 +0300
commit9d3a2c1c7f9365f65908f583e62047830f60693d (patch)
treed7ba49593a1e3d79f17b350e700b1fbcf71f5b22 /common
parent567054d8298a013f93dd9e0e332e2a08402b10a6 (diff)
parent19f8a0965be832a71a101054748cf000adf16add (diff)
downloadscummvm-rg350-9d3a2c1c7f9365f65908f583e62047830f60693d.tar.gz
scummvm-rg350-9d3a2c1c7f9365f65908f583e62047830f60693d.tar.bz2
scummvm-rg350-9d3a2c1c7f9365f65908f583e62047830f60693d.zip
Merge pull request #786 from dreammaster/titanic
TITANIC: Starship Titanic engine
Diffstat (limited to 'common')
-rw-r--r--common/util.cpp7
-rw-r--r--common/util.h11
2 files changed, 18 insertions, 0 deletions
diff --git a/common/util.cpp b/common/util.cpp
index 8e0a2fd61f..62a1baf6ac 100644
--- a/common/util.cpp
+++ b/common/util.cpp
@@ -28,6 +28,7 @@
#define FORBIDDEN_SYMBOL_EXCEPTION_isspace
#define FORBIDDEN_SYMBOL_EXCEPTION_isupper
#define FORBIDDEN_SYMBOL_EXCEPTION_isprint
+#define FORBIDDEN_SYMBOL_EXCEPTION_ispunct
#include "common/util.h"
@@ -150,4 +151,10 @@ bool isPrint(int c) {
ENSURE_ASCII_CHAR(c);
return isprint((byte)c);
}
+
+bool isPunct(int c) {
+ ENSURE_ASCII_CHAR(c);
+ return ispunct((byte)c);
+}
+
} // End of namespace Common
diff --git a/common/util.h b/common/util.h
index f51aa00925..1f635f3654 100644
--- a/common/util.h
+++ b/common/util.h
@@ -177,6 +177,17 @@ bool isUpper(int c);
* @return true if the character is printable, false otherwise.
*/
bool isPrint(int c);
+
+
+/**
+ * Test whether the given character is a punctuation character,
+ * (i.e not alphanumeric.
+ *
+ * @param c the character to test
+ * @return true if the character is punctuation, false otherwise.
+ */
+bool isPunct(int c);
+
} // End of namespace Common
#endif