server 0.0.1
basicserverinfrastructure

src/http/request.c

Go to the documentation of this file.
00001 #include <stdlib.h>
00002 #include <stdarg.h>
00003 
00004 #include "class.h"
00005 #include "interface/class.h"
00006 
00007 #include "http/request.h"
00008 
00009 static
00010 void
00011 _free(void ** data)
00012 {
00013         if (NULL != *data) {
00014                 free(*data);
00015         }
00016 }
00017 
00018 static
00019 void
00020 ctor(void * _this, va_list * params) {}
00021 
00022 static
00023 void
00024 dtor(void * _this)
00025 {
00026         HttpRequest this = _this;
00027         int         i;
00028 
00029         _free((void **)&(this->http_version));
00030         _free((void **)&(this->uri));
00031         _free((void **)&(this->method));
00032 
00033         for (i=0; i<128; i++) {
00034                 _free((void **)&((this->header)[i].name));
00035                 _free((void **)&((this->header)[i].value));
00036         }
00037 
00038         _free((void **)&(this->body));
00039 } 
00040 
00041 INIT_IFACE(Class, ctor, dtor, NULL);
00042 CREATE_CLASS(HttpRequest, NULL, IFACE(Class));
00043 
00044 // vim: set ts=4 sw=4:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines