diff --git a/examples/lib/lib_test/functions.h b/examples/lib/lib_test/functions.h index 2595e64..d14aa43 100644 --- a/examples/lib/lib_test/functions.h +++ b/examples/lib/lib_test/functions.h @@ -57,7 +57,7 @@ char** func_ppPc_args_V(); char*** func_pppPc_args_V(); -void func_V_args_ppPc(char** arg1_ppPc); // +void func_V_args_ppPc(char** arg1_ppPc); char*** func_pppPc_args_pppPc(char*** arg1_ppPc); @@ -68,8 +68,12 @@ char*** func_pppPc_args_pppPc_ppPc(char*** arg1_ppPc,char** arg2_ppPc); // By value struct _PS func__PS_args_V(); +struct _PS func__PS_args__PS(struct _PS arg1__PS); + TTAPS func_TTAPS_args_V(); +TTAPS func_TTAPS_args_TTAPS(TTAPS arg1_TTAPS); + // By pointer TAPS* func_pTAPS_args_V(); diff --git a/examples/lib/lib_test/lib_test.c b/examples/lib/lib_test/lib_test.c index be2e28c..c29ce9d 100644 --- a/examples/lib/lib_test/lib_test.c +++ b/examples/lib/lib_test/lib_test.c @@ -140,6 +140,12 @@ struct _PS func__PS_args_V() { return *ret; } +struct _PS func__PS_args__PS(struct _PS arg1__PS) { + arg1__PS.field__P_1 = 23; + arg1__PS.field__P_2 = 23; + return arg1__PS; +} + TTAPS func_TTAPS_args_V() { TTAPS* ret = (TTAPS*)malloc(sizeof(TTAPS)); ret->field__P_1=23; @@ -147,6 +153,12 @@ TTAPS func_TTAPS_args_V() { return *ret; } +TTAPS func_TTAPS_args_TTAPS(TTAPS arg1_TTAPS) { + arg1_TTAPS.field__P_1 = 23; + arg1_TTAPS.field__P_2 = 23; + return arg1_TTAPS; +} + TAPS* func_pTAPS_args_V() { TAPS* ret = (TAPS*)malloc(sizeof(TAPS)); ret->field__P_1 = 23; diff --git a/examples/lib/lib_test/main.c b/examples/lib/lib_test/main.c index 4fa11d9..d55dcee 100644 --- a/examples/lib/lib_test/main.c +++ b/examples/lib/lib_test/main.c @@ -154,12 +154,26 @@ int main() { assert(ret.field__P_1 == 23); assert(ret.field__P_2 == 23); } + { + printf("testing: func__PS_args__PS\n"); + struct _PS in; + struct _PS ret = func__PS_args__PS(in); + assert(ret.field__P_1 == 23); + assert(ret.field__P_2 == 23); + } { printf("testing: func_TTAPS_args_V\n"); TTAPS ret = func_TTAPS_args_V(); assert(ret.field__P_1 == 23); assert(ret.field__P_2 == 23); } + { + printf("testing: func_TTAPS_args_TTAPS\n"); + TTAPS in; + TTAPS ret = func_TTAPS_args_TTAPS(in); + assert(ret.field__P_1 == 23); + assert(ret.field__P_2 == 23); + } { printf("testing: func_pTAPS_args_V\n"); TAPS* iret = func_pTAPS_args_V();