Blame synfig-osx/launcher/x-hash.h

Carlos Lopez a09598
/* x-hash.h -- basic hash table class
Carlos Lopez a09598
   $Id: x-hash.h,v 1.4 2003/04/16 00:42:14 jharper Exp $
Carlos Lopez a09598
Carlos Lopez a09598
   Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
Carlos Lopez a09598
Carlos Lopez a09598
   Permission is hereby granted, free of charge, to any person
Carlos Lopez a09598
   obtaining a copy of this software and associated documentation files
Carlos Lopez a09598
   (the "Software"), to deal in the Software without restriction,
Carlos Lopez a09598
   including without limitation the rights to use, copy, modify, merge,
Carlos Lopez a09598
   publish, distribute, sublicense, and/or sell copies of the Software,
Carlos Lopez a09598
   and to permit persons to whom the Software is furnished to do so,
Carlos Lopez a09598
   subject to the following conditions:
Carlos Lopez a09598
Carlos Lopez a09598
   The above copyright notice and this permission notice shall be
Carlos Lopez a09598
   included in all copies or substantial portions of the Software.
Carlos Lopez a09598
Carlos Lopez a09598
   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
Carlos Lopez a09598
   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
Carlos Lopez a09598
   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
Carlos Lopez a09598
   NONINFRINGEMENT.  IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT
Carlos Lopez a09598
   HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
Carlos Lopez a09598
   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
Carlos Lopez a09598
   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
Carlos Lopez a09598
   DEALINGS IN THE SOFTWARE.
Carlos Lopez a09598
Carlos Lopez a09598
   Except as contained in this notice, the name(s) of the above
Carlos Lopez a09598
   copyright holders shall not be used in advertising or otherwise to
Carlos Lopez a09598
   promote the sale, use or other dealings in this Software without
Carlos Lopez a09598
   prior written authorization. */
Carlos Lopez a09598
Carlos Lopez a09598
#ifndef X_HASH_H
Carlos Lopez a09598
#define X_HASH_H 1
Carlos Lopez a09598
Carlos Lopez a09598
typedef struct x_hash_table_struct x_hash_table;
Carlos Lopez a09598
Carlos Lopez a09598
typedef int (x_compare_fun) (const void *a, const void *b);
Carlos Lopez a09598
typedef unsigned int (x_hash_fun) (const void *k);
Carlos Lopez a09598
typedef void (x_destroy_fun) (void *x);
Carlos Lopez a09598
typedef void (x_hash_foreach_fun) (void *k, void *v, void *data);
Carlos Lopez a09598
Carlos Lopez a09598
/* for X_PFX and X_EXTERN */
Carlos Lopez a09598
#include "x-list.h"
Carlos Lopez a09598
Carlos Lopez a09598
X_EXTERN x_hash_table *X_PFX (hash_table_new) (x_hash_fun *hash,
Carlos Lopez a09598
					       x_compare_fun *compare,
Carlos Lopez a09598
					       x_destroy_fun *key_destroy,
Carlos Lopez a09598
					       x_destroy_fun *value_destroy);
Carlos Lopez a09598
X_EXTERN void X_PFX (hash_table_free) (x_hash_table *h);
Carlos Lopez a09598
Carlos Lopez a09598
X_EXTERN unsigned int X_PFX (hash_table_size) (x_hash_table *h);
Carlos Lopez a09598
Carlos Lopez a09598
X_EXTERN void X_PFX (hash_table_insert) (x_hash_table *h, void *k, void *v);
Carlos Lopez a09598
X_EXTERN void X_PFX (hash_table_replace) (x_hash_table *h, void *k, void *v);
Carlos Lopez a09598
X_EXTERN void X_PFX (hash_table_remove) (x_hash_table *h, void *k);
Carlos Lopez a09598
X_EXTERN void *X_PFX (hash_table_lookup) (x_hash_table *h,
Carlos Lopez a09598
					  void *k, void **k_ret);
Carlos Lopez a09598
X_EXTERN void X_PFX (hash_table_foreach) (x_hash_table *h,
Carlos Lopez a09598
					  x_hash_foreach_fun *fun,
Carlos Lopez a09598
					  void *data);
Carlos Lopez a09598
Carlos Lopez a09598
#endif /* X_HASH_H */