1
0
mirror of https://github.com/lxsang/ant-http synced 2024-06-29 11:59:48 +02:00
ant-http/plugin_manager.h

35 lines
1.2 KiB
C
Raw Normal View History

2015-10-22 11:39:11 +02:00
#include <dlfcn.h>
#include <sys/socket.h>
#include "plugins/dictionary.h"
#include "config.h"
#define FORM_URL_ENCODE "application/x-www-form-urlencoded"
#define FORM_MULTI_PART "multipart/form-data"
2016-10-31 17:34:20 +01:00
#define APP_JSON "application/json"
2016-10-29 15:02:16 +02:00
#define PLUGIN_HANDLER "handler"
#define WS_MAGIC_STRING "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
2015-10-22 11:39:11 +02:00
struct plugin_entry {
struct plugin_entry *next;
char *pname;
void *handle;
};
/* lookup: look for s in hashtab */
struct plugin_entry *plugin_lookup(char *s);
/* install: put (name, defn) in hashtab */
struct plugin_entry *plugin_load(char *name);
void unload_all_plugin();
2016-03-04 11:38:08 +01:00
void unload_plugin(struct plugin_entry*);
void unload_plugin_by_name(const char*);
2015-10-22 11:39:11 +02:00
void * plugin_from_file(char* name);
void ws_confirm_request(int, const char*);
2015-10-22 11:39:11 +02:00
char* post_url_decode(int client,int len);
dictionary decode_url_request(const char* query);
dictionary decode_request(int client,const char* method,const char* query);
dictionary decode_multi_part_request(int,const char*);
dictionary decode_cookie(const char*);
2016-10-31 17:34:20 +01:00
char* json_data_decode(int,int);
2015-10-22 11:39:11 +02:00
char* read_line(int sock);
int read_buf(int sock,char* buf,int i);
int execute_plugin(int client, const char *path,
const char *method, const char *query_string);