minidol: initial commit
[jump.git] / minidol / lib / ports.h
1 /* ports header */
2 #ifndef _PORTS_H_
3 #define _PORTS_H_
4
5 #include <unistd.h>
6 #include <dol.h>
7
8 typedef struct {
9         char  name[PORTNAME_MAXLEN];
10         int   (*size) (void);   /* size */
11         int   (*level)(void);   /* how many bytes in buf? */
12         int   (*read) (void *buf, int len);
13         int   (*write)(void *buf, int len);
14 } port_t;
15
16 port_t* get_port(void* port);
17
18 int size_shm (void *hwbuf);
19 int level_shm(void *hwbuf);
20 int read_shm (void *hwbuf, void *buf, int len);
21 int write_shm(void *hwbuf, void *buf, int len);
22
23 #endif /* _PORTS_H_ */
24