📄 system.h
字号:
////////////////
//file: general.h
//////////////
#ifndef __GENERAL__
#define __GENERAL__
#ifndef NULL
#define NULL ((void *)0)
#endif
#define SUCCESS 1
#define FAIL 0
#define TRUE 1
#define FALSE 0
#define ON 1
#define OFF 0
#define INTMGMT 1 /* process ID-interrupt management */
#define TIMER 2 /* process ID-timer management */
#define SYSMGMT 3 /* process ID-system function management */
#define LINK 4 /* process ID-PPP protocol NP layer */
#define PPP_LCP 5 /* process ID-PPP protocol LCP layer */
#define PPP_LP 6 /* process ID-PPP protocol LP layer*/
#define S_CARD 7 /* process ID-serial IC card */
#define P_CARD 8 /* process ID-parallel IC card */
#define PARA_COM 9 /* process ID-parallel communication */
#define LP_SEND 10
#define APP 15 /* process ID-application */
#define INVALID_PROCESS_ID 0
#define T_START 1 /* message type-start a timer */
#define T_STOP 2 /* message type-stop a timer or timer stop */
#define T_RESTART 3 /* message type-restart a timer */
#define M_BEEP 4 /* message type-turn on or shut off beep */
#define M_ERROR 5 /* message type-error message */
#define D_DATA 6 /* message type-data block transmit */
#define READCARD_REQ 7 /* message type-read IC card request */
#define N_UP 8
#define N_DOWN 9
#define N_OPEN 10
#define N_CLOSE 11
#define D_BLK_LEN 256 /* size of data block */
#define D_BLK_NUM 10 /* number of data block */
#define MSG_NUM 20 /* number of message block */
#define PROC_NUM 16 /* number of process */
#define TIMER_NUM 12 /* number of timer */
#define MAX_PORT 1
#define ERR_NONE 1
#define ERR_FUNCTION_NOT_RETURN 2
#define ERR_INVALID_PORT 100
#define ERR_BUFFER_FULL 101
#define ERR_ALLOC_MESSAGE_FAIL 102
#define ERR_LINK_NOT_ESTABLISHED 103
#define ERR_ALLOC_BLOCK_FAIL 104
#define ERR_BUFFER_NOT_EMPTY 105
#define ERR_WRITE_CARD_FAIL 106
#define ERR_READ_CARD_FAIL 107
#define ERR_COMMUNICATION_FAIL 108
#define ERR_LAST_SEND_RUN 109
#define ERR_OPEN_FILE_FAIL 110
#define ERR_WRITE_FILE_FAIL 111
#define ERR_READ_FILE_FAIL 112
#define ERR_OPEN_CARD_FAIL 113
typedef struct _d_bloc_type /* define the type of data block */
{
unsigned char data_bloc[D_BLK_LEN];
struct _d_bloc_type *next;
}d_bloc_type;
typedef struct _msgtype /* message type define */
{
struct _msgtype *next;
unsigned char s_procid; /* sourse process id */
unsigned char d_procid; /* destination process id */
unsigned char type; /* message type */
union
{
unsigned short datalen;
unsigned short timerid;
unsigned short errorid;
unsigned short beep_switch;
}ctrl1;
union
{
unsigned short timelen;
unsigned short port;
unsigned short ic_address;
}ctrl2;
unsigned char *dataptr; /* data block pointer */
}msgtype;
typedef struct
{
msgtype *head;
msgtype *tail;
} p_msg;
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -