ant-http/libs/plugin.h

53 lines
847 B
C
Raw Normal View History

2017-07-29 22:00:34 +02:00
#ifndef PLUGIN_H
#define PLUGIN_H
#ifdef USE_DB
2015-10-22 11:39:11 +02:00
#include "dbhelper.h"
#endif
2017-07-29 23:54:43 +02:00
#include "ws.h"
2015-10-22 11:39:11 +02:00
typedef struct {
char *name;
char *dbpath;
char * htdocs;
char*pdir;
2017-07-29 22:00:34 +02:00
int sport;
2018-02-10 11:22:41 +01:00
#ifdef USE_OPENSSL
int usessl;
#endif
2015-10-22 11:39:11 +02:00
} plugin_header;
2018-09-26 11:07:48 +02:00
//typedef void(*call)();
#ifdef USE_DB
2015-10-22 11:39:11 +02:00
typedef sqlite3* sqldb;
#endif
2018-09-26 11:07:48 +02:00
/*
Two server,
Two configuration different
Does it work
Replace this by a accessing function
that execute the set value to
the header, instead of
exporting global variables
*/
2015-10-22 11:39:11 +02:00
extern plugin_header __plugin__;
2018-09-26 11:07:48 +02:00
//extern call __init__;
2015-10-22 11:39:11 +02:00
2017-07-29 22:00:34 +02:00
#ifdef USE_DB
2015-10-22 11:39:11 +02:00
sqldb getdb();
2016-10-30 16:14:04 +01:00
sqldb __getdb(char *name);
#endif
2017-07-29 22:00:34 +02:00
char* route(const char*);
char* htdocs(const char*);
char* config_dir();
2015-10-22 11:39:11 +02:00
/*Default function for plugin*/
2018-09-26 11:07:48 +02:00
// init the plugin
void init();
void handle(void*, const char*,const char*,dictionary);
2018-03-02 19:04:00 +01:00
void __release();
2017-07-29 22:00:34 +02:00
#endif