Skip to main content

obj_open

Function obj_open 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn obj_open( path: *const c_char, out_db: *mut *mut obj_db_t, ) -> obj_error_t
Expand description

Open or create a file-backed database at path. Default configuration (obj_engine::Config::default).

On success: *out_db is set to a newly-allocated obj_db_t (caller must free via obj_close) and OBJ_OK is returned. On failure: *out_db is set to NULL and an error code is returned.

ยงSafety

  • path must be a non-null pointer to a NUL-terminated UTF-8 string. The pointee is read but not retained.
  • out_db must be a non-null pointer to a writable obj_db_t*. The pointee is unconditionally written before return (NULL on failure).