initial load of upstream version 1.06.32
[xmlrpc-c] / lib / abyss / src / token.c
diff --git a/lib/abyss/src/token.c b/lib/abyss/src/token.c
new file mode 100644 (file)
index 0000000..8616b95
--- /dev/null
@@ -0,0 +1,54 @@
+#include "xmlrpc-c/abyss.h"
+
+#include "token.h"
+
+void
+NextToken(const char ** const pP) {
+
+    abyss_bool gotToken;
+
+    gotToken = FALSE;
+
+    while (!gotToken) {
+        switch (**pP) {
+        case '\t':
+        case ' ':
+            ++(*pP);
+            break;
+        default:
+            gotToken = TRUE;
+        };
+    }
+}
+
+
+
+char *
+GetToken(char ** const pP) {
+
+    char * p0;
+        
+    p0 = *pP;
+
+    while (1) {
+        switch (**pP) {
+        case '\t':
+        case ' ':
+        case CR:
+        case LF:
+        case '\0':
+            if (p0 == *pP)
+                return NULL;
+
+            if (**pP) {
+                **pP = '\0';
+                ++(*pP);
+            };
+            return p0;
+
+        default:
+            ++(*pP);
+        };
+    }
+}
+