Ji-Xinyou commented on code in PR #2249:
URL:
https://github.com/apache/incubator-opendal/pull/2249#discussion_r1189530462
##########
bindings/c/include/opendal.h:
##########
@@ -234,11 +261,56 @@ struct opendal_result_read
opendal_operator_blocking_read(opendal_operator_ptr o
struct opendal_result_is_exist opendal_operator_is_exist(opendal_operator_ptr
op_ptr,
const char *path);
+/*
+ Stat the path, return its metadata.
+
+ If the operation succeeds, no matter the path exists or not,
+ the error code should be opendal_code::OPENDAL_OK. Otherwise,
+ the field `meata` is filled with a NULL pointer, and the error code
+ is set correspondingly.
+
+ # Safety
+
+ It is [safe] under the cases below
+ * The memory pointed to by `path` must contain a valid nul terminator at the
end of
+ the string.
+
+ # Panic
+
+ * If the `path` points to NULL, this function panics
+ */
+struct opendal_result_stat opendal_operator_stat(opendal_operator_ptr op_ptr,
const char *path);
+
+/*
+ Free the allocated operator pointed by [`opendal_operator_ptr`]
+ */
+void opendal_operator_free(const opendal_operator_ptr *self);
+
/*
Frees the heap memory used by the [`opendal_bytes`]
*/
void opendal_bytes_free(const struct opendal_bytes *self);
+/*
+ Free the allocated metadata
+ */
+void opendal_meta_free(const opendal_metadata *self);
Review Comment:
> I perfer keep origin name: `opendal_metadata_free`
Cool ;)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]