summaryrefslogtreecommitdiff
path: root/ao-tools/libaltos/cjnitest.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-07-28 11:20:22 -0700
committerKeith Packard <keithp@keithp.com>2010-07-28 11:20:22 -0700
commit172a2817dde6718724f2b5fad5a7761801446fa0 (patch)
tree880efde60fc468f1046307470141c773856399bd /ao-tools/libaltos/cjnitest.c
parentf2a006fd98045066bdf429cc142d033e9feb0a8f (diff)
parent81bf2042ca39eb106b789e5a08647c3114669358 (diff)
Merge branch 'macos'
Diffstat (limited to 'ao-tools/libaltos/cjnitest.c')
-rw-r--r--ao-tools/libaltos/cjnitest.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/ao-tools/libaltos/cjnitest.c b/ao-tools/libaltos/cjnitest.c
new file mode 100644
index 00000000..cd3898ed
--- /dev/null
+++ b/ao-tools/libaltos/cjnitest.c
@@ -0,0 +1,25 @@
+#include <stdio.h>
+#include "libaltos.h"
+
+main ()
+{
+ struct altos_device device;
+ struct altos_list *list;
+
+ altos_init();
+ list = altos_list_start();
+ while (altos_list_next(list, &device)) {
+ struct altos_file *file;
+ int c;
+
+ file = altos_open(&device);
+ altos_putchar(file, '?'); altos_putchar(file, '\n'); altos_flush(file);
+ while ((c = altos_getchar(file, 100)) >= 0) {
+ putchar (c);
+ }
+ printf ("getchar returns %d\n", c);
+ altos_close(file);
+ }
+ altos_list_finish(list);
+ altos_fini();
+}