aboutsummaryrefslogtreecommitdiffstats
path: root/tileserver/netstring.c
diff options
context:
space:
mode:
authorfrancis <francis>2006-09-22 13:57:00 +0000
committerfrancis <francis>2006-09-22 13:57:00 +0000
commit648b23aa61f7523c4ad296303f9f70f8c1bb15bf (patch)
tree52af5553a05957795e04ae12ff6ac5901656960b /tileserver/netstring.c
parentb65558eac2e214c138c5887f0fd94249ec7f598c (diff)
Create TilMa service (for mapping tiles).
Move map tile stuff to appropriate places: - pnmtilesplit into its own project, as is standalone - tileserver and maketiles into TilMa
Diffstat (limited to 'tileserver/netstring.c')
-rw-r--r--tileserver/netstring.c44
1 files changed, 0 insertions, 44 deletions
diff --git a/tileserver/netstring.c b/tileserver/netstring.c
deleted file mode 100644
index f6bbc3b72..000000000
--- a/tileserver/netstring.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * netstring.c:
- * Write netstrings to strings.
- *
- * Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
- * Email: chris@mysociety.org; WWW: http://www.mysociety.org/
- *
- */
-
-static const char rcsid[] = "$Id: netstring.c,v 1.2 2006-09-20 13:24:08 chris Exp $";
-
-#include <sys/types.h>
-#include <stdio.h>
-#include <string.h>
-
-/* netstring_write OUT BUFFER LEN
- * Write the LEN-byte BUFFER to OUT as a netstring, returning the number of
- * bytes. If OUT is NULL, returns the number of bytes required. */
-size_t netstring_write(char *out, const void *buf, const size_t len) {
- size_t l = 0;
- char dummy[32];
- l += sprintf(out ? out : dummy, "%u:", (unsigned)len);
- if (out) memcpy(out + l, buf, len);
- l += len;
- if (out) out[l] = ',';
- ++l;
- return l;
-}
-
-/* netstring_write_string OUT STRING
- * Write the NUL-terminated STRING to OUT as a netstring, returning the number
- * of bytes used. If OUT is NULL, return the number of bytes required. */
-size_t netstring_write_string(char *out, const char *str) {
- return netstring_write(out, str, strlen(str));
-}
-
-/* netstring_write_string OUT I
- * Write I to OUT as a decimal integer formatted as a netstring, returning the
- * number of bytes used. If OUT is NULL, return the number of bytes required. */
-size_t netstring_write_int(char *out, const int i) {
- char str[32];
- sprintf(str, "%d", i);
- return netstring_write_string(out, str);
-}