X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=include%2Fproto-def.h;h=e2190eb15361e53be5f3709cfc3d17ca1db6cdee;hb=bbe18a624f4961165cf52d7f4c25de6f3a7ec012;hp=fc3a9cfa63de0f38d52c8e5ce0dc2931fafeb04f;hpb=41c462374fb25fae29f3b4a28eb99fdb639e8547;p=src%2Fapp-framework-binder.git diff --git a/include/proto-def.h b/include/proto-def.h index fc3a9cfa..e2190eb1 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,58 +17,24 @@ 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); -PUBLIC const char* getQueryValue (AFB_request * request, char *name); -PUBLIC int getQueryAll(AFB_request * request, char *query, size_t len); - -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); - -void initPlugins (AFB_session *session); - -typedef AFB_plugin* (*AFB_pluginCB)(); -PUBLIC AFB_plugin* tokenRegister (); -PUBLIC AFB_plugin* dbusRegister (); -PUBLIC AFB_plugin* alsaRegister (); -PUBLIC AFB_plugin* radioRegister (); -PUBLIC AFB_plugin* helloWorldRegister (); - -// 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); - -PUBLIC AFB_error ctxTokenRefresh (AFB_request *request); -PUBLIC AFB_error ctxTokenCreate (AFB_request *request); -PUBLIC AFB_error ctxTokenCheck (AFB_request *request); -PUBLIC AFB_error ctxTokenReset (AFB_request *request); -PUBLIC AFB_error ctxClientGet (AFB_request *request, AFB_plugin *plugin); -PUBLIC void ctxStoreInit (int); +// helper-api +extern const char* getQueryValue (const AFB_request * request, const char *name); +extern size_t 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, ...); // Httpd server -PUBLIC AFB_error httpdStart (AFB_session *session); -PUBLIC AFB_error httpdLoop (AFB_session *session); -PUBLIC void httpdStop (AFB_session *session); +extern AFB_error httpdStart (AFB_session *session); +extern AFB_error httpdLoop (AFB_session *session); +extern 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);