添加注释

This commit is contained in:
Saturneic 2018-08-23 15:24:59 +08:00
parent 6beea0ecdc
commit 09d1560a30
4 changed files with 279 additions and 42 deletions

View File

@ -4,48 +4,285 @@
#include "../type/type.h"
#include "../list/list_expand.h"
D_FILE *initDataFileForWrite(char *route);
D_FILE *initDataFileForRead(char *route);
STD_BLOCKS *initStandardDBlocks(SID *p_sid, unsigned int type, unsigned long long data_size);
STD_CTN *initStandardDConnection(SID *f_sid, SID *s_sid);
STD_DATA *initStandardData(unsigned int type, SID *s_id);
int dataForStandardDBlock(STD_BLOCKS *p_stdb,void *data);
int dataFileAddStandardData(D_FILE *p_dfile, STD_DATA *p_std);
int standardDataAddBlock(STD_DATA *p_std, SID *p_sid ,unsigned int type, void *data, unsigned long long data_size);
int standardDataAddConnection(STD_DATA *p_std, SID *f_sid, SID *s_sid);
int dataFileWriteIn(D_FILE *p_dfile);
int dataFileReadOut(D_FILE *p_dfile);
__CALLBACK_STATE(dataFileReadOut);
int releaseSTDBlocks(STD_BLOCKS *p_stdb);
int releaseStandardData(STD_DATA *p_std);
int releaseSTDConnection(STD_CTN *p_stdc);
int releaseDFile(D_FILE *p_file);
unsigned long long calStandardData(STD_DATA *p_std);
__CALLBACK_STATE(calStandardDataCTN);
__CALLBACK_STATE(calStandardDataBLK);
/************************************************
:
************************************************/
/*
*
*: route指示数据文件路径
*: ,NULL.
*/
extern D_FILE *initDataFileForWrite(char *route);
/*
*
*: route指示数据文件路径
*: ,NULL.
*/
extern D_FILE *initDataFileForRead(char *route);
/*
*
*: type指示数据块储存数据的数据类型,data_size指示数据块储存数据的大小
*: ,NULL.
*/
extern STD_BLOCKS *initStandardDBlocks(SID *p_sid, unsigned int type, unsigned long long data_size);
/*
*
*: f_sid指示第一个数据块的SID,s_sid指示第二个数据块的SID.
*: ,NULL.
*/
extern STD_CTN *initStandardDConnection(SID *f_sid, SID *s_sid);
/*
*
*: type指示标准数据结构所储存的数据结构的数据类型, s_id指示所储存的数据结构的ID,
s_id为NULL,ID.便,ID.
*: ,NULL.
*/
extern STD_DATA *initStandardData(unsigned int type, SID *s_id);
/************************************************
:
************************************************/
/*
*
*: data为指向所添加数据所在内存空间的指针
*: 0,-1.
*/
extern int dataForStandardDBlock(STD_BLOCKS *p_stdb,void *data);
/*
*
*: 0,-1.
*/
extern int dataFileAddStandardData(D_FILE *p_dfile, STD_DATA *p_std);
/*
*
*: type指示所添加数据的数据类型, data为指向所添加数据所在内存空间的指针, data_size指示所添加数据的大小
*: 0,-1.
*/
extern int standardDataAddBlock(STD_DATA *p_std, SID *p_sid ,unsigned int type, void *data, unsigned long long data_size);
/*
*
*: f_sid指示第一个数据块的SID,s_sid指示第二个数据块的SID.
*: 0,-1.
*/
extern int standardDataAddConnection(STD_DATA *p_std, SID *f_sid, SID *s_sid);
/************************************************
:
************************************************/
/*
*,.
*: 0,-1.
*/
extern int dataFileWriteIn(D_FILE *p_dfile);
/*
*
*/
__CALLBACK_STATE(StandardDataInfoWrite);
/*
*
*/
__CALLBACK_STATE(StandardDataWrite);
/*
*
*/
__CALLBACK_STATE(StandardDConnectionWrite);
/*
*
*/
__CALLBACK_STATE(StandardDBlockWrite);
STD_DATA *listToSTD(List *);
List *standardDataToList(STD_DATA *);
/*
*,,.
*: 0,-1.
*/
extern int dataFileReadOut(D_FILE *p_dfile);
/*
*
*/
__CALLBACK_STATE(dataFileReadOut);
/************************************************
:
************************************************/
/*
*
*: 0,-1.
*/
extern int releaseSTDBlocks(STD_BLOCKS *p_stdb);
/*
*
*: 0,-1.
*/
extern int releaseStandardData(STD_DATA *p_std);
/*
*
*: 0,-1.
*/
extern int releaseSTDConnection(STD_CTN *p_stdc);
/*
*
*: 0,-1.
*/
extern int releaseDFile(D_FILE *p_file);
/*
*,.
*/
static unsigned long long calStandardData(STD_DATA *p_std);
/*
*
*/
__CALLBACK_STATE(calStandardDataCTN);
/*
*
*/
__CALLBACK_STATE(calStandardDataBLK);
/************************************************
:
************************************************/
/*
*
*: ,NULL.
*/
extern STD_DATA *listToSTD(List *);
/*
*
*: ,NULL.
*/
extern List *standardDataToList(STD_DATA *);
/*
*
*/
__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);
MSG *createMessage(char *title, void *data, unsigned long data_size);
int sendMessageIPv4(MSG *p_msg, char *ip, unsigned int port);
void printStandardData(void *value);
//STD_DATA *stackToSTD(Stack *);
//STD_DATA *treeToSTD(Tree *);
/************************************************
:
************************************************/
/*
*,
*: ,.
*: 0,-1.
*/
int readDataFileInfo(D_FILE *p_dfile);
/*
*
*: p_std为指向框架中的相关标准数据所在内存空间的指针
*: 0,-1.
*/
int readStandardData(D_FILE *p_dfile, STD_DATA *p_std);
/*
*
*: 0,-1.
*/
int readSTDBlocks(STD_BLOCKS *p_stdb);
/*
*,
*: 0,-1.
*/
int checkIfDataFile(D_FILE *p_dfile);
/*
*ID,
*: 0,-1.
*/
int readStandardDataBySid(D_FILE *p_dfile, SID *p_sid);
/*
*ID,
*/
__CALLBACK_STATE(findStandardDataBySid);
/************************************************
:
************************************************/
/*
*
*/
void printStandardData(void *value);
/************************************************
:
************************************************/
/*
*
*: ,NULL.
*/
MSG *createMessage(char *title, void *data, unsigned long data_size);
/*
*ipv4地址发送消息
*: 0,-1.
*/
int sendMessageIPv4(MSG *p_msg, char *ip, unsigned int port);
#endif /* communicate_h */

View File

@ -309,42 +309,42 @@ extern unsigned long long len(List *p_list);
/*
*
*: 1,0.*/
int isListEmpty(List *p_list);
extern int isListEmpty(List *p_list);
/*
*
*: */
int getByIntForNode(Node *);
extern int getByIntForNode(Node *);
/*
*
*: */
unsigned int getByUIntForNode(Node *);
extern unsigned int getByUIntForNode(Node *);
/*
*
*: */
double getByDoubleForNode(Node *);
extern double getByDoubleForNode(Node *);
/*
*
*: */
char *getByStringForNode(Node *);
extern char *getByStringForNode(Node *);
/*
*
*: */
void *getByPointerForNode(Node *);
extern void *getByPointerForNode(Node *);
/*
*
*: */
unsigned long long getIndexForNode(List *p_list,Node *p_node);
extern unsigned long long getIndexForNode(List *p_list,Node *p_node);
/*
*,.
*: ,NULL*/
Node *updateNodeByIndex(List *p_list, void *new_value, unsigned long long index);
extern Node *updateNodeByIndex(List *p_list, void *new_value, unsigned long long index);

View File

@ -22,12 +22,12 @@
/*
*使
*: name为回调函数名.*/
#define __CALLBACK_STATE(name) List *_do##name(unsigned int, void *, List *)
#define __CALLBACK_STATE(name) static List *_do##name(unsigned int, void *, List *)
/*
*使
*: name为回调函数名.*/
#define __CALLBACK_DEFINE(name) List *_do##name(unsigned int type, void *value, List *expand_resources)
#define __CALLBACK_DEFINE(name) static List *_do##name(unsigned int type, void *value, List *expand_resources)
/*
*使

View File

@ -173,7 +173,7 @@ typedef struct List{
*/
struct index_change{
unsigned long long c_index;//偏移量,有正负之分
int f_count;//偏移量所对应的数组的节点
int f_count;//偏移量所对应的数组的节点
};
/*