XVector
xvec_buffer.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2026 XCENA Inc.
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 
26 #pragma once
27 
28 #include "xvec_types.h"
29 
30 #ifdef __cplusplus
31 extern "C"
32 {
33 #endif
43  xvecStatus xvecCreateBuffer(xvecExecutionContextTag* context, size_t size, xvecBufferTag** outBuffer);
44 
55  xvecStatus xvecDestroyBuffer(xvecExecutionContextTag* context, xvecBufferTag* buffer);
56 
65  xvecStatus xvecGetBufferData(xvecBufferTag* buffer, void** outData);
66 
75  xvecStatus xvecGetBufferSize(xvecBufferTag* buffer, size_t* outSize);
76 
85  xvecStatus xvecGetBufferSlice(xvecBufferTag* buffer, xvecBufferSlice* outSlice);
86 
87 #ifdef __cplusplus
88 } // extern "C"
89 #endif
A slice of a buffer containing data pointer and size.
Definition: xvec_types.h:249
xvecStatus xvecGetBufferSlice(xvecBufferTag *buffer, xvecBufferSlice *outSlice)
Get both data pointer and size of the buffer as a slice.
xvecStatus xvecCreateBuffer(xvecExecutionContextTag *context, size_t size, xvecBufferTag **outBuffer)
Create a buffer.
xvecStatus xvecGetBufferData(xvecBufferTag *buffer, void **outData)
Get the data pointer of the buffer.
xvecStatus xvecGetBufferSize(xvecBufferTag *buffer, size_t *outSize)
Get the size of the buffer.
xvecStatus xvecDestroyBuffer(xvecExecutionContextTag *context, xvecBufferTag *buffer)
Destroy a buffer.
Core types, enums, and structures for the XVector library.
xvecStatus
Status codes returned by XVector API functions.
Definition: xvec_types.h:133