Add CMake build files (required by Yocto build process)
[src/app-framework-binder.git] / include / local-def.h
index 72c51de..8fe87d0 100644 (file)
@@ -19,7 +19,9 @@
 
 */
 
-#define _GNU_SOURCE
+#ifndef _GNU_SOURCE
+  #define _GNU_SOURCE
+#endif
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <json.h>
 #include <microhttpd.h>
 #include <magic.h>
+#include <setjmp.h>
+#include <signal.h>
+
+
 
 #define AJQ_VERSION "0.1"
 
@@ -43,6 +49,7 @@
 // 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
@@ -88,6 +95,12 @@ typedef struct {
   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;
@@ -98,6 +111,7 @@ typedef struct {
   char *api;
   char *post;
   struct MHD_Connection *connection;
+  sigjmp_buf checkPluginCall; // context save for timeout set/longjmp
 } AFB_request;
 
 typedef struct {
@@ -122,6 +136,7 @@ typedef struct {
   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
@@ -166,6 +181,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
+  sigjmp_buf restartCkpt; // context save for restart set/longjmp
 } AFB_session;