ZE-Standard-Libraries/communicate/communicate.h

50 lines
1.8 KiB
C
Raw Normal View History

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;
2018-08-07 09:43:42 +00:00
time_t time;
2018-08-07 04:10:55 +00:00
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);
2018-08-17 08:58:15 +00:00
unsigned long calStandardData(STD_DATA *p_std);
CALLBACK_STATE(calStandardDataCTN);
2018-08-07 04:10:55 +00:00
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);
2018-08-07 09:43:42 +00:00
MSG *createMessage(char *title, void *data, unsigned long data_size);
int sendMessageIPv4(MSG *p_msg, char *ip, unsigned int port);
2018-08-07 04:55:59 +00:00
//STD_DATA *stackToSTD(Stack *);
//STD_DATA *treeToSTD(Tree *);
2018-07-30 09:45:33 +00:00
#endif /* communicate_h */