OSDN Git Service

(none)
authorryuz <ryuz>
Mon, 31 Aug 2009 22:22:16 +0000 (22:22 +0000)
committerryuz <ryuz>
Mon, 31 Aug 2009 22:22:16 +0000 (22:22 +0000)
aplfw/library/container/hashtable/hashtable.h
aplfw/library/container/hashtable/hashtable_constructor.c
aplfw/library/container/hashtable/hashtable_create.c [new file with mode: 0755]
aplfw/library/container/hashtable/hashtable_createex.c [new file with mode: 0755]
aplfw/library/container/hashtable/hashtable_delete.c [new file with mode: 0755]
aplfw/library/container/hashtable/hashtable_destructor.c [new file with mode: 0755]

index 14f0635..b735e6c 100755 (executable)
@@ -65,7 +65,7 @@ extern "C" {
 C_HASHTABLE          *HashTable_Create(int iTableSize);                                                                                                                                        /**< %jp{生成}%en{Create} */
 C_HASHTABLE          *HashTable_CreateEx(int iTableSize, C_MEMHEAP *pMemHeap);                                                                                 /**< %jp{生成}%en{Create} */
 void                  HashTable_Delete(C_HASHTABLE *self);                                                                                                                             /**< %jp{削除}%en{Delete} */
-HASHTABLE_ERR         HashTable_Constructor(C_HASHTABLE *self, C_MEMHEAP *pMemHeap, int iTableSize);                                   /**< %jp{コンストラクタ}%en{Constructor} */
+HASHTABLE_ERR         HashTable_Constructor(C_HASHTABLE *self, int iTableSize, C_MEMHEAP *pMemHeap);                                   /**< %jp{コンストラクタ}%en{Constructor} */
 void                  HashTable_Destructor(C_HASHTABLE *self);                                                                                                                 /**< %jp{デストラクタ}%en{Destructor} */
 
 /* 操作 */
index 4db2ae1..69bb8ba 100755 (executable)
@@ -16,7 +16,7 @@
 
 
 /**< %jp{コンストラクタ}%en{Constructor} */
-HASHTABLE_ERR HashTable_Constructor(C_HASHTABLE *self, C_MEMHEAP *pMemHeap, int iTableSize)
+HASHTABLE_ERR HashTable_Constructor(C_HASHTABLE *self, int iTableSize, C_MEMHEAP *pMemHeap)
 {
        T_HASHTABLE_NODE        **ppTable;
        int                                     i;
diff --git a/aplfw/library/container/hashtable/hashtable_create.c b/aplfw/library/container/hashtable/hashtable_create.c
new file mode 100755 (executable)
index 0000000..1e07cbe
--- /dev/null
@@ -0,0 +1,25 @@
+/** 
+ *  Hyper Operating System  Application Framework
+ *
+ * @file  hashtable_get.c
+ * @brief %jp{ハッシュテーブルクラス}%en{hash table class}
+ *
+ * Copyright (C) 2006-2009 by Project HOS
+ * http://sourceforge.jp/projects/hos/
+ */
+
+
+#include <stdio.h>
+#include <string.h>
+#include "hosaplfw.h"
+#include "hashtable_local.h"
+
+
+/** %jp{生成}%en{Create} */
+C_HASHTABLE *HashTable_Create(int iTableSize)
+{
+       return HashTable_CreateEx(iTableSize, Memory_GetMemHeap());
+}
+
+
+/* end of file */
diff --git a/aplfw/library/container/hashtable/hashtable_createex.c b/aplfw/library/container/hashtable/hashtable_createex.c
new file mode 100755 (executable)
index 0000000..542ec3f
--- /dev/null
@@ -0,0 +1,35 @@
+/** 
+ *  Hyper Operating System  Application Framework
+ *
+ * @file  hashtable_get.c
+ * @brief %jp{ハッシュテーブルクラス}%en{hash table class}
+ *
+ * Copyright (C) 2006-2009 by Project HOS
+ * http://sourceforge.jp/projects/hos/
+ */
+
+
+#include <stdio.h>
+#include <string.h>
+#include "hashtable_local.h"
+
+
+/** %jp{生成}%en{Create} */
+C_HASHTABLE *HashTable_CreateEx(int iTableSize, C_MEMHEAP *pMemHeap)
+{
+       C_HASHTABLE     *self;
+
+       /* メモリ確保 */
+       if ( (self = (C_HASHTABLE *)MemHeap_Alloc(pMemHeap, sizeof(C_HASHTABLE))) == NULL )
+       {
+               return NULL;
+       }
+       
+       /* コンストラクタ */
+       HashTable_Constructor(self, iTableSize, pMemHeap);
+       
+       return self;
+}
+
+
+/* end of file */
diff --git a/aplfw/library/container/hashtable/hashtable_delete.c b/aplfw/library/container/hashtable/hashtable_delete.c
new file mode 100755 (executable)
index 0000000..f5d0e6c
--- /dev/null
@@ -0,0 +1,32 @@
+/** 
+ *  Hyper Operating System  Application Framework
+ *
+ * @file  hashtable_get.c
+ * @brief %jp{ハッシュテーブルクラス}%en{hash table class}
+ *
+ * Copyright (C) 2006-2009 by Project HOS
+ * http://sourceforge.jp/projects/hos/
+ */
+
+
+#include <stdio.h>
+#include <string.h>
+#include "hashtable_local.h"
+
+
+/** %jp{削除}%en{Delete} */
+void HashTable_Delete(C_HASHTABLE *self)
+{
+       C_MEMHEAP       *pMemHeap;
+       
+       pMemHeap = self->pMemHeap;
+
+       /* デストラクタ */
+       HashTable_Destructor(self);
+       
+       /* メモリ開放 */
+       MemHeap_Free(pMemHeap, self);
+}
+
+
+/* end of file */
diff --git a/aplfw/library/container/hashtable/hashtable_destructor.c b/aplfw/library/container/hashtable/hashtable_destructor.c
new file mode 100755 (executable)
index 0000000..ecdd979
--- /dev/null
@@ -0,0 +1,29 @@
+/** 
+ *  Hyper Operating System  Application Framework
+ *
+ * @file  hashtable_get.c
+ * @brief %jp{ハッシュテーブルクラス}%en{hash table class}
+ *
+ * Copyright (C) 2006-2009 by Project HOS
+ * http://sourceforge.jp/projects/hos/
+ */
+
+
+#include <stdio.h>
+#include <string.h>
+#include "hashtable_local.h"
+
+
+
+/**< %jp{デストラクタ}%en{Destructor} */
+void HashTable_Destructor(C_HASHTABLE *self)
+{
+       /* 全削除 */
+       HashTable_RemoveAll(self);
+       
+       /* メモリ開放 */
+       MemHeap_Free(self->pMemHeap, self->ppTable);
+}
+
+
+/* end of file */