⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 list.h

📁 list is a data dtructure. this is a data structure type implemantation and it is implemented in C pr
💻 H
字号:
#ifndef LIST_H

#define LIST_H

#include <setjmp.h>

#include "General.h"
#include "ds/ListIterator.h"

struct LIST;
typedef struct LIST* List;

typedef struct _Object_funcs {
  COMPARISON_FUNC compare_component;
  COPY_FUNC copy_component;
  DESTRUCTION_FUNC destroy_component;
} List_Component_Funcs;

typedef enum {ITERATOR_BACKWARD, ITERATOR_FORWARD} Iterator_type;

#define EXC_LIST_EMPTY -21

#define FROM_ARRAY 2

extern List List_Create(int constructor_type, ...);
extern void List_Destroy(List* this);

extern Object List_GetFirst(const List this, jmp_buf get_first_caller) /* throws ListEmpty */ ;
extern Object List_GetLast(const List this, jmp_buf get_last_caller) /* throws ListEmpty */ ;

extern void List_InsertAtEnd(const List this, Object new_item);
extern void List_InsertInFront(const List this, Object new_item);

extern Object List_RemoveFromEnd(const List this, jmp_buf rmv_from_end_caller) /* throws ListEmpty */ ;
extern Object List_RemoveFromFront(const List this, jmp_buf rmv_from_front_caller) /* throws ListEmpty */ ;

extern BOOL List_IsEmpty(const List this);
extern int List_Size(const List this);

extern List List_Merge(const List this, const List otherList);
extern Object* List_ToArray(const List this, jmp_buf to_array_caller) /* throws ListEmpty */; 

extern ListIterator List_ListIterator(const List this, Iterator_type it_type);

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -