Last change
on this file since 528 was
49,
checked in by Sam Hocevar, 15 years ago
|
- Imported original public domain release, for future reference.
|
File size:
513 bytes
|
Line | |
---|
1 | #ifndef __UNIX_SHM_FIFO_HPP_ |
---|
2 | #define __UNIX_SHM_FIFO_HPP_ |
---|
3 | |
---|
4 | |
---|
5 | struct fifo_control |
---|
6 | { |
---|
7 | long nattached; |
---|
8 | long f_start,f_end; |
---|
9 | long size; |
---|
10 | } ; |
---|
11 | |
---|
12 | class shm_fifo |
---|
13 | { |
---|
14 | unsigned char *data; |
---|
15 | fifo_control *fc; |
---|
16 | public : |
---|
17 | int shm_id; |
---|
18 | shm_fifo(); |
---|
19 | int create(int size); // create a fifo of size |
---|
20 | int wait_attach(); // returns 1 if successful |
---|
21 | |
---|
22 | |
---|
23 | int attach(int shm_id); // attach to already |
---|
24 | int ready_to_read(); |
---|
25 | int read(void *buf, int size); |
---|
26 | int write(void *buf, int size); |
---|
27 | ~shm_fifo(); |
---|
28 | } ; |
---|
29 | |
---|
30 | |
---|
31 | |
---|
32 | #endif |
---|
33 | |
---|
34 | |
---|
Note: See
TracBrowser
for help on using the repository browser.