가변배열

컴퓨터이야기/C 2006. 1. 25. 18:02
tree나 trie 데이터 구조를 만들 때, 유용한 가변배열.
저장할 때, 엔디언 정리 필요함.
난 오로지 i586 리눅스/유닉스!! ㅋ

"sambuf.h"파일
#define DATA_IS_NULL -1
#define INVALID_DATA_SIZE -2
#define MEMORY_FULL -3
#define FILE_OPEN_ERROR -4
#define NOT_FOUND -5
#define POSITION_ERROR -6
#define UNKNOWN_ERROR -99

#define SMDK_NO_ERROR 1
#define DEF_INC_SIZE 100
#define DEL_LIST_INC_SIZE 100
#define DEL_LIST_DATA_SIZE 4
#define SORT_SIZE 100

#define OPT_USED 1
#define OPT_MAX 2
#define OPT_REFINE 3

#define LS 4

typedef struct sambuf
{
void *data ;
int used ;
int max ;
int inc_size ;
int data_size ;
}sambuf_t ;

typedef struct dynamic_array
{
sambuf_t *lists_real ;
sambuf_t *lists_deleted ;
} dynamic_array_t;


Posted by 백구씨쥔장
,