taskrambler  0.1.8
Web server and task management solution.
router.c File Reference
#include <stdarg.h>
#include <dlfcn.h>
#include "class.h"
#include "router.h"
#include "hash.h"
#include "application/application.h"
+ Include dependency graph for router.c:

Go to the source code of this file.

Macros

#define PREFIX   "controller"
 

Functions

static int routerCtor (void *_this, va_list *params)
 
static void routerDtor (void *_this)
 
 INIT_IFACE (Class, routerCtor, routerDtor, NULL)
 
 CREATE_CLASS (Router, 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 router.c.

Macro Definition Documentation

#define PREFIX   "controller"

Definition at line 33 of file router.c.

Referenced by routerCtor().

Function Documentation

CREATE_CLASS ( Router  ,
NULL  ,
IFACE(Class)   
)
INIT_IFACE ( Class  ,
routerCtor  ,
routerDtor  ,
NULL   
)
static int routerCtor ( void *  _this,
va_list *  params 
)
static

Definition at line 37 of file router.c.

References PREFIX.

38 {
39  Router this = _this;
40 
41  this->application = va_arg(*params, Application);
42  this->functions = new(Hash);
43  this->handle = dlopen(NULL, RTLD_LAZY);
44  this->prefix = PREFIX;
45  this->nprefix = sizeof(PREFIX) - 1;
46 
47  if (NULL == this->handle) {
48  return -1;
49  }
50 
51  return 0;
52 }
#define PREFIX
Definition: router.c:33
static void routerDtor ( void *  _this)
static

Definition at line 56 of file router.c.

56  {
57  Router this = _this;
58 
59  delete(this->functions);
60  dlclose(this->handle);
61 }