X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=include%2Fproto-def.h;h=c364035a52c1a4e8df22098a2edb348d77bc249c;hb=1205c90cccd3144bab24b4b5fd8dcbf0d0e6b570;hp=934bf30f3e6d617791e36c9fd2ed52859c584d5d;hpb=cd054544444e92e7695dd288f0c04b7af0f668e3;p=src%2Fapp-framework-binder.git diff --git a/include/proto-def.h b/include/proto-def.h index 934bf30f..c364035a 100644 --- a/include/proto-def.h +++ b/include/proto-def.h @@ -1,5 +1,5 @@ /* - alsajson-gw -- provide a REST/HTTP interface to ALSA-Mixer + proto-def.h -- provide a REST/HTTP interface Copyright (C) 2015, Fulup Ar Foll @@ -17,37 +17,30 @@ 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* pingSample (AFB_plugin *plugin, AFB_session *session, AFB_request *post); -PUBLIC const char* getQueryValue (AFB_request * request, char *name); -PUBLIC AFB_plugin *afsvRegister (AFB_session *session); -PUBLIC int doRestApi(struct MHD_Connection *connection, AFB_session *session, const char *method, const char* url); +// helper-api +extern const char* getQueryValue (const AFB_request * request, const char *name); +extern int getQueryAll(AFB_request * request, char *query, size_t len); +/* +extern json_object* getPostFile (AFB_request *request, AFB_PostItem *item, char* destination) ; +extern char* getPostPath (AFB_request *request); +*/ + +extern json_object *jsonNewMessage (AFB_error level, char* format, ...); + +// rest-api +extern void endPostRequest(AFB_PostHandle *posthandle); +extern 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); -// Session handling -PUBLIC AFB_ERROR sessionCheckdir (AFB_session *session); -PUBLIC json_object *sessionList (AFB_session *session, AFB_request *request); -PUBLIC json_object *sessionToDisk (AFB_session *session, AFB_request *request, char *name,json_object *jsonSession); -PUBLIC json_object *sessionFromDisk (AFB_session *session, AFB_request *request, char *name); // Httpd server -PUBLIC AFB_ERROR httpdStart (AFB_session *session); -PUBLIC AFB_ERROR httpdLoop (AFB_session *session); -PUBLIC void httpdStop (AFB_session *session); - - -// config management -PUBLIC char *configTime (void); -PUBLIC AFB_session *configInit (void); -PUBLIC json_object *jsonNewMessage (AFB_ERROR level, char* format, ...); -PUBLIC json_object *jsonNewStatus (AFB_ERROR level); -PUBLIC json_object *jsonNewjtype (void); -PUBLIC json_object *jsonNewMessage (AFB_ERROR level, char* format, ...); -PUBLIC void jsonDumpObject (json_object * jObject); -PUBLIC AFB_ERROR configLoadFile (AFB_session * session, AFB_config *cliconfig); -PUBLIC void configStoreFile (AFB_session * session); +extern AFB_error httpdStart (AFB_session *session); +extern AFB_error httpdLoop (AFB_session *session); +extern void httpdStop (AFB_session *session); + +