1/* 2 * Copyright (c) 2003-2011 Apple Inc. All rights reserved. 3 * 4 * @APPLE_LICENSE_HEADER_START@ 5 * 6 * This file contains Original Code and/or Modifications of Original Code 7 * as defined in and that are subject to the Apple Public Source License 8 * Version 2.0 (the 'License'). You may not use this file except in 9 * compliance with the License. Please obtain a copy of the License at 10 * http://www.opensource.apple.com/apsl/ and read it before using this 11 * file. 12 * 13 * The Original Code and all software distributed under the License are 14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 * Please see the License for the specific language governing rights and 19 * limitations under the License. 20 * 21 * @APPLE_LICENSE_HEADER_END@ 22 */ 23 24#ifndef _NOTIFY_TABLE_H_ 25#define _NOTIFY_TABLE_H_ 26 27#include <stdint.h> 28 29typedef struct __table_private table_t; 30typedef struct __list_private list_t; 31 32extern table_t *_nc_table_new(uint32_t n); 33 34extern void _nc_table_insert(table_t *t, const char *key, void *datum); 35extern void _nc_table_insert_no_copy(table_t *t, const char *key, void *datum); 36extern void _nc_table_insert_n(table_t *t, uint32_t key, void *datum); 37extern void _nc_table_insert_64(table_t *t, uint64_t key, void *datum); 38 39extern void *_nc_table_find(table_t *t, const char *key); 40extern void *_nc_table_find_n(table_t *t, uint32_t key); 41extern void *_nc_table_find_64(table_t *t, uint64_t key); 42 43extern void _nc_table_delete(table_t *t, const char *key); 44extern void _nc_table_delete_n(table_t *t, uint32_t key); 45extern void _nc_table_delete_64(table_t *t, uint64_t key); 46 47extern void *_nc_table_traverse_start(table_t *tin); 48extern void *_nc_table_traverse(table_t *tin, void *ttin); 49extern void _nc_table_traverse_end(table_t *tin, void *ttin); 50 51extern void _nc_table_free(table_t *tin); 52 53extern list_t *_nc_list_new(void *d); 54 55extern list_t *_nc_list_retain(list_t *l); 56extern list_t *_nc_list_retain_list(list_t *l); 57 58extern void _nc_list_release(list_t *l); 59extern void _nc_list_release_list(list_t *l); 60 61extern list_t *_nc_list_prev(list_t *l); 62extern list_t *_nc_list_next(list_t *l); 63 64extern void _nc_list_set_next(list_t *l, list_t *n); 65extern void _nc_list_set_prev(list_t *l, list_t *p); 66 67extern list_t *_nc_list_head(list_t *l); 68extern list_t *_nc_list_tail(list_t *l); 69 70extern list_t *_nc_list_prepend(list_t *l, list_t *n); 71extern list_t *_nc_list_append(list_t *l, list_t *n); 72 73extern list_t *_nc_list_concat(list_t *a, list_t *b); 74 75extern void *_nc_list_data(list_t *l); 76extern void _nc_list_set_data(list_t *l, void *d); 77 78extern list_t *_nc_list_find(list_t *l, void *d); 79extern list_t *_nc_list_find_release(list_t *l, void *d); 80 81extern list_t * _nc_list_reverse(list_t *l); 82extern uint32_t _nc_list_count(list_t *l); 83extern list_t *_nc_list_extract(list_t *n); 84extern list_t *_nc_list_chop(list_t *l); 85 86#endif /* _NOTIFY_TABLE_H_ */ 87