1
1

Add a lam_array_item_t object, analogous to the lam_list_item_t.

This commit was SVN r256.
Этот коммит содержится в:
Jeff Squyres 2004-01-11 04:41:59 +00:00
родитель 4b8d0bf4e8
Коммит 0f5f293162
2 изменённых файлов: 40 добавлений и 4 удалений

Просмотреть файл

@ -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);