📄 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 + -