1 /* $NetBSD: bufferlist.h,v 1.4 2014/12/10 04:38:00 christos Exp $ */ 2 3 /* 4 * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC") 5 * Copyright (C) 1999-2001 Internet Software Consortium. 6 * 7 * Permission to use, copy, modify, and/or distribute this software for any 8 * purpose with or without fee is hereby granted, provided that the above 9 * copyright notice and this permission notice appear in all copies. 10 * 11 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 12 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 13 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 14 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 15 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 16 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 17 * PERFORMANCE OF THIS SOFTWARE. 18 */ 19 20 /* Id: bufferlist.h,v 1.17 2007/06/19 23:47:18 tbox Exp */ 21 22 #ifndef ISC_BUFFERLIST_H 23 #define ISC_BUFFERLIST_H 1 24 25 /***** 26 ***** Module Info 27 *****/ 28 29 /*! \file isc/bufferlist.h 30 * 31 * 32 *\brief Buffer lists have no synchronization. Clients must ensure exclusive 33 * access. 34 * 35 * \li Reliability: 36 * No anticipated impact. 37 38 * \li Security: 39 * No anticipated impact. 40 * 41 * \li Standards: 42 * None. 43 */ 44 45 /*** 46 *** Imports 47 ***/ 48 49 #include <isc/lang.h> 50 #include <isc/types.h> 51 52 ISC_LANG_BEGINDECLS 53 54 /*** 55 *** Functions 56 ***/ 57 58 unsigned int 59 isc_bufferlist_usedcount(isc_bufferlist_t *bl); 60 /*!< 61 * \brief Return the length of the sum of all used regions of all buffers in 62 * the buffer list 'bl' 63 * 64 * Requires: 65 * 66 *\li 'bl' is not NULL. 67 * 68 * Returns: 69 *\li sum of all used regions' lengths. 70 */ 71 72 unsigned int 73 isc_bufferlist_availablecount(isc_bufferlist_t *bl); 74 /*!< 75 * \brief Return the length of the sum of all available regions of all buffers in 76 * the buffer list 'bl' 77 * 78 * Requires: 79 * 80 *\li 'bl' is not NULL. 81 * 82 * Returns: 83 *\li sum of all available regions' lengths. 84 */ 85 86 ISC_LANG_ENDDECLS 87 88 #endif /* ISC_BUFFERLIST_H */ 89