1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/other-licenses/android/heap.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,59 @@ 1.4 +/* $NetBSD: heap.h,v 1.1.1.1 2004/05/20 19:49:41 christos Exp $ */ 1.5 + 1.6 +/* 1.7 + * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") 1.8 + * Copyright (c) 1997,1999 by Internet Software Consortium. 1.9 + * 1.10 + * Permission to use, copy, modify, and distribute this software for any 1.11 + * purpose with or without fee is hereby granted, provided that the above 1.12 + * copyright notice and this permission notice appear in all copies. 1.13 + * 1.14 + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES 1.15 + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 1.16 + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR 1.17 + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 1.18 + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 1.19 + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT 1.20 + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 1.21 + */ 1.22 + 1.23 +/* 1.24 + * This version of this file is derived from Android 2.3 "Gingerbread", 1.25 + * which contains uncredited changes by Android/Google developers. It has 1.26 + * been modified in 2011 for use in the Android build of Mozilla Firefox by 1.27 + * Mozilla contributors (including Michael Edwards <m.k.edwards@gmail.com>, 1.28 + * and Steve Workman <sjhworkman@gmail.com>). 1.29 + * These changes are offered under the same license as the original NetBSD 1.30 + * file, whose copyright and license are unchanged above. 1.31 + */ 1.32 + 1.33 +typedef int (*heap_higher_priority_func)(void *, void *); 1.34 +typedef void (*heap_index_func)(void *, int); 1.35 +typedef void (*heap_for_each_func)(void *, void *); 1.36 + 1.37 +typedef struct heap_context { 1.38 + int array_size; 1.39 + int array_size_increment; 1.40 + int heap_size; 1.41 + void **heap; 1.42 + heap_higher_priority_func higher_priority; 1.43 + heap_index_func index; 1.44 +} *heap_context; 1.45 + 1.46 +#define heap_new __heap_new 1.47 +#define heap_free __heap_free 1.48 +#define heap_insert __heap_insert 1.49 +#define heap_delete __heap_delete 1.50 +#define heap_increased __heap_increased 1.51 +#define heap_decreased __heap_decreased 1.52 +#define heap_element __heap_element 1.53 +#define heap_for_each __heap_for_each 1.54 + 1.55 +heap_context heap_new(heap_higher_priority_func, heap_index_func, int); 1.56 +int heap_free(heap_context); 1.57 +int heap_insert(heap_context, void *); 1.58 +int heap_delete(heap_context, int); 1.59 +int heap_increased(heap_context, int); 1.60 +int heap_decreased(heap_context, int); 1.61 +void * heap_element(heap_context, int); 1.62 +int heap_for_each(heap_context, heap_for_each_func, void *);