2018-07-30 09:45:33 +00:00
|
|
|
#ifndef communicate_h
|
|
|
|
#define communicate_h
|
|
|
|
|
2018-08-07 04:10:55 +00:00
|
|
|
#include "../type/type.h"
|
|
|
|
#include "../list/list_expand.h"
|
2018-07-30 09:45:33 +00:00
|
|
|
|
2018-08-07 04:10:55 +00:00
|
|
|
typedef struct message{
|
|
|
|
SID *p_sid;
|
|
|
|
char titile[16];
|
2018-08-07 04:55:59 +00:00
|
|
|
unsigned long size;
|
2018-08-07 04:10:55 +00:00
|
|
|
char content[0];
|
|
|
|
}MSG;
|
|
|
|
|
|
|
|
D_FILE *initDataFileForWrite(char *route);
|
|
|
|
D_FILE *initDataFileForRead(char *route);
|
2018-08-07 04:55:59 +00:00
|
|
|
STD_BLOCKS *initStandardDBlocks(SID *p_sid, unsigned int type, unsigned long long data_size);
|
2018-08-07 04:10:55 +00:00
|
|
|
STD_CTN *initStandardDConnection(SID *f_sid, SID *s_sid);
|
|
|
|
STD_DATA *initStandardData(unsigned int type);
|
|
|
|
|
|
|
|
int dataForStandardDBlock(STD_BLOCKS *p_stdb,void *data);
|
|
|
|
int dataFileAddStandardData(D_FILE *p_dfile, STD_DATA *p_std);
|
2018-08-07 04:55:59 +00:00
|
|
|
int standardDataAddBlock(STD_DATA *p_std, SID *p_sid ,unsigned int type, void *data, unsigned long long data_size);
|
2018-08-07 04:10:55 +00:00
|
|
|
int standardDataAddConnection(STD_DATA *p_std, SID *f_sid, SID *s_sid);
|
|
|
|
int dataFileWriteIn(D_FILE *p_dfile);
|
|
|
|
int dataFileReadOut(D_FILE *p_dfile);
|
|
|
|
|
|
|
|
int releaseSTDBlocks(STD_BLOCKS *p_stdb);
|
|
|
|
int releaseStandardData(STD_DATA *p_std);
|
|
|
|
int releaseSTDConnection(STD_CTN *p_stdc);
|
|
|
|
int releaseDFile(D_FILE *p_file);
|
|
|
|
|
|
|
|
List *_doStandardDataInfoWrite(unsigned int type, void *value, List *er_list);
|
|
|
|
List *_doStandardDataWrite(unsigned int type, void *value, List *er_list);
|
|
|
|
List *_doStandardDConnectionWrite(unsigned int type, void *value, List *er_list);
|
|
|
|
List *_doStandardDBlockWrite(unsigned int type, void *value, List *er_list);
|
|
|
|
|
|
|
|
STD_DATA *listToSTD(List *);
|
2018-08-07 04:55:59 +00:00
|
|
|
List *standardDataToList(STD_DATA *);
|
|
|
|
List *_doStandardDataToList(unsigned int type, void *value, List *er_list);
|
|
|
|
//STD_DATA *stackToSTD(Stack *);
|
|
|
|
//STD_DATA *treeToSTD(Tree *);
|
2018-07-30 09:45:33 +00:00
|
|
|
|
|
|
|
#endif /* communicate_h */
|