From e8fe761b0f44bc4ebe42dff3aecce811b7f6c312 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Thu, 4 Dec 2008 20:22:41 +0000 Subject: Add basic module loading and printing of messages. --- src/p11-tests.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'src/p11-tests.c') 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 +#include +#include + +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; +} -- cgit v1.2.3