Code Review
/
src
/
app-framework-binder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Doc
[src/app-framework-binder.git]
/
include
/
local-def.h
diff --git
a/include/local-def.h
b/include/local-def.h
index
3f0a26a
..
5deca98
100644
(file)
--- a/
include/local-def.h
+++ b/
include/local-def.h
@@
-35,11
+35,20
@@
#include <json.h>
#include <microhttpd.h>
#include <magic.h>
#include <json.h>
#include <microhttpd.h>
#include <magic.h>
+#include <setjmp.h>
+#include <signal.h>
+
+
#define AJQ_VERSION "0.1"
/* other definitions --------------------------------------------------- */
#define AJQ_VERSION "0.1"
/* other definitions --------------------------------------------------- */
+// Note: because of a bug in libmagic MAGIC_DB NULL should not be used for default
+#define MAGIC_DB "/usr/share/misc/magic.mgc"
+#define OPA_INDEX "index.html"
+#define MAX_ALIAS 10 // max number of aliases
+
typedef int BOOL;
#ifndef FALSE
#define FALSE 0
typedef int BOOL;
#ifndef FALSE
#define FALSE 0
@@
-84,6
+93,12
@@
typedef struct {
int fd;
} AFB_staticfile;
int fd;
} AFB_staticfile;
+typedef struct {
+ char *url;
+ char *path;
+ size_t len;
+} AFB_aliasdir;
+
// some usefull static object initialized when entering listen loop.
extern int verbose;
// some usefull static object initialized when entering listen loop.
extern int verbose;
@@
-94,11
+109,12
@@
typedef struct {
char *api;
char *post;
struct MHD_Connection *connection;
char *api;
char *post;
struct MHD_Connection *connection;
+ sigjmp_buf checkPluginCall; // context save for timeout set/longjmp
} AFB_request;
typedef struct {
} AFB_request;
typedef struct {
- char *msg;
-
in
t len;
+ char
*msg;
+
size_
t len;
} AFB_redirect_msg;
// main config structure
} AFB_redirect_msg;
// main config structure
@@
-117,6
+133,8
@@
typedef struct {
char *configfile; // where to store configuration on gateway exit
uid_t setuid;
int cacheTimeout;
char *configfile; // where to store configuration on gateway exit
uid_t setuid;
int cacheTimeout;
+ int apiTimeout;
+ AFB_aliasdir *aliasdir; // alias mapping for icons,apps,...
} AFB_config;
// Command line structure hold cli --command + help text
} AFB_config;
// Command line structure hold cli --command + help text
@@
-134,6
+152,7
@@
typedef struct {
char *name;
AFB_apiCB callback;
char *info;
char *name;
AFB_apiCB callback;
char *info;
+ void * handle;
} AFB_restapi;
// Plugin definition
} AFB_restapi;
// Plugin definition
@@
-160,6
+179,7
@@
typedef struct {
int forceexit; // when autoconfig from script force exit before starting server
AFB_plugin **plugins; // pointer to REST/API plugins
magic_t magic; // Mime type file magic lib
int forceexit; // when autoconfig from script force exit before starting server
AFB_plugin **plugins; // pointer to REST/API plugins
magic_t magic; // Mime type file magic lib
+ sigjmp_buf restartCkpt; // context save for restart set/longjmp
} AFB_session;
} AFB_session;