Began updating server data definitions.
This commit is contained in:
31
server/src/include/data.h
Normal file
31
server/src/include/data.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user