commit 461bd53dec506671cffcc04f849021434265ecd7
parent 24da4f2a1bb4df68d5d6c706bbbf7ff3c083c132
Author: Tomas Hlavaty <tom@logand.com>
Date: Sun, 16 Aug 2015 18:22:46 +0200
compute iargc and oargc
Diffstat:
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/gi-server.c b/gi-server.c
@@ -83,10 +83,20 @@ int main(void) {
GIArgument z;
GError *e = NULL;
GICallableInfo *p = pointer();
- int iargc = integer(); //g_callable_info_get_n_args (p);
- int oargc = integer();
+ int i, iargc = 0, oargc = 0, argc = g_callable_info_get_n_args(p);
+ for(i = 0; i < argc; i++) {
+ GIArgInfo *ai = g_callable_info_get_arg(p, i);
+ GIDirection d = g_arg_info_get_direction(ai);
+ if(GI_DIRECTION_INOUT == d || GI_DIRECTION_IN == d)
+ iargc++;
+ if(GI_DIRECTION_INOUT == d || GI_DIRECTION_OUT == d)
+ oargc++;
+ g_base_info_unref(ai);
+ }
+ GIFunctionInfoFlags f = g_function_info_get_flags(p);
+ if((f & GI_FUNCTION_IS_METHOD) && !(f & GI_FUNCTION_IS_CONSTRUCTOR))
+ iargc++;
GIArgument iargv[iargc], oargv[oargc];
- int i;
for(i = 0; i < iargc; i++) {
argument(&iargv[i]);
}