diff options
author | Stef Walter <stef@memberwebs.com> | 2008-12-04 20:22:41 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2008-12-04 20:22:41 +0000 |
commit | e8fe761b0f44bc4ebe42dff3aecce811b7f6c312 (patch) | |
tree | fa70dc00a8b1295e7f67e6d2003842b4e8119e51 /src/p11-tests.c | |
parent | c980526f600dcc010b7a930be5413e3c7a4a8e96 (diff) |
Add basic module loading and printing of messages.
Diffstat (limited to 'src/p11-tests.c')
-rw-r--r-- | src/p11-tests.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/p11-tests.c b/src/p11-tests.c index e69de29..80185cf 100644 --- a/src/p11-tests.c +++ b/src/p11-tests.c @@ -0,0 +1,43 @@ + + +#include "p11-tests.h" + +#include <stdio.h> +#include <stdlib.h> +#include <unistd.h> + +static void +usage() +{ + fprintf(stderr, "usage: p11-tests module [init_string]\n"); + exit(2); +} + +int +main(int argc, char* argv[]) +{ + int ch; + + while((ch = getopt(argc, argv, "")) != -1) + { + switch(ch) + { + case '?': + default: + usage(); + break; + } + } + + argc -= optind; + argv += optind; + + if(argc < 1 || argc > 2) + usage(); + + p11t_module_load(argv[0]); + + p11t_module_unload(); + + return 0; +} |