Code cleanup

This commit is contained in:
Pierre Pronchery 2014-04-17 03:13:01 +02:00
parent e2087251f4
commit ec557dad38

View File

@ -112,6 +112,10 @@ typedef struct _StringEnum
} StringEnum; } StringEnum;
/* constants */
#define APPINTERFACE_CALL_PREFIX "call::"
/* variables */ /* variables */
StringEnum _string_type[] = StringEnum _string_type[] =
{ {
@ -208,7 +212,7 @@ AppInterface * appinterface_new(char const * app)
static int _new_foreach(char const * key, Hash * value, static int _new_foreach(char const * key, Hash * value,
AppInterface * appinterface) AppInterface * appinterface)
{ {
char const prefix[] = "call::"; char const prefix[] = APPINTERFACE_CALL_PREFIX;
int i; int i;
char buf[8]; char buf[8];
int type = VT_NULL; int type = VT_NULL;
@ -358,7 +362,8 @@ int appinterface_can_call(AppInterface * appinterface, char const * name,
String const * allow; String const * allow;
String const * deny; String const * deny;
if((section = string_new_append("call::", method, NULL)) == NULL) if((section = string_new_append(APPINTERFACE_CALL_PREFIX, method, NULL))
== NULL)
/* XXX report as an error */ /* XXX report as an error */
return 0; return 0;
allow = config_get(appinterface->config, section, "allow"); allow = config_get(appinterface->config, section, "allow");