mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-26 12:27:58 +08:00
mark deprecated
This commit is contained in:
+18
-35
@@ -11,42 +11,43 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
/*
|
||||
* This file is part of MiniGUI, a mature cross-platform windowing
|
||||
* This file is part of MiniGUI, a mature cross-platform windowing
|
||||
* and Graphics User Interface (GUI) support system for embedded systems
|
||||
* and smart IoT devices.
|
||||
*
|
||||
* Copyright (C) 2002~2018, Beijing FMSoft Technologies Co., Ltd.
|
||||
*
|
||||
* Copyright (C) 2002~2020, Beijing FMSoft Technologies Co., Ltd.
|
||||
* Copyright (C) 1998~2002, WEI Yongming
|
||||
*
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*
|
||||
* Or,
|
||||
*
|
||||
*
|
||||
* As this program is a library, any link to this program must follow
|
||||
* GNU General Public License version 3 (GPLv3). If you cannot accept
|
||||
* GPLv3, you need to be licensed from FMSoft.
|
||||
*
|
||||
*
|
||||
* If you have got a commercial license of this program, please use it
|
||||
* under the terms and conditions of the commercial license.
|
||||
*
|
||||
*
|
||||
* For more information about the commercial license, please refer to
|
||||
* <http://www.minigui.com/blog/minigui-licensing-policy/>.
|
||||
*/
|
||||
/*
|
||||
** hash.c: the hash module for MiniGUI, from the idea of GLIB.
|
||||
**
|
||||
** hash.c: the hash module for MiniGUI.
|
||||
** Some ideas come from GLIB.
|
||||
**
|
||||
** NOTE THAT THIS FILE IS DEPRECATED.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
@@ -63,7 +64,6 @@
|
||||
#include "internals.h"
|
||||
#include "hash.h"
|
||||
|
||||
|
||||
#define MG_HASH_LOCK() \
|
||||
if (hash_table->dwFlags & HASH_THREAD_SAFE) \
|
||||
MG_MUTEX_LOCK (&hash_table->lock)
|
||||
@@ -72,18 +72,15 @@
|
||||
if (hash_table->dwFlags & HASH_THREAD_SAFE) \
|
||||
MG_MUTEX_UNLOCK (&hash_table->lock)
|
||||
|
||||
|
||||
static void hash_node_destroy (HASHNODE *node);
|
||||
static HASHNODE* hash_node_new (GHANDLE key, GHANDLE value);
|
||||
static void hash_node_destroy (HASHNODE *node);
|
||||
|
||||
|
||||
GHANDLE FuncDirectHash (GHANDLE key)
|
||||
{
|
||||
return key;
|
||||
}
|
||||
|
||||
|
||||
HASHTABLE* HashTableCreate (void* memStart, size_t hash_size, BOOL bThreadSafe,
|
||||
HASHFUNC hash_func, EQUALFUNC equal_func)
|
||||
{
|
||||
@@ -134,7 +131,7 @@ void HashTableDestroy (HASHTABLE *hash_table)
|
||||
}
|
||||
|
||||
MG_HASH_UNLOCK();
|
||||
//FIXME, not so safe
|
||||
//FIXME, not so safe
|
||||
|
||||
if (hash_table->dwFlags & HASH_THREAD_SAFE)
|
||||
MG_MUTEX_DESTROY (&hash_table->lock);
|
||||
@@ -223,11 +220,10 @@ BOOL HashTableRemove (HASHTABLE *hash_table, GHANDLE key)
|
||||
//TODO resize
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
size_t HashTableSize (HASHTABLE *hash_table)
|
||||
{
|
||||
MG_CHECK_RET (hash_table != NULL, 0);
|
||||
@@ -241,18 +237,17 @@ static void hash_table_resize (HASHTABLE *hash_table)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static HASHNODE*
|
||||
hash_node_new (GHANDLE key, GHANDLE value)
|
||||
{
|
||||
HASHNODE *node;
|
||||
|
||||
|
||||
node = malloc (sizeof(HASHNODE));
|
||||
|
||||
|
||||
node->key = key;
|
||||
node->value = value;
|
||||
node->next = NULL;
|
||||
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -261,15 +256,3 @@ static void hash_node_destroy (HASHNODE *node)
|
||||
free (node);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void hash_nodes_destroy (HASHNODE *node)
|
||||
{
|
||||
while (node)
|
||||
{
|
||||
HASHNODE *next = node->next;
|
||||
|
||||
free (node);
|
||||
node = next;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user