?? structs.h
字號:
#ifndef _STRUCTS_H_LG#define _STRUCTS_H_LG#include <unistd.h>#include <stddef.h>#include <signal.h>#include <sys/types.h>#include <sys/ipc.h>#include <sys/shm.h>#include "stddef.h"#define MAX_SIZE 10#ifndef MAX_CLIENT#define MAX_CLIENT 10#endif//typedef struct {// char name[MAX_SIZE + 1];// char pwd[MAX_SIZE + 1];//}USER;typedef struct { char chara[10]; char charb[10]; char charc[10]; int inta; int intb; int intc; pid_t spid; pid_t cpid; int ok; // errcode int over; // over = 1 if server has done the bussness char mark[10];}SWAP;typedef struct userinfo{ char name[10]; char pwd[10]; int id; int money;}USER;typedef struct { int flag; // flag = 0 if this SWAP is used by ant process SWAP swap;}SWAP_ARR;typedef struct { int flag; // flag = 0 if no getSHM access SHM SWAP_ARR swap_arr[MAX_CLIENT];}SHM;#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -