From 39f541c4da16f9ae615cebcbc4c4c368ce18cd74 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Thu, 14 Aug 2008 08:22:29 +0000 Subject: [PATCH] --- ase/cmd/awk/awk.c | 14 +++++++------- ase/include/ase/cmn/dll.h | 3 +-- ase/include/ase/cmn/sll.h | 4 ++-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/ase/cmd/awk/awk.c b/ase/cmd/awk/awk.c index 3f57d8fa..1c89813e 100644 --- a/ase/cmd/awk/awk.c +++ b/ase/cmd/awk/awk.c @@ -1,5 +1,5 @@ /* - * $Id: awk.c 323 2008-08-11 10:52:25Z baconevi $ + * $Id: awk.c 325 2008-08-13 14:22:29Z baconevi $ */ #include @@ -1056,9 +1056,9 @@ static void handle_args (argc, argv) } #endif -static ase_sll_walk_t dump_sf (ase_sll_t* sll, ase_sll_node_t* n, void* arg) +static int dump_sf (ase_sll_t* sll, ase_sll_node_t* n, void* arg) { - ase_printf (ASE_T("%s\n"), n->data.ptr); + ase_printf (ASE_T("%s\n"), n->dptr); return ASE_SLL_WALK_FORWARD; } @@ -1119,7 +1119,7 @@ static int handle_args (int argc, ase_char_t* argv[], ase_sll_t* sf) if (ase_sll_getsize(sf) % 2) { wprintf (L"APPEND %S\n", opt.arg); - if (ase_sll_append(sf, opt.arg, sz) == ASE_NULL) + if (ase_sll_pushtail(sf, opt.arg, sz) == ASE_NULL) { out_of_memory (); return -1; @@ -1128,7 +1128,7 @@ wprintf (L"APPEND %S\n", opt.arg); else { wprintf (L"PREPEND %S\n", opt.arg); - if (ase_sll_prepend(sf, opt.arg, sz) == ASE_NULL) + if (ase_sll_pushhead(sf, opt.arg, sz) == ASE_NULL) { out_of_memory (); return -1; @@ -1263,9 +1263,9 @@ static ase_awk_t* open_awk (void) return awk; } -static ase_sll_walk_t dump (ase_sll_t* sll, ase_sll_node_t* node, void* arg) +static int dump (ase_sll_t* sll, ase_sll_node_t* node, void* arg) { - ase_printf (ASE_T("[%d]\n"), *(int*)node->data.ptr); + ase_printf (ASE_T("[%d]\n"), *(int*)node->dptr); return ASE_SLL_WALK_FORWARD; } static int awk_main (int argc, ase_char_t* argv[]) diff --git a/ase/include/ase/cmn/dll.h b/ase/include/ase/cmn/dll.h index c28d37c3..fe3222d4 100644 --- a/ase/include/ase/cmn/dll.h +++ b/ase/include/ase/cmn/dll.h @@ -15,7 +15,6 @@ */ typedef struct ase_dll_t ase_dll_t; typedef struct ase_dll_node_t ase_dll_node_t; -typedef enum ase_dll_walk_t ase_dll_walk_t; /* data copier */ typedef void* (*ase_dll_copier_t) (ase_dll_t* dll, void* dptr, ase_size_t dlen); @@ -24,7 +23,7 @@ typedef void* (*ase_dll_copier_t) (ase_dll_t* dll, void* dptr, ase_size_t dlen); typedef void (*ase_dll_freeer_t) (ase_dll_t* dll, void* dptr, ase_size_t dlen); /* node visitor */ -typedef ase_dll_walk_t (*ase_dll_walker_t) ( +typedef int (*ase_dll_walker_t) ( ase_dll_t* dll, ase_dll_node_t* node, void* arg); struct ase_dll_t diff --git a/ase/include/ase/cmn/sll.h b/ase/include/ase/cmn/sll.h index 6b858c70..e0bc154c 100644 --- a/ase/include/ase/cmn/sll.h +++ b/ase/include/ase/cmn/sll.h @@ -15,7 +15,6 @@ */ typedef struct ase_sll_t ase_sll_t; typedef struct ase_sll_node_t ase_sll_node_t; -typedef enum ase_sll_walk_t ase_sll_walk_t; /* data copier */ typedef void* (*ase_sll_copier_t) (ase_sll_t* sll, void* dptr, ase_size_t dlen); @@ -24,7 +23,7 @@ typedef void* (*ase_sll_copier_t) (ase_sll_t* sll, void* dptr, ase_size_t dlen); typedef void (*ase_sll_freeer_t) (ase_sll_t* sll, void* dptr, ase_size_t dlen); /* node visitor */ -typedef ase_sll_walk_t (*ase_sll_walker_t) ( +typedef int (*ase_sll_walker_t) ( ase_sll_t* sll, ase_sll_node_t* node, void* arg); struct ase_sll_t @@ -47,6 +46,7 @@ struct ase_sll_node_t }; +/* values to be returned by ase_sll_walker_t */ enum ase_sll_walk_t { ASE_SLL_WALK_STOP = 0,