Reflect the API change in libMarshall

This commit is contained in:
Pierre Pronchery 2020-04-13 08:09:47 +02:00
parent 16951b6bf8
commit 18795c5bff

View File

@ -91,7 +91,7 @@ struct _App
int event_own; int event_own;
AppServer * appserver; AppServer * appserver;
int loop; int loop;
MarshallCallback * calls; MarshallCall * calls;
/* plugins */ /* plugins */
/* video */ /* video */
@ -107,7 +107,7 @@ struct _App
struct _GServerCall struct _GServerCall
{ {
GServerVideoCall type; GServerVideoCall type;
MarshallCallback callback; MarshallCall call;
Variable ** args; Variable ** args;
size_t args_cnt; size_t args_cnt;
}; };
@ -216,8 +216,7 @@ const GServerOpenGLCall _gserver_calls[] =
/* prototypes */ /* prototypes */
/* accessors */ /* accessors */
static GServerClient * _gserver_get_client(GServer * gserver, void * id); static GServerClient * _gserver_get_client(GServer * gserver, void * id);
static MarshallCallback _gserver_get_call(GServer * gserver, static MarshallCall _gserver_get_call(GServer * gserver, String const * name);
String const * name);
/* useful */ /* useful */
static int _gserver_call(GServer * gserver, Variable * ret, static int _gserver_call(GServer * gserver, Variable * ret,
@ -303,8 +302,8 @@ static int _new_init_opengl(GServer * gserver)
if((plugin = plugin_new_self()) == NULL) if((plugin = plugin_new_self()) == NULL)
return -1; return -1;
for(i = 0; i < cnt; i++) for(i = 0; i < cnt; i++)
if((gserver->calls[i] = (MarshallCallback)plugin_lookup( if((gserver->calls[i] = (MarshallCall)plugin_lookup(plugin,
plugin, _gserver_calls[i].name)) _gserver_calls[i].name))
== NULL) == NULL)
break; break;
plugin_delete(plugin); plugin_delete(plugin);
@ -649,8 +648,7 @@ GSERVER_PROTO4s(void, glColor4us, uint16_t, uint16_t, uint16_t, uint16_t)
/* private */ /* private */
/* functions */ /* functions */
/* accessors */ /* accessors */
static MarshallCallback _gserver_get_call(GServer * gserver, static MarshallCall _gserver_get_call(GServer * gserver, String const * name)
String const * name)
{ {
const size_t cnt = sizeof(_gserver_calls) / sizeof(*_gserver_calls); const size_t cnt = sizeof(_gserver_calls) / sizeof(*_gserver_calls);
size_t i; size_t i;
@ -690,10 +688,10 @@ static GServerClient * _gserver_get_client(GServer * gserver,
static int _gserver_call(GServer * gserver, Variable * ret, static int _gserver_call(GServer * gserver, Variable * ret,
char const * name, size_t args_cnt, Variable ** args) char const * name, size_t args_cnt, Variable ** args)
{ {
MarshallCallback callback; MarshallCall call;
if((callback = _gserver_get_call(gserver, name)) != NULL) if((call = _gserver_get_call(gserver, name)) != NULL)
return marshall_call(ret, callback, args_cnt, args); return marshall_callp(ret, call, args_cnt, args);
return -1; return -1;
} }
@ -708,7 +706,7 @@ static void _gserver_client_calls(GServer * gserver, GServerClient * client)
for(i = 0; i < client->calls_cnt; i++) for(i = 0; i < client->calls_cnt; i++)
{ {
call = &client->calls[i]; call = &client->calls[i];
marshall_call(NULL, call->callback, call->args_cnt, call->args); marshall_call(NULL, call->call, call->args_cnt, call->args);
} }
} }
@ -743,7 +741,7 @@ static int _gserver_queue(GServer * gserver, AppServerClient * asc,
gsc->calls = call; gsc->calls = call;
call = &gsc->calls[gsc->calls_cnt]; call = &gsc->calls[gsc->calls_cnt];
call->type = type; call->type = type;
call->callback = _gserver_get_call(gserver, name); call->call = _gserver_get_call(gserver, name);
#if 0 /* XXX probably hurts performance without protecting anything */ #if 0 /* XXX probably hurts performance without protecting anything */
memset(&gsc->args, 0, sizeof(gsc->args)); memset(&gsc->args, 0, sizeof(gsc->args));
#endif #endif