Add a lam_array_item_t object, analogous to the lam_list_item_t.
This commit was SVN r256.
Этот коммит содержится в:
родитель
4b8d0bf4e8
Коммит
0f5f293162
@ -8,8 +8,29 @@
|
||||
|
||||
#define ARR_BLK_SZ 20
|
||||
|
||||
|
||||
lam_class_info_t lam_array_item_cls = {"lam_array_item_t", &lam_object_cls,
|
||||
(class_init_t) lam_arr_item_init, (class_destroy_t) lam_obj_destroy};
|
||||
lam_class_info_t lam_array_cls = {"lam_array_t", &lam_object_cls,
|
||||
(class_init_t) lam_arr_init, (class_destroy_t)lam_arr_destroy};
|
||||
(class_init_t) lam_arr_init, (class_destroy_t) lam_arr_destroy};
|
||||
|
||||
/*
|
||||
*
|
||||
* lam_list_link_item_t interface
|
||||
*
|
||||
*/
|
||||
|
||||
void lam_arr_item_init(lam_array_item_t *item)
|
||||
{
|
||||
SUPER_INIT(item, lam_array_item_cls.cls_parent);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* lam_list_t interface
|
||||
*
|
||||
*/
|
||||
|
||||
void lam_arr_init(lam_array_t *arr)
|
||||
{
|
||||
|
@ -20,19 +20,34 @@ extern lam_class_info_t lam_array_cls;
|
||||
|
||||
/*
|
||||
*
|
||||
* Arrray interface
|
||||
* Array item interface
|
||||
*
|
||||
*/
|
||||
|
||||
struct lam_array_item_t
|
||||
{
|
||||
lam_object_t super;
|
||||
};
|
||||
typedef struct lam_array_item_t lam_array_item_t;
|
||||
|
||||
void lam_arr_item_init(lam_array_item_t *item);
|
||||
|
||||
/*
|
||||
*
|
||||
* Array interface
|
||||
*
|
||||
*/
|
||||
|
||||
typedef int (*lam_arr_cmp_fn)(lam_object_t *, lam_object_t *);
|
||||
|
||||
typedef struct lam_array
|
||||
struct lam_array_t
|
||||
{
|
||||
lam_object_t super;
|
||||
lam_object_t **arr_items;
|
||||
size_t arr_length;
|
||||
size_t arr_size;
|
||||
} lam_array_t;
|
||||
};
|
||||
typedef struct lam_array_t lam_array_t;
|
||||
|
||||
|
||||
void lam_arr_init(lam_array_t *arr);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user