Created
March 27, 2015 18:40
-
-
Save vibhavp/976cec43740626206ccf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int check_arg_type(object_t *obj, int n, ...) | |
{ | |
va_list args; | |
type_t type; | |
int i; | |
va_start(args, n); | |
for (i = 0; i < n; i++) { | |
type = va_arg(args, type_t); | |
if (obj->type != type) { | |
fprintf(stderr, "Wrong argument type - %s (wanted %s).", | |
strtype(obj->type), | |
strtype(type)); | |
va_end(args); | |
return 1; | |
} | |
} | |
va_end(args); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment