ZE-Standard-Libraries/communicate/communicate.h

60 lines
2.0 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);
2018-08-21 08:26:31 +00:00
STD_DATA *initStandardData(unsigned int type, SID *s_id);
2018-08-07 04:10:55 +00:00
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);
2018-08-21 08:26:31 +00:00
__CALLBACK_STATE(dataFileReadOut);
2018-08-07 04:10:55 +00:00
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-21 08:26:31 +00:00
unsigned long long calStandardData(STD_DATA *p_std);
__CALLBACK_STATE(calStandardDataCTN);
__CALLBACK_STATE(calStandardDataBLK);
2018-08-07 04:10:55 +00:00
2018-08-21 08:26:31 +00:00
__CALLBACK_STATE(StandardDataInfoWrite);
__CALLBACK_STATE(StandardDataWrite);
__CALLBACK_STATE(StandardDConnectionWrite);
__CALLBACK_STATE(StandardDBlockWrite);
2018-08-07 04:10:55 +00:00
STD_DATA *listToSTD(List *);
2018-08-07 04:55:59 +00:00
List *standardDataToList(STD_DATA *);
2018-08-21 08:26:31 +00:00
__CALLBACK_STATE(StandardDataToList);
int readDataFileInfo(D_FILE *p_dfile);
int readStandardData(D_FILE *p_dfile, STD_DATA *p_std);
int readSTDBlocks(STD_BLOCKS *p_stdb);
int checkIfDataFile(D_FILE *p_dfile);
int readStandardDataBySid(D_FILE *p_dfile, SID *p_sid);
__CALLBACK_STATE(findStandardDataBySid);
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-21 08:26:31 +00:00
void printStandardData(void *value);
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 */