]>
git.proxmox.com Git - ceph.git/blob - ceph/src/arrow/cpp/src/arrow/c/abi.h
1 // Licensed to the Apache Software Foundation (ASF) under one
2 // or more contributor license agreements. See the NOTICE file
3 // distributed with this work for additional information
4 // regarding copyright ownership. The ASF licenses this file
5 // to you under the Apache License, Version 2.0 (the
6 // "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing,
12 // software distributed under the License is distributed on an
13 // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 // KIND, either express or implied. See the License for the
15 // specific language governing permissions and limitations
26 #define ARROW_FLAG_DICTIONARY_ORDERED 1
27 #define ARROW_FLAG_NULLABLE 2
28 #define ARROW_FLAG_MAP_KEYS_SORTED 4
31 // Array type description
37 struct ArrowSchema
** children
;
38 struct ArrowSchema
* dictionary
;
41 void (*release
)(struct ArrowSchema
*);
42 // Opaque producer-specific data
47 // Array data description
54 struct ArrowArray
** children
;
55 struct ArrowArray
* dictionary
;
58 void (*release
)(struct ArrowArray
*);
59 // Opaque producer-specific data
63 // EXPERIMENTAL: C stream interface
65 struct ArrowArrayStream
{
66 // Callback to get the stream type
67 // (will be the same for all arrays in the stream).
69 // Return value: 0 if successful, an `errno`-compatible error code otherwise.
71 // If successful, the ArrowSchema must be released independently from the stream.
72 int (*get_schema
)(struct ArrowArrayStream
*, struct ArrowSchema
* out
);
74 // Callback to get the next array
75 // (if no error and the array is released, the stream has ended)
77 // Return value: 0 if successful, an `errno`-compatible error code otherwise.
79 // If successful, the ArrowArray must be released independently from the stream.
80 int (*get_next
)(struct ArrowArrayStream
*, struct ArrowArray
* out
);
82 // Callback to get optional detailed error information.
83 // This must only be called if the last stream operation failed
84 // with a non-0 return code.
86 // Return value: pointer to a null-terminated character array describing
87 // the last error, or NULL if no description is available.
89 // The returned pointer is only valid until the next operation on this stream
90 // (including release).
91 const char* (*get_last_error
)(struct ArrowArrayStream
*);
93 // Release callback: release the stream's own resources.
94 // Note that arrays returned by `get_next` must be individually released.
95 void (*release
)(struct ArrowArrayStream
*);
97 // Opaque producer-specific data