8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / lib / libdtrace / common / dt_pq.h
blob8184a90c6656f3258f308dd7edcc84076fe5d7e6
1 /*
2 * CDDL HEADER START
4 * This file and its contents are supplied under the terms of the
5 * Common Development and Distribution License ("CDDL"), version 1.0.
6 * You may only use this file in accordance with the terms of version
7 * 1.0 of the CDDL.
9 * A full copy of the text of the CDDL should have accompanied this
10 * source. A copy of the CDDL is also available via the Internet at
11 * http://www.illumos.org/license/CDDL.
13 * CDDL HEADER END
17 * Copyright (c) 2012 by Delphix. All rights reserved.
20 #ifndef _DT_PQ_H
21 #define _DT_PQ_H
23 #include <dtrace.h>
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
29 typedef uint64_t (*dt_pq_value_f)(void *, void *);
31 typedef struct dt_pq {
32 dtrace_hdl_t *dtpq_hdl; /* dtrace handle */
33 void **dtpq_items; /* array of elements */
34 uint_t dtpq_size; /* count of allocated elements */
35 uint_t dtpq_last; /* next free slot */
36 dt_pq_value_f dtpq_value; /* callback to get the value */
37 void *dtpq_arg; /* callback argument */
38 } dt_pq_t;
40 extern dt_pq_t *dt_pq_init(dtrace_hdl_t *, uint_t size, dt_pq_value_f, void *);
41 extern void dt_pq_fini(dt_pq_t *);
43 extern void dt_pq_insert(dt_pq_t *, void *);
44 extern void *dt_pq_pop(dt_pq_t *);
45 extern void *dt_pq_walk(dt_pq_t *, uint_t *);
47 #ifdef __cplusplus
49 #endif
51 #endif /* _DT_PQ_H */