]> gitweb.ps.run Git - matrix_esp_thesis/blobdiff - src/fixedbuffer.c
olm session management
[matrix_esp_thesis] / src / fixedbuffer.c
diff --git a/src/fixedbuffer.c b/src/fixedbuffer.c
deleted file mode 100644 (file)
index ad99897..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#include "fixedbuffer.h"\r
-\r
-#include <string.h>\r
-\r
-FixedBuffer\r
-FixedBuf(const char * str)\r
-{\r
-    int len = strlen(str);\r
-    FixedBuffer result;\r
-    result.ptr = (char *)str;\r
-    result.cap = len;\r
-    result.len = len;\r
-    return result;\r
-}\r
-\r
-bool\r
-FixedBufferToInt(FixedBuffer fb, int * outInt)\r
-{\r
-    bool valid = false;\r
-    int result = 0;\r
-\r
-    bool negative = false;\r
-\r
-    for (int i = 0; i < fb.len; i++)\r
-    {\r
-        if (i == 0 && fb.ptr[i] == '-')\r
-        {\r
-            negative = true;\r
-            continue;\r
-        }\r
-\r
-        int val = fb.ptr[i] - '0';\r
-        if (val < 0 || val > 9)\r
-            return false;\r
-\r
-        result *= 10;\r
-        result += val;\r
-        valid = true;\r
-    }\r
-\r
-    *outInt = result;\r
-    return valid;\r
-}
\ No newline at end of file