From 648b23aa61f7523c4ad296303f9f70f8c1bb15bf Mon Sep 17 00:00:00 2001 From: francis Date: Fri, 22 Sep 2006 13:57:00 +0000 Subject: 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 --- tileserver/netstring.c | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 tileserver/netstring.c (limited to 'tileserver/netstring.c') 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 -#include -#include - -/* 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); -} -- cgit v1.2.3