diff options
Diffstat (limited to 'testutil/is-datatype-struct.c')
-rw-r--r-- | testutil/is-datatype-struct.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/testutil/is-datatype-struct.c b/testutil/is-datatype-struct.c new file mode 100644 index 0000000..f1c7675 --- /dev/null +++ b/testutil/is-datatype-struct.c @@ -0,0 +1,29 @@ +/* See LICENSE file for copyright and license details. */ +#include "../libsyscalls.h" + +#include <limits.h> +#include <stddef.h> +#include <stdio.h> +#include <stdlib.h> + + +int +main(int argc, char *argv[]) +{ + enum libsyscalls_os os = (enum libsyscalls_os)atoi(argv[1]); + enum libsyscalls_arch arch = (enum libsyscalls_arch)atoi(argv[2]); + enum libsyscalls_datatype type = (enum libsyscalls_datatype)atoi(argv[3]); + struct libsyscalls_datatype_description desc; + enum libsyscalls_error err; + size_t i; + + err = libsyscalls_get_datatype_description(os, arch, type, &desc); + if (err == LIBSYSCALLS_E_ISSTRUCT) { + return 0; + } else if (err) { + fprintf(stderr, "libsyscalls_get_datatype_description %s %s %s: ", argv[4], argv[5], argv[6]); + libsyscalls_perror(NULL, err); + return 2; + } + return 1; +} |