Back to index

lightning-sunbird  0.9+nobinonly
cairo-hash-private.h
Go to the documentation of this file.
00001 /* cairo - a vector graphics library with display and print output
00002  *
00003  * Copyright © 2004 Red Hat, Inc.
00004  * Copyright © 2005 Red Hat, Inc.
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it either under the terms of the GNU Lesser General Public
00008  * License version 2.1 as published by the Free Software Foundation
00009  * (the "LGPL") or, at your option, under the terms of the Mozilla
00010  * Public License Version 1.1 (the "MPL"). If you do not alter this
00011  * notice, a recipient may use your version of this file under either
00012  * the MPL or the LGPL.
00013  *
00014  * You should have received a copy of the LGPL along with this library
00015  * in the file COPYING-LGPL-2.1; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00017  * You should have received a copy of the MPL along with this library
00018  * in the file COPYING-MPL-1.1
00019  *
00020  * The contents of this file are subject to the Mozilla Public License
00021  * Version 1.1 (the "License"); you may not use this file except in
00022  * compliance with the License. You may obtain a copy of the License at
00023  * http://www.mozilla.org/MPL/
00024  *
00025  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY
00026  * OF ANY KIND, either express or implied. See the LGPL or the MPL for
00027  * the specific language governing rights and limitations.
00028  *
00029  * The Original Code is the cairo graphics library.
00030  *
00031  * The Initial Developer of the Original Code is Red Hat, Inc.
00032  *
00033  * Contributor(s):
00034  *      Keith Packard <keithp@keithp.com>
00035  *     Graydon Hoare <graydon@redhat.com>
00036  *     Carl Worth <cworth@cworth.org>
00037  */
00038 
00039 #ifndef CAIRO_HASH_PRIVATE_H
00040 #define CAIRO_HASH_PRIVATE_H
00041 
00042 /* XXX: I'd like this file to be self-contained in terms of
00043  * includeability, but that's not really possible with the current
00044  * monolithic cairoint.h. So, for now, just include cairoint.h instead
00045  * if you want to include this file. */
00046 
00047 typedef struct _cairo_hash_table cairo_hash_table_t;
00048 
00083 typedef struct _cairo_hash_entry {
00084     unsigned long hash;
00085 } cairo_hash_entry_t;
00086 
00087 typedef cairo_bool_t
00088 (*cairo_hash_keys_equal_func_t) (void *key_a, void *key_b);
00089 
00090 typedef cairo_bool_t
00091 (*cairo_hash_predicate_func_t) (void *entry);
00092 
00093 typedef void
00094 (*cairo_hash_callback_func_t) (void *entry,
00095                             void *closure);
00096 
00097 cairo_private cairo_hash_table_t *
00098 _cairo_hash_table_create (cairo_hash_keys_equal_func_t keys_equal);
00099 
00100 cairo_private void
00101 _cairo_hash_table_destroy (cairo_hash_table_t *hash_table);
00102 
00103 cairo_private cairo_bool_t
00104 _cairo_hash_table_lookup (cairo_hash_table_t  *hash_table,
00105                        cairo_hash_entry_t  *key,
00106                        cairo_hash_entry_t **entry_return);
00107 
00108 cairo_private void *
00109 _cairo_hash_table_random_entry (cairo_hash_table_t         *hash_table,
00110                             cairo_hash_predicate_func_t predicate);
00111 
00112 cairo_private cairo_status_t
00113 _cairo_hash_table_insert (cairo_hash_table_t *hash_table,
00114                        cairo_hash_entry_t *entry);
00115 
00116 cairo_private void
00117 _cairo_hash_table_remove (cairo_hash_table_t *hash_table,
00118                        cairo_hash_entry_t *key);
00119 
00120 cairo_private void
00121 _cairo_hash_table_foreach (cairo_hash_table_t          *hash_table,
00122                         cairo_hash_callback_func_t  hash_callback,
00123                         void                           *closure);
00124 
00125 #endif