All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
as_buffer.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2018 Aerospike, Inc.
3  *
4  * Portions may be licensed to Aerospike, Inc. under one or more contributor
5  * license agreements.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
8  * use this file except in compliance with the License. You may obtain a copy of
9  * the License at http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14  * License for the specific language governing permissions and limitations under
15  * the License.
16  */
17 
18 #pragma once
19 
20 #include <aerospike/as_std.h>
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 /******************************************************************************
27  * TYPES
28  ******************************************************************************/
29 
30 /**
31  * Byte Buffer.
32  */
33 typedef struct as_buffer_s {
34 
35  /**
36  * Number of bytes allocated to the buffer
37  */
38  uint32_t capacity;
39 
40  /**
41  * Number of bytes used
42  */
43  uint32_t size;
44 
45  /**
46  * Bytes of the buffer
47  */
48  uint8_t * data;
49 
50 } as_buffer;
51 
52 /******************************************************************************
53  * INLINE FUNCTION DEFINITIONS
54  ******************************************************************************/
55 
56 /**
57  * Initialize the buffer to default values.
58  */
59 int as_buffer_init(as_buffer * b);
60 
61 /**
62  * Free the resources allocated to the buffer.
63  */
65 
66 #ifdef __cplusplus
67 } // end extern "C"
68 #endif
int as_buffer_init(as_buffer *b)
uint32_t size
Definition: as_buffer.h:43
uint8_t * data
Definition: as_buffer.h:48
void as_buffer_destroy(as_buffer *b)
uint32_t capacity
Definition: as_buffer.h:38