MCPcopy Create free account
hub / github.com/apache/paimon-rust / paimon_identifier_new

Function paimon_identifier_new

bindings/c/src/identifier.rs:31–60  ·  view source on GitHub ↗
(
    database: *const c_char,
    object: *const c_char,
)

Source from the content-addressed store, hash-verified

29/// `database` and `object` must be valid null-terminated C strings, or null (returns error).
30#[no_mangle]
31pub unsafe extern "C" fn paimon_identifier_new(
32 database: *const c_char,
33 object: *const c_char,
34) -> paimon_result_identifier_new {
35 let db = match validate_cstr(database, "database") {
36 Ok(s) => s,
37 Err(e) => {
38 return paimon_result_identifier_new {
39 identifier: std::ptr::null_mut(),
40 error: e,
41 }
42 }
43 };
44 let obj = match validate_cstr(object, "object") {
45 Ok(s) => s,
46 Err(e) => {
47 return paimon_result_identifier_new {
48 identifier: std::ptr::null_mut(),
49 error: e,
50 }
51 }
52 };
53 let wrapper = Box::new(paimon_identifier {
54 inner: Box::into_raw(Box::new(Identifier::new(db, obj))) as *mut c_void,
55 });
56 paimon_result_identifier_new {
57 identifier: Box::into_raw(wrapper),
58 error: std::ptr::null_mut(),
59 }
60}
61
62/// Free a paimon_identifier.
63///

Callers

nothing calls this directly

Calls 1

validate_cstrFunction · 0.85

Tested by

no test coverage detected