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