[][src]Type Definition gojsonnet_sys::JsonnetImportCallback

type JsonnetImportCallback = Option<unsafe extern "C" fn(ctx: *mut c_void, base: *const c_char, rel: *const c_char, found_here: *mut *mut c_char, success: *mut c_int) -> *mut c_char>;

Callback used to load imports.

The returned char* should be allocated with jsonnet_realloc. It will be cleaned up by libjsonnet when no-longer needed.

\param ctx User pointer, given in jsonnet_import_callback. \param base The directory containing the code that did the import. \param rel The path imported by the code. \param found_here Set this byref param to path to the file, absolute or relative to the process's CWD. This is necessary so that imports from the content of the imported file can be resolved correctly. Allocate memory with jsonnet_realloc. Only use when *success = 1. \param success Set this byref param to 1 to indicate success and 0 for failure. \returns The content of the imported file, or an error message.