```rust
#[no_mangle]

pub unsafe extern "C" fn json_pointer_get(
    mut obj: *mut json_object,
    mut path: *const ::core::ffi::c_char,
    mut res: *mut *mut json_object,
) -> ::core::ffi::c_int {
    let mut path_copy: *mut ::core::ffi::c_char = ::core::ptr::null_mut::<::core::ffi::c_char>();
    let mut rc: ::core::ffi::c_int = 0;
    if obj.is_null() || path.is_null() {
        *__errno_location() = EINVAL;
        return -(1 as ::core::ffi::c_int);
    }
    if *path.offset(0 as ::core::ffi::c_int as isize) as ::core::ffi::c_int == '\0' as i32 {
        if !res.is_null() {
            *res = obj;
        }
        return 0 as ::core::ffi::c_int;
    }
    /* pass a working copy to the recursive call */
    path_copy = strdup(path);
    if path_copy.is_null() {
        *__errno_location() = ENOMEM;
        return -(1 as ::core::ffi::c_int);
    }
    rc = json_pointer_get_recursive(obj, path_copy, res);
    free(path_copy as *mut ::core::ffi::c_void);
    return rc;
}
```