Ji-Xinyou commented on code in PR #2329: URL: https://github.com/apache/incubator-opendal/pull/2329#discussion_r1229986200
########## bindings/c/include/opendal.h: ########## @@ -311,6 +338,39 @@ bool opendal_metadata_is_file(const opendal_metadata *self); */ bool opendal_metadata_is_dir(const opendal_metadata *self); +/* + Construct a heap-allocated opendal_operator_options + */ +opendal_operator_options opendal_operator_options_new(void); + +/* + Set a Key-Value pair inside opendal_operator_options + + # Safety + + This function is unsafe because it dereferences and casts the raw pointers + Make sure the pointer of `key` and `value` point to a valid string. + + # Example + + ```C + opendal_operator_options options = opendal_operator_options_new(); + opendal_operator_options_set(&options, "root", "/myroot"); + + // .. use your opendal_operator_options + + opendal_operator_options_free(options); + ``` Review Comment: I originally wanted to unify them into pointers, by `#[repr(transparent)]`, but this will cause the doxygen not recognizing the header cbindgen generated. I agree that this is a problem and we should fix this, hence I have created an issue https://github.com/apache/incubator-opendal/issues/2462 here. FYI I am sort of being covered by a hell lot of mess these days 😢 , so it may take a while but not too long. -- 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]
