"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.17.5/lib/isc/include/isc/astack.h" (4 Sep 2020, 1136 Bytes) of package /linux/misc/dns/bind9/9.17.5/bind-9.17.5.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "astack.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
    3  *
    4  * This Source Code Form is subject to the terms of the Mozilla Public
    5  * License, v. 2.0. If a copy of the MPL was not distributed with this
    6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    7  *
    8  * See the COPYRIGHT file distributed with this work for additional
    9  * information regarding copyright ownership.
   10  */
   11 
   12 #pragma once
   13 
   14 #include <inttypes.h>
   15 
   16 #include <isc/mem.h>
   17 #include <isc/types.h>
   18 
   19 isc_astack_t *
   20 isc_astack_new(isc_mem_t *mctx, size_t size);
   21 /*%<
   22  * Allocate and initialize a new array stack of size 'size'.
   23  */
   24 
   25 void
   26 isc_astack_destroy(isc_astack_t *stack);
   27 /*%<
   28  * Free an array stack 'stack'.
   29  *
   30  * Requires:
   31  * \li  'stack' is empty.
   32  */
   33 
   34 bool
   35 isc_astack_trypush(isc_astack_t *stack, void *obj);
   36 /*%<
   37  * Try to push 'obj' onto array stack 'astack'. On failure, either
   38  * because the stack size limit has been reached or because another
   39  * thread has already changed the stack pointer, return 'false'.
   40  */
   41 
   42 void *
   43 isc_astack_pop(isc_astack_t *stack);
   44 /*%<
   45  * Pop an object off of array stack 'stack'. If the stack is empty,
   46  * return NULL.
   47  */