emWIN中实现了通用的链表结构
位于头文件GUI_ARRAY.h
GUI_ARRAY GUI_ARRAY_Create (void);
int GUI_ARRAY_AddItem (GUI_ARRAY hArray, const void * pNew, int Len);
void GUI_ARRAY_Delete (GUI_ARRAY hArray);
WM_HMEM GUI_ARRAY_GethItem (GUI_ARRAY hArray, unsigned int Index);
unsigned GUI_ARRAY_GetNumItems (GUI_ARRAY hArray);
void * GUI_ARRAY_GetpItemLocked (GUI_ARRAY hArray, unsigned int Index);
int GUI_ARRAY_SethItem (GUI_ARRAY hArray, unsigned int Index, WM_HMEM hItem);
WM_HMEM GUI_ARRAY_SetItem (GUI_ARRAY hArray, unsigned int Index, const void * pData, int Len);
void GUI_ARRAY_DeleteItem (GUI_ARRAY hArray, unsigned int Index);
char GUI_ARRAY_InsertBlankItem (GUI_ARRAY hArray, unsigned int Index);
WM_HMEM GUI_ARRAY_InsertItem (GUI_ARRAY hArray, unsigned int Index, int Len);
void * GUI_ARRAY_ResizeItemLocked(GUI_ARRAY hArray, unsigned int Index, int Len);
int GUI_ARRAY_AddItem (GUI_ARRAY hArray, const void * pNew, int Len);
void GUI_ARRAY_Delete (GUI_ARRAY hArray);
WM_HMEM GUI_ARRAY_GethItem (GUI_ARRAY hArray, unsigned int Index);
unsigned GUI_ARRAY_GetNumItems (GUI_ARRAY hArray);
void * GUI_ARRAY_GetpItemLocked (GUI_ARRAY hArray, unsigned int Index);
int GUI_ARRAY_SethItem (GUI_ARRAY hArray, unsigned int Index, WM_HMEM hItem);
WM_HMEM GUI_ARRAY_SetItem (GUI_ARRAY hArray, unsigned int Index, const void * pData, int Len);
void GUI_ARRAY_DeleteItem (GUI_ARRAY hArray, unsigned int Index);
char GUI_ARRAY_InsertBlankItem (GUI_ARRAY hArray, unsigned int Index);
WM_HMEM GUI_ARRAY_InsertItem (GUI_ARRAY hArray, unsigned int Index, int Len);
void * GUI_ARRAY_ResizeItemLocked(GUI_ARRAY hArray, unsigned int Index, int Len);
其中GUI_ARRAY_AddItem(GUI_ARRAY hArray, const void * pNew, int Len)中,对pNew所指向的内容是作Copy动作,而非简单的指向。
测试OK