Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* $NetBSD: heap.h,v 1.1.1.1 2004/05/20 19:49:41 christos Exp $ */ |
michael@0 | 2 | |
michael@0 | 3 | /* |
michael@0 | 4 | * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") |
michael@0 | 5 | * Copyright (c) 1997,1999 by Internet Software Consortium. |
michael@0 | 6 | * |
michael@0 | 7 | * Permission to use, copy, modify, and distribute this software for any |
michael@0 | 8 | * purpose with or without fee is hereby granted, provided that the above |
michael@0 | 9 | * copyright notice and this permission notice appear in all copies. |
michael@0 | 10 | * |
michael@0 | 11 | * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES |
michael@0 | 12 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
michael@0 | 13 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR |
michael@0 | 14 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
michael@0 | 15 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
michael@0 | 16 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT |
michael@0 | 17 | * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
michael@0 | 18 | */ |
michael@0 | 19 | |
michael@0 | 20 | /* |
michael@0 | 21 | * This version of this file is derived from Android 2.3 "Gingerbread", |
michael@0 | 22 | * which contains uncredited changes by Android/Google developers. It has |
michael@0 | 23 | * been modified in 2011 for use in the Android build of Mozilla Firefox by |
michael@0 | 24 | * Mozilla contributors (including Michael Edwards <m.k.edwards@gmail.com>, |
michael@0 | 25 | * and Steve Workman <sjhworkman@gmail.com>). |
michael@0 | 26 | * These changes are offered under the same license as the original NetBSD |
michael@0 | 27 | * file, whose copyright and license are unchanged above. |
michael@0 | 28 | */ |
michael@0 | 29 | |
michael@0 | 30 | typedef int (*heap_higher_priority_func)(void *, void *); |
michael@0 | 31 | typedef void (*heap_index_func)(void *, int); |
michael@0 | 32 | typedef void (*heap_for_each_func)(void *, void *); |
michael@0 | 33 | |
michael@0 | 34 | typedef struct heap_context { |
michael@0 | 35 | int array_size; |
michael@0 | 36 | int array_size_increment; |
michael@0 | 37 | int heap_size; |
michael@0 | 38 | void **heap; |
michael@0 | 39 | heap_higher_priority_func higher_priority; |
michael@0 | 40 | heap_index_func index; |
michael@0 | 41 | } *heap_context; |
michael@0 | 42 | |
michael@0 | 43 | #define heap_new __heap_new |
michael@0 | 44 | #define heap_free __heap_free |
michael@0 | 45 | #define heap_insert __heap_insert |
michael@0 | 46 | #define heap_delete __heap_delete |
michael@0 | 47 | #define heap_increased __heap_increased |
michael@0 | 48 | #define heap_decreased __heap_decreased |
michael@0 | 49 | #define heap_element __heap_element |
michael@0 | 50 | #define heap_for_each __heap_for_each |
michael@0 | 51 | |
michael@0 | 52 | heap_context heap_new(heap_higher_priority_func, heap_index_func, int); |
michael@0 | 53 | int heap_free(heap_context); |
michael@0 | 54 | int heap_insert(heap_context, void *); |
michael@0 | 55 | int heap_delete(heap_context, int); |
michael@0 | 56 | int heap_increased(heap_context, int); |
michael@0 | 57 | int heap_decreased(heap_context, int); |
michael@0 | 58 | void * heap_element(heap_context, int); |
michael@0 | 59 | int heap_for_each(heap_context, heap_for_each_func, void *); |