picrin/include/picrin/port.h

29 lines
441 B
C
Raw Normal View History

2013-10-17 09:42:47 -04:00
#ifndef PORT_H__
#define PORT_H__
2013-10-22 02:44:03 -04:00
#include <stdio.h>
2013-10-17 09:42:47 -04:00
enum pic_port_flag {
2013-10-22 02:44:03 -04:00
PIC_PORT_IN = 1,
PIC_PORT_OUT = 2,
PIC_PORT_TEXT = 4,
PIC_PORT_BINARY = 8
2013-10-17 09:42:47 -04:00
};
enum pic_port_status {
PIC_PORT_OPEN,
PIC_PORT_CLOSE,
};
struct pic_port {
PIC_OBJECT_HEADER
FILE *file;
short flags;
2013-10-22 02:40:36 -04:00
enum pic_port_status status;
2013-10-17 09:42:47 -04:00
};
2013-10-24 09:56:04 -04:00
#define pic_port_p(v) (pic_type(v) == PIC_TT_PORT)
#define pic_port_ptr(v) ((struct pic_port *)(v).u.data)
2013-10-17 09:42:47 -04:00
#endif