Files
coms/server/src/include/data.h

32 lines
494 B
C

#ifndef DATA__H
#define DATA__H
#include <time.h>
#define NAME_MAX_LENGTH 16
#define MSG_MAX_LENGTH 1024
typedef int UserID;
typedef int MsgID;
typedef char Name[NAME_MAX_LENGTH];
int name_verify(const char* name);
typedef char MsgContent[MSG_MAX_LENGTH];
int msg_verify(const char* content);
typedef struct {
UserID id;
Name name;
} UserData;
typedef struct {
MsgID id;
UserData author;
MsgID parent;
MsgContent content;
time_t timestamp;
} MsgData;
#endif