Store git version string to a C file, not a header.
[srvx.git] / src / saxdb.c
index 6439af0dfac95daa15621275363e6b8cf60edae6..8de664999f4116a6907c263fffc959ba7ffded51 100644 (file)
@@ -236,7 +236,7 @@ saxdb_pre_object(struct saxdb_context *dest) {
     }
 }
 #else
-#define saxdb_pre_object(DEST) 
+#define saxdb_pre_object(DEST)
 #endif
 
 static inline void
@@ -302,6 +302,14 @@ saxdb_write_int(struct saxdb_context *dest, const char *name, unsigned long valu
     saxdb_write_string(dest, name, buf);
 }
 
+void
+saxdb_write_sint(struct saxdb_context *dest, const char *name, long value) {
+    char buf[16];
+    /* we could optimize this to take advantage of the fact that buf will never need escapes */
+    snprintf(buf, sizeof(buf), "%ld", value);
+    saxdb_write_string(dest, name, buf);
+}
+
 static void
 saxdb_free(void *data) {
     struct saxdb *db = data;