From 6ba98a9f9f48e13738d9736cba9c45b5e94f42f2 Mon Sep 17 00:00:00 2001 From: Brian Cully Date: Mon, 14 Apr 2008 21:52:55 -0400 Subject: Initial import --- tests/killnast.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/killnast.c (limited to 'tests/killnast.c') diff --git a/tests/killnast.c b/tests/killnast.c new file mode 100644 index 0000000..7c06dee --- /dev/null +++ b/tests/killnast.c @@ -0,0 +1,39 @@ +#include + +#include +#include + +int +main(int argc, char *argv[]) +{ + nasth *nasthole; + nast_array *aa; + int i, rc; + + if (argc != 1) { + printf("Usage: %s\n", argv[0]); + return 1; + } + + nasthole = nast_sphincter_new(NULL); + if (nasthole == NULL) { + fprintf(stderr, "ERROR: Couldn't connect to nasthole.\n"); + return 2; + } + + rc = nast_stats(nasthole); + if (rc == -1) { + fprintf(stderr, "ERROR: Couldn't get stats: %s.\n", + nast_errmsg(nasthole)); + nast_sphincter_close(nasthole); + return 2; + } + + aa = nast_get_result(nasthole); + for (i = 0; i < aa->nitems; i++) + printf("%s\n", aa->items[i]->strdata); + nast_free_result(aa); + + nast_sphincter_close(nasthole); + return 0; +} -- cgit v1.2.3