```rust
unsafe extern "C" fn json_pointer_set_single_path(
    mut parent: *mut json_object,
    mut path: *const ::core::ffi::c_char,
    mut value: *mut json_object,
) -> ::core::ffi::c_int {
    if json_object_is_type(parent, json_type_array) != 0 {
        let mut idx: int32_t = 0;
        /* RFC (Chapter 4) states that '-' may be used to add new elements to an array */
        if *path.offset(0 as ::core::ffi::c_int as isize) as ::core::ffi::c_int == '-' as i32
            && *path.offset(1 as ::core::ffi::c_int as isize) as ::core::ffi::c_int == '\0' as i32
        {
            return json_object_array_add(parent, value);
        }
        if is_valid_index(parent, path, &raw mut idx) == 0 {
            return -(1 as ::core::ffi::c_int);
        }
        return json_object_array_put_idx(parent, idx as size_t, value);
    }

    /* path replacements should have been done in json_pointer_get_single_path(),
       and we should still be good here */
    if json_object_is_type(parent, json_type_object) != 0 {
        return json_object_object_add(parent, path, value);
    }

    /* Getting here means that we tried to "dereference" a primitive JSON type (like string, int, bool).
       i.e. add a sub-object to it */
    *__errno_location() = ENOENT;
    return -(1 as ::core::ffi::c_int);
}
```