Server 0.0.1
HTTP/REST server implementation

src/http/header/to_string.c

Go to the documentation of this file.
00001 
00024 #include <string.h>
00025 
00026 #include "http/header.h"
00027 
00028 size_t
00029 httpHeaderToString(HttpHeader header, char * string)
00030 {
00031         size_t size = header->size;
00032         int    i;
00033 
00034         for (i=0; i<header->cvalue; i++) {
00035                 memcpy(string, header->name, header->nname);
00036                 string += header->nname;
00037 
00038                 *string++ = ':';
00039                 *string++ = ' ';
00040 
00041                 memcpy(string, header->value[i], header->nvalue[i]);
00042                 string += header->nvalue[i];
00043 
00044                 *string++ = '\r';
00045                 *string++ = '\n';
00046         }
00047 
00048         return size;
00049 }
00050 
00051 // vim: set ts=4 sw=4:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines