Function load_snippet_ffi

Source
#[no_mangle]
pub extern "C" fn load_snippet_ffi(name: *const c_char) -> *mut c_char
Expand description

Loads a snippet by name and returns its JSON representation.

§Arguments

  • name: A null-terminated C string representing the name of the snippet.

§Returns

A newly allocated C string (*mut c_char) containing the snippet’s JSON representation.

  • On success: JSON-encoded Snippet as a C string (must be freed with free_string_ffi).
  • On failure: JSON-encoded error object (must also be freed).

§Safety

  • name must be a valid, null-terminated UTF-8 string.
  • Caller is responsible for freeing the returned string using free_string_ffi.