from libc.stdint cimport *
from ctime cimport time_t, timespec
+cimport libcpp
cdef extern from "rados/librados.h":
enum:
int rbd_snap_unprotect(rbd_image_t image, const char *snap_name)
int rbd_snap_is_protected(rbd_image_t image, const char *snap_name,
int *is_protected)
- int rbd_snap_exists(rbd_image_t image, const char *snapname, bint *exists)
+ int rbd_snap_exists(rbd_image_t image, const char *snapname, libcpp.bool *exists)
int rbd_snap_get_limit(rbd_image_t image, uint64_t *limit)
int rbd_snap_set_limit(rbd_image_t image, uint64_t limit)
int rbd_snap_get_timestamp(rbd_image_t image, uint64_t snap_id, timespec *timestamp)
int rbd_namespace_list(rados_ioctx_t io, char *namespace_names,
size_t *size)
int rbd_namespace_exists(rados_ioctx_t io, const char *namespace_name,
- bint *exists)
+ libcpp.bool *exists)
int rbd_pool_init(rados_ioctx_t, bint force)
from libc.stdint cimport *
from ctime cimport time_t, timespec
+# Make the bool type available as libcpp.bool, for both C and C++.
+cimport libcpp
+cdef extern from "<stdbool.h>":
+ pass
+
cdef nogil:
enum:
_LIBRADOS_SNAP_HEAD "LIBRADOS_SNAP_HEAD"
int rbd_snap_is_protected(rbd_image_t image, const char *snap_name,
int *is_protected):
pass
- int rbd_snap_exists(rbd_image_t image, const char *snapname, bint *exists):
+ int rbd_snap_exists(rbd_image_t image, const char *snapname, libcpp.bool *exists):
pass
int rbd_snap_get_limit(rbd_image_t image, uint64_t *limit):
pass
size_t *size):
pass
int rbd_namespace_exists(rados_ioctx_t io, const char *namespace_name,
- bint *exists):
+ libcpp.bool *exists):
pass
int rbd_pool_init(rados_ioctx_t io, bint force):
pass
from libc.stdint cimport *
from libc.stdlib cimport malloc, realloc, free
from libc.string cimport strdup, memset
+cimport libcpp
try:
from collections.abc import Iterable
cdef:
rados_ioctx_t _ioctx = convert_ioctx(ioctx)
const char *_name = name
- bint _exists = False
+ libcpp.bool _exists = False
with nogil:
ret = rbd_namespace_exists(_ioctx, _name, &_exists)
if ret != 0:
raise make_ex(ret, 'error verifying namespace')
- return bool(_exists != 0)
+ return _exists
def namespace_list(self, ioctx):
"""
name = cstr(name, 'name')
cdef:
char *_name = name
- bint _exists = False
+ libcpp.bool _exists = False
with nogil:
ret = rbd_snap_exists(self.image, _name, &_exists)
if ret != 0:
raise make_ex(ret, 'error getting snapshot exists for %s' % self.name)
- return bool(_exists != 0)
+ return _exists
@requires_not_closed
def get_snap_limit(self):
# cython: embedsignature=True
+# Make the bool type available as libcpp.bool, for both C and C++.
+cimport libcpp
+cdef extern from "<stdbool.h>":
+ pass
+
cdef nogil:
ctypedef void* librgw_t
int rgw_readdir(rgw_fs *fs,
rgw_file_handle *parent_fh, uint64_t *offset,
- bint (*cb)(const char *name, void *arg, uint64_t offset, stat *st, uint32_t st_mask, uint32_t flags) nogil except? -9000,
- void *cb_arg, bint *eof, uint32_t flags) except? -9000:
+ libcpp.bool (*cb)(const char *name, void *arg, uint64_t offset, stat *st, uint32_t st_mask, uint32_t flags) nogil except? -9000,
+ void *cb_arg, libcpp.bool *eof, uint32_t flags) except? -9000:
pass
int rgw_getattr(rgw_fs *fs,
from libc.stdint cimport *
from libc.stdlib cimport malloc, realloc, free
from cstat cimport stat
+cimport libcpp
IF BUILD_DOC:
include "mock_rgw.pxi"
cdef:
rgw_file_handle *_dir_handler = <rgw_file_handle*>dir_handler.handler
uint64_t _offset = offset
- bint _eof
+ libcpp.bool _eof
uint32_t _flags = flags
with nogil:
ret = rgw_readdir(self.fs, _dir_handler, &_offset, &readdir_cb,