summaryrefslogtreecommitdiffstats
path: root/btime/btimec.c
diff options
context:
space:
mode:
Diffstat (limited to 'btime/btimec.c')
-rw-r--r--btime/btimec.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/btime/btimec.c b/btime/btimec.c
new file mode 100644
index 0000000..02c29bc
--- /dev/null
+++ b/btime/btimec.c
@@ -0,0 +1,28 @@
+/*
+ * btimec.c --
+ *
+ * Example program for libbtime
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "btime.h"
+
+int
+main(int argc, char **argv)
+{
+ unsigned int bt;
+ char *btimedhost;
+
+ if (argc != 2) {
+ fprintf(stderr, "USAGE: %s <host>\n", argv[0]);
+ exit(2);
+ }
+
+ btimedhost = argv[1];
+ bt = btime(btimedhost);
+ printf("%s: %u\n", btimedhost, bt);
+
+ exit(0);
+}