From 486220b828f0cc92b235384dc336af8ea889da4c Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Sun, 27 Apr 2014 01:40:51 +0800 Subject: [PATCH] Will marshall calls with a client cookie --- include/App/appserver.h | 12 +++++++++--- tools/appbroker.c | 7 +++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/include/App/appserver.h b/include/App/appserver.h index 3fdaded..f7d0244 100644 --- a/include/App/appserver.h +++ b/include/App/appserver.h @@ -23,6 +23,11 @@ /* AppServer */ /* types */ +typedef void AppServerClient; + +typedef unsigned int AppServerOptions; +# define ASO_REGISTER 0x1 + typedef struct _AppServer AppServer; @@ -31,9 +36,10 @@ typedef struct _AppServer AppServer; /* functions */ -AppServer * appserver_new(char const * app, char const * name); -AppServer * appserver_new_event(char const * app, char const * name, - Event * event); +AppServer * appserver_new(AppServerOptions options, char const * app, + char const * name); +AppServer * appserver_new_event(AppServerOptions options, char const * app, + char const * name, Event * event); void appserver_delete(AppServer * appserver); /* accessors */ diff --git a/tools/appbroker.c b/tools/appbroker.c index 0a3def1..ca317ff 100644 --- a/tools/appbroker.c +++ b/tools/appbroker.c @@ -1,5 +1,5 @@ /* $Id$ */ -/* Copyright (c) 2011-2012 Pierre Pronchery */ +/* Copyright (c) 2011-2014 Pierre Pronchery */ /* This file is part of DeforaOS System libApp */ /* This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -102,7 +102,7 @@ static int _appbroker_foreach_call(char const * key, Hash * value, void * data) int i; char buf[8]; char const * p; - char const * sep = ""; + const char sep[] = ", "; if(key == NULL || key[0] == '\0') return 0; @@ -112,7 +112,7 @@ static int _appbroker_foreach_call(char const * key, Hash * value, void * data) if((p = hash_get(value, "ret")) == NULL) p = "void"; fprintf(appbroker->fp, "%s%s%s%s%s%s", p, " ", appbroker->prefix, "_", - key, "("); + key, "(AppServerClient * client"); for(i = 0; i < APPSERVER_MAX_ARGUMENTS; i++) { snprintf(buf, sizeof(buf), "arg%d", i + 1); @@ -120,7 +120,6 @@ static int _appbroker_foreach_call(char const * key, Hash * value, void * data) break; if(_appbroker_foreach_call_arg(appbroker, sep, p) != 0) return 1; - sep = ", "; } fprintf(appbroker->fp, "%s", ");\n"); return 0;