taskrambler  v0.1.8
Web server and task management solution.
message.c File Reference
#include <search.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <unistd.h>
#include "class.h"
#include "hash.h"
#include "http/message.h"
#include "utils/memory.h"
+ Include dependency graph for message.c:

Go to the source code of this file.

Macros

#define _GNU_SOURCE
 

Functions

static int httpMessageCtor (void *_this, va_list *params)
 
static void httpMessageDtor (void *_this)
 
 INIT_IFACE (Class, httpMessageCtor, httpMessageDtor, NULL)
 
 CREATE_CLASS (HttpMessage, NULL, IFACE(Class))
 

Detailed Description

Author
Georg Hopp

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file message.c.

Macro Definition Documentation

#define _GNU_SOURCE

Definition at line 24 of file message.c.

Function Documentation

CREATE_CLASS ( HttpMessage  ,
NULL  ,
IFACE(Class)   
)
static int httpMessageCtor ( void *  _this,
va_list *  params 
)
static

Definition at line 41 of file message.c.

References memCalloc().

42 {
43  HttpMessage this = _this;
44  char * version = va_arg(* params, char *);
45 
46  this->version = memCalloc(1, strlen(version)+1);
47  strcpy(this->version, version);
48 
49  this->header = new(Hash);
50 
51  return 0;
52 }
void * memCalloc(size_t, size_t)
Definition: memory.c:818

+ Here is the call graph for this function:

static void httpMessageDtor ( void *  _this)
static

Definition at line 56 of file message.c.

References assetPoolRelease(), and MEM_FREE.

57 {
58  HttpMessage this = _this;
59 
60  delete(this->header);
61 
62  MEM_FREE(this->version);
63 
64  if (NULL == this->asset) {
65  MEM_FREE(this->body);
66  } else {
67  assetPoolRelease(this->asset);
68  this->asset = NULL;
69  this->body = NULL;
70  }
71 }
size_t assetPoolRelease(Asset)
Definition: pool.c:66
#define MEM_FREE(seg)
Definition: memory.h:28

+ Here is the call graph for this function:

INIT_IFACE ( Class  ,
httpMessageCtor  ,
httpMessageDtor  ,
NULL   
)