minidol: initial commit
[jump.git] / minidol / lib / ports.h
diff --git a/minidol/lib/ports.h b/minidol/lib/ports.h
new file mode 100644 (file)
index 0000000..7561572
--- /dev/null
@@ -0,0 +1,24 @@
+/* ports header */
+#ifndef _PORTS_H_
+#define _PORTS_H_
+
+#include <unistd.h>
+#include <dol.h>
+
+typedef struct {
+       char  name[PORTNAME_MAXLEN];
+       int   (*size) (void);   /* size */
+       int   (*level)(void);   /* how many bytes in buf? */
+       int   (*read) (void *buf, int len);
+       int   (*write)(void *buf, int len);
+} port_t;
+
+port_t* get_port(void* port);
+
+int size_shm (void *hwbuf);
+int level_shm(void *hwbuf);
+int read_shm (void *hwbuf, void *buf, int len);
+int write_shm(void *hwbuf, void *buf, int len);
+
+#endif /* _PORTS_H_ */
+