summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/local-def.h7
-rw-r--r--include/proto-def.h11
2 files changed, 13 insertions, 5 deletions
diff --git a/include/local-def.h b/include/local-def.h
index 961fdd2c..8f297c53 100644
--- a/include/local-def.h
+++ b/include/local-def.h
@@ -107,6 +107,13 @@ typedef struct {
typedef enum {AFB_POST_NONE=0, AFB_POST_JSON, AFB_POST_FORM} AFB_PostType;
+// Post Upload File Handle
+typedef struct {
+ int fd;
+ char *path;
+ json_object* jerror;
+} AFB_PostCtx;
+
typedef struct {
int len; // post element size
char *data; // post data in raw format
diff --git a/include/proto-def.h b/include/proto-def.h
index 937d6930..ac4f21b9 100644
--- a/include/proto-def.h
+++ b/include/proto-def.h
@@ -17,19 +17,20 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: $
*/
-// Rest-api
-
-PUBLIC json_object* apiPingTest(AFB_request *request);
+// helper-api
+PUBLIC json_object* getPingTest(AFB_request *request);
PUBLIC const char* getQueryValue (AFB_request * request, char *name);
PUBLIC int getQueryAll(AFB_request * request, char *query, size_t len);
+PUBLIC AFB_PostHandle* getPostHandle (AFB_request *request);
+PUBLIC json_object* getPostFile (AFB_request *request, AFB_PostItem *item, char* destination) ;
+PUBLIC AFB_PostCtx* getPostContext (AFB_request *request);
+// rest-api
PUBLIC void endPostRequest(AFB_PostHandle *posthandle);
PUBLIC int doRestApi(struct MHD_Connection *connection, AFB_session *session, const char* url, const char *method
, const char *upload_data, size_t *upload_data_size, void **con_cls);
-PUBLIC AFB_PostHandle* getPostHandle (AFB_request *request);
void initPlugins (AFB_session *session);