git.delta.rocks / jrsonnet / refs/commits / d86715261b8b

difftreelog

fix(libjsonnet) update to rust 2024

sxswykxuYaroslav Bolyukin2026-05-05parent: #be410fc.patch.diff
in: master

8 files changed

modifiedbindings/jsonnet/src/import.rsdiffbeforeafterboth
107/// # Safety107/// # Safety
108///108///
109/// It should be safe to call `cb` using valid values with passed `ctx`109/// It should be safe to call `cb` using valid values with passed `ctx`
110#[no_mangle]110#[unsafe(no_mangle)]
111pub unsafe extern "C" fn jsonnet_import_callback(111pub unsafe extern "C" fn jsonnet_import_callback(
112 vm: &VM,112 vm: &VM,
113 cb: JsonnetImportCallback,113 cb: JsonnetImportCallback,
123/// # Safety123/// # Safety
124///124///
125/// `path` should be a NUL-terminated string125/// `path` should be a NUL-terminated string
126#[no_mangle]126#[unsafe(no_mangle)]
127pub unsafe extern "C" fn jsonnet_jpath_add(vm: &VM, path: *const c_char) {127pub unsafe extern "C" fn jsonnet_jpath_add(vm: &VM, path: *const c_char) {
128 let cstr = unsafe { CStr::from_ptr(path) };128 let cstr = unsafe { CStr::from_ptr(path) };
129 let path = PathBuf::from(cstr.to_str().unwrap());129 let path = PathBuf::from(cstr.to_str().unwrap());
modifiedbindings/jsonnet/src/interop.rsdiffbeforeafterboth
88
9 use crate::VM;9 use crate::VM;
1010
11 extern "C" {11 unsafe extern "C" {
12
13 pub fn _jrsonnet_static_import_callback(12 pub fn _jrsonnet_static_import_callback(
14 ctx: *mut c_void,13 ctx: *mut c_void,
27 ) -> *mut Val;26 ) -> *mut Val;
28 }27 }
2928
30 #[no_mangle]29 #[unsafe(no_mangle)]
31 #[cfg(feature = "interop-wasm")]30 #[cfg(feature = "interop-wasm")]
32 // ctx arg is passed as-is to callback31 // ctx arg is passed as-is to callback
33 #[allow(clippy::not_unsafe_ptr_arg_deref)]32 #[allow(clippy::not_unsafe_ptr_arg_deref)]
38 /// # Safety37 /// # Safety
39 ///38 ///
40 /// `name` and `raw_params` should be correctly initialized39 /// `name` and `raw_params` should be correctly initialized
41 #[no_mangle]40 #[unsafe(no_mangle)]
42 #[cfg(feature = "interop-wasm")]41 #[cfg(feature = "interop-wasm")]
43 pub unsafe extern "C" fn jrsonnet_apply_static_native_callback(42 pub unsafe extern "C" fn jrsonnet_apply_static_native_callback(
44 vm: &VM,43 vm: &VM,
6463
65 use crate::VM;64 use crate::VM;
6665
67 #[no_mangle]66 #[unsafe(no_mangle)]
68 pub extern "C" fn jrsonnet_set_trace_format(vm: &mut VM, format: u8) {67 pub extern "C" fn jrsonnet_set_trace_format(vm: &mut VM, format: u8) {
69 match format {68 match format {
70 0 => {69 0 => {
105 ///104 ///
106 /// Current thread GC will be broken after this call, need to call105 /// Current thread GC will be broken after this call, need to call
107 /// `jrsonet_enter_thread` before doing anything.106 /// `jrsonet_enter_thread` before doing anything.
108 #[no_mangle]107 #[unsafe(no_mangle)]
109 pub unsafe extern "C" fn jrsonnet_exit_thread() -> *mut ThreadCTX {108 pub unsafe extern "C" fn jrsonnet_exit_thread() -> *mut ThreadCTX {
110 Box::into_raw(Box::new(ThreadCTX {109 Box::into_raw(Box::new(ThreadCTX {
111 interner: jrsonnet_interner::interop::exit_thread(),110 interner: jrsonnet_interner::interop::exit_thread(),
112 gc: unsafe { jrsonnet_gcmodule::interop::exit_thread() },111 gc: unsafe { jrsonnet_gcmodule::interop::exit_thread() },
113 }))112 }))
114 }113 }
115114
116 #[no_mangle]115 #[unsafe(no_mangle)]
117 pub extern "C" fn jrsonnet_reenter_thread(mut ctx: Box<ThreadCTX>) {116 pub extern "C" fn jrsonnet_reenter_thread(mut ctx: Box<ThreadCTX>) {
118 use std::ptr::null_mut;117 use std::ptr::null_mut;
119 assert!(118 assert!(
132 // boxing.131 // boxing.
133 pub enum JrThreadId {}132 pub enum JrThreadId {}
134133
135 #[no_mangle]134 #[unsafe(no_mangle)]
136 pub extern "C" fn jrsonnet_thread_id() -> *mut JrThreadId {135 pub extern "C" fn jrsonnet_thread_id() -> *mut JrThreadId {
137 Box::into_raw(Box::new(std::thread::current().id())).cast()136 Box::into_raw(Box::new(std::thread::current().id())).cast()
138 }137 }
139138
140 #[no_mangle]139 #[unsafe(no_mangle)]
141 pub extern "C" fn jrsonnet_thread_id_compare(140 pub extern "C" fn jrsonnet_thread_id_compare(
142 a: *const JrThreadId,141 a: *const JrThreadId,
143 b: *const JrThreadId,142 b: *const JrThreadId,
147 i32::from(*a == *b)146 i32::from(*a == *b)
148 }147 }
149148
150 #[no_mangle]149 #[unsafe(no_mangle)]
151 pub unsafe extern "C" fn jrsonnet_thread_id_free(id: *mut JrThreadId) {150 pub unsafe extern "C" fn jrsonnet_thread_id_free(id: *mut JrThreadId) {
152 let _id: Box<ThreadId> = unsafe { Box::from_raw(id.cast()) };151 let _id: Box<ThreadId> = unsafe { Box::from_raw(id.cast()) };
153 }152 }
modifiedbindings/jsonnet/src/lib.rsdiffbeforeafterboth
43/// Conforms to [semantic versioning](http://semver.org/).43/// Conforms to [semantic versioning](http://semver.org/).
44/// If this does not match `LIB_JSONNET_VERSION`44/// If this does not match `LIB_JSONNET_VERSION`
45/// then there is a mismatch between header and compiled library.45/// then there is a mismatch between header and compiled library.
46#[no_mangle]46#[unsafe(no_mangle)]
47pub extern "C" fn jsonnet_version() -> &'static [u8; 12] {47pub extern "C" fn jsonnet_version() -> &'static [u8; 12] {
48 b"v0.22.0-rc1\0"48 b"v0.22.0-rc1\0"
49}49}
130}130}
131131
132/// Creates a new Jsonnet virtual machine.132/// Creates a new Jsonnet virtual machine.
133#[no_mangle]133#[unsafe(no_mangle)]
134#[allow(clippy::box_default)]134#[allow(clippy::box_default)]
135pub extern "C" fn jsonnet_make() -> *mut VM {135pub extern "C" fn jsonnet_make() -> *mut VM {
136 let mut state = State::builder();136 let mut state = State::builder();
147}147}
148148
149/// Complement of [`jsonnet_vm_make`].149/// Complement of [`jsonnet_vm_make`].
150#[no_mangle]150#[unsafe(no_mangle)]
151#[allow(clippy::boxed_local)]151#[allow(clippy::boxed_local)]
152pub extern "C" fn jsonnet_destroy(vm: Box<VM>) {152pub extern "C" fn jsonnet_destroy(vm: Box<VM>) {
153 drop(vm);153 drop(vm);
154}154}
155155
156/// Set the maximum stack depth.156/// Set the maximum stack depth.
157#[no_mangle]157#[unsafe(no_mangle)]
158pub extern "C" fn jsonnet_max_stack(_vm: &VM, v: c_uint) {158pub extern "C" fn jsonnet_max_stack(_vm: &VM, v: c_uint) {
159 set_stack_depth_limit(v as usize);159 set_stack_depth_limit(v as usize);
160}160}
161161
162/// Set the number of objects required before a garbage collection cycle is allowed.162/// Set the number of objects required before a garbage collection cycle is allowed.
163///163///
164/// No-op for now164/// No-op for now
165#[no_mangle]165#[unsafe(no_mangle)]
166pub extern "C" fn jsonnet_gc_min_objects(_vm: &VM, _v: c_uint) {}166pub extern "C" fn jsonnet_gc_min_objects(_vm: &VM, _v: c_uint) {}
167167
168/// Run the garbage collector after this amount of growth in the number of objects168/// Run the garbage collector after this amount of growth in the number of objects
169///169///
170/// No-op for now170/// No-op for now
171#[no_mangle]171#[unsafe(no_mangle)]
172pub extern "C" fn jsonnet_gc_growth_trigger(_vm: &VM, _v: c_double) {}172pub extern "C" fn jsonnet_gc_growth_trigger(_vm: &VM, _v: c_double) {}
173173
174/// Expect a string as output and don't JSON encode it.174/// Expect a string as output and don't JSON encode it.
175#[no_mangle]175#[unsafe(no_mangle)]
176pub extern "C" fn jsonnet_string_output(vm: &mut VM, v: c_int) {176pub extern "C" fn jsonnet_string_output(vm: &mut VM, v: c_int) {
177 vm.manifest_format = match v {177 vm.manifest_format = match v {
178 0 => Box::new(JsonFormat::default()),178 0 => Box::new(JsonFormat::default()),
189/// `buf` should be either previosly allocated by this library, or NULL189/// `buf` should be either previosly allocated by this library, or NULL
190///190///
191/// This function is most definitely broken, but it works somehow, see TODO inside191/// This function is most definitely broken, but it works somehow, see TODO inside
192#[no_mangle]192#[unsafe(no_mangle)]
193pub unsafe extern "C" fn jsonnet_realloc(_vm: &VM, buf: *mut u8, sz: usize) -> *mut u8 {193pub unsafe extern "C" fn jsonnet_realloc(_vm: &VM, buf: *mut u8, sz: usize) -> *mut u8 {
194 if buf.is_null() {194 if buf.is_null() {
195 if sz == 0 {195 if sz == 0 {
214/// Clean up a JSON subtree.214/// Clean up a JSON subtree.
215///215///
216/// This is useful if you want to abort with an error mid-way through building a complex value.216/// This is useful if you want to abort with an error mid-way through building a complex value.
217#[no_mangle]217#[unsafe(no_mangle)]
218#[allow(clippy::boxed_local)]218#[allow(clippy::boxed_local)]
219pub extern "C" fn jsonnet_json_destroy(_vm: &VM, v: Box<Val>) {219pub extern "C" fn jsonnet_json_destroy(_vm: &VM, v: Box<Val>) {
220 drop(v);220 drop(v);
221}221}
222222
223/// Set the number of lines of stack trace to display (0 for all of them).223/// Set the number of lines of stack trace to display (0 for all of them).
224#[no_mangle]224#[unsafe(no_mangle)]
225pub extern "C" fn jsonnet_max_trace(vm: &mut VM, v: c_uint) {225pub extern "C" fn jsonnet_max_trace(vm: &mut VM, v: c_uint) {
226 if let Some(format) = vm.trace_format.as_any_mut().downcast_mut::<CompactFormat>() {226 if let Some(format) = vm.trace_format.as_any_mut().downcast_mut::<CompactFormat>() {
227 format.max_trace = v as usize;227 format.max_trace = v as usize;
237/// # Safety237/// # Safety
238///238///
239/// `filename` should be a NUL-terminated string239/// `filename` should be a NUL-terminated string
240#[no_mangle]240#[unsafe(no_mangle)]
241pub unsafe extern "C" fn jsonnet_evaluate_file(241pub unsafe extern "C" fn jsonnet_evaluate_file(
242 vm: &VM,242 vm: &VM,
243 filename: *const c_char,243 filename: *const c_char,
270/// # Safety270/// # Safety
271///271///
272/// `filename`, `snippet` should be a NUL-terminated strings272/// `filename`, `snippet` should be a NUL-terminated strings
273#[no_mangle]273#[unsafe(no_mangle)]
274pub unsafe extern "C" fn jsonnet_evaluate_snippet(274pub unsafe extern "C" fn jsonnet_evaluate_snippet(
275 vm: &VM,275 vm: &VM,
276 filename: *const c_char,276 filename: *const c_char,
330}330}
331331
332/// # Safety332/// # Safety
333#[no_mangle]333#[unsafe(no_mangle)]
334pub unsafe extern "C" fn jsonnet_evaluate_file_multi(334pub unsafe extern "C" fn jsonnet_evaluate_file_multi(
335 vm: &VM,335 vm: &VM,
336 filename: *const c_char,336 filename: *const c_char,
357}357}
358358
359/// # Safety359/// # Safety
360#[no_mangle]360#[unsafe(no_mangle)]
361pub unsafe extern "C" fn jsonnet_evaluate_snippet_multi(361pub unsafe extern "C" fn jsonnet_evaluate_snippet_multi(
362 vm: &VM,362 vm: &VM,
363 filename: *const c_char,363 filename: *const c_char,
412}412}
413413
414/// # Safety414/// # Safety
415#[no_mangle]415#[unsafe(no_mangle)]
416pub unsafe extern "C" fn jsonnet_evaluate_file_stream(416pub unsafe extern "C" fn jsonnet_evaluate_file_stream(
417 vm: &VM,417 vm: &VM,
418 filename: *const c_char,418 filename: *const c_char,
439}439}
440440
441/// # Safety441/// # Safety
442#[no_mangle]442#[unsafe(no_mangle)]
443pub unsafe extern "C" fn jsonnet_evaluate_snippet_stream(443pub unsafe extern "C" fn jsonnet_evaluate_snippet_stream(
444 vm: &VM,444 vm: &VM,
445 filename: *const c_char,445 filename: *const c_char,
modifiedbindings/jsonnet/src/native.rsdiffbeforeafterboth
62/// `name` should be a NUL-terminated string62/// `name` should be a NUL-terminated string
63/// `cb` should be a function pointer63/// `cb` should be a function pointer
64/// `raw_params` should point to a NULL-terminated array of NUL-terminated strings64/// `raw_params` should point to a NULL-terminated array of NUL-terminated strings
65#[no_mangle]65#[unsafe(no_mangle)]
66pub unsafe extern "C" fn jsonnet_native_callback(66pub unsafe extern "C" fn jsonnet_native_callback(
67 vm: &VM,67 vm: &VM,
68 name: *const c_char,68 name: *const c_char,
82 .expect("param name is not utf-8")82 .expect("param name is not utf-8")
83 };83 };
84 params.push(param.into());84 params.push(param.into());
85 raw_params = unsafe { raw_params.offset(1) };85 raw_params = unsafe { raw_params.add(1) };
86 }86 }
8787
88 let any_resolver = vm.state.context_initializer();88 let any_resolver = vm.state.context_initializer();
modifiedbindings/jsonnet/src/val_extract.rsdiffbeforeafterboth
10use crate::VM;10use crate::VM;
1111
12/// If the value is a string, return it as UTF-8, otherwise return `NULL`.12/// If the value is a string, return it as UTF-8, otherwise return `NULL`.
13#[no_mangle]13#[unsafe(no_mangle)]
14pub extern "C" fn jsonnet_json_extract_string(_vm: &VM, v: &Val) -> *mut c_char {14pub extern "C" fn jsonnet_json_extract_string(_vm: &VM, v: &Val) -> *mut c_char {
15 match v {15 match v {
16 Val::Str(s) => {16 Val::Str(s) => {
22}22}
2323
24/// If the value is a number, return `1` and store the number in out, otherwise return `0`.24/// If the value is a number, return `1` and store the number in out, otherwise return `0`.
25#[no_mangle]25#[unsafe(no_mangle)]
26pub extern "C" fn jsonnet_json_extract_number(_vm: &VM, v: &Val, out: &mut c_double) -> c_int {26pub extern "C" fn jsonnet_json_extract_number(_vm: &VM, v: &Val, out: &mut c_double) -> c_int {
27 match v {27 match v {
28 Val::Num(n) => {28 Val::Num(n) => {
34}34}
3535
36/// Return `0` if the value is `false`, `1` if it is `true`, and `2` if it is not a `bool`.36/// Return `0` if the value is `false`, `1` if it is `true`, and `2` if it is not a `bool`.
37#[no_mangle]37#[unsafe(no_mangle)]
38pub extern "C" fn jsonnet_json_extract_bool(_vm: &VM, v: &Val) -> c_int {38pub extern "C" fn jsonnet_json_extract_bool(_vm: &VM, v: &Val) -> c_int {
39 match v {39 match v {
40 Val::Bool(false) => 0,40 Val::Bool(false) => 0,
44}44}
4545
46/// Return `1` if the value is `null`, otherwise return `0`.46/// Return `1` if the value is `null`, otherwise return `0`.
47#[no_mangle]47#[unsafe(no_mangle)]
48pub extern "C" fn jsonnet_json_extract_null(_vm: &VM, v: &Val) -> c_int {48pub extern "C" fn jsonnet_json_extract_null(_vm: &VM, v: &Val) -> c_int {
49 match v {49 match v {
50 Val::Null => 1,50 Val::Null => 1,
modifiedbindings/jsonnet/src/val_make.rsdiffbeforeafterboth
14/// # Safety14/// # Safety
15///15///
16/// `v` should be a NUL-terminated string16/// `v` should be a NUL-terminated string
17#[no_mangle]17#[unsafe(no_mangle)]
18pub unsafe extern "C" fn jsonnet_json_make_string(_vm: &VM, val: *const c_char) -> *mut Val {18pub unsafe extern "C" fn jsonnet_json_make_string(_vm: &VM, val: *const c_char) -> *mut Val {
19 let val = unsafe { CStr::from_ptr(val) };19 let val = unsafe { CStr::from_ptr(val) };
20 let val = val.to_str().expect("string is not utf-8");20 let val = val.to_str().expect("string is not utf-8");
21 Box::into_raw(Box::new(Val::string(val)))21 Box::into_raw(Box::new(Val::string(val)))
22}22}
2323
24/// Convert the given double to a `JsonnetJsonValue`.24/// Convert the given double to a `JsonnetJsonValue`.
25#[no_mangle]25#[unsafe(no_mangle)]
26pub extern "C" fn jsonnet_json_make_number(_vm: &VM, v: c_double) -> *mut Val {26pub extern "C" fn jsonnet_json_make_number(_vm: &VM, v: c_double) -> *mut Val {
27 Box::into_raw(Box::new(Val::Num(27 Box::into_raw(Box::new(Val::Num(
28 NumValue::new(v).expect("jsonnet numbers are finite"),28 NumValue::new(v).expect("jsonnet numbers are finite"),
29 )))29 )))
30}30}
3131
32/// Convert the given `bool` (`1` or `0`) to a `JsonnetJsonValue`.32/// Convert the given `bool` (`1` or `0`) to a `JsonnetJsonValue`.
33#[no_mangle]33#[unsafe(no_mangle)]
34pub extern "C" fn jsonnet_json_make_bool(_vm: &VM, v: c_int) -> *mut Val {34pub extern "C" fn jsonnet_json_make_bool(_vm: &VM, v: c_int) -> *mut Val {
35 assert!(v == 0 || v == 1, "bad boolean value");35 assert!(v == 0 || v == 1, "bad boolean value");
36 Box::into_raw(Box::new(Val::Bool(v == 1)))36 Box::into_raw(Box::new(Val::Bool(v == 1)))
37}37}
3838
39/// Make a `JsonnetJsonValue` representing `null`.39/// Make a `JsonnetJsonValue` representing `null`.
40#[no_mangle]40#[unsafe(no_mangle)]
41pub extern "C" fn jsonnet_json_make_null(_vm: &VM) -> *mut Val {41pub extern "C" fn jsonnet_json_make_null(_vm: &VM) -> *mut Val {
42 Box::into_raw(Box::new(Val::Null))42 Box::into_raw(Box::new(Val::Null))
43}43}
4444
45/// Make a `JsonnetJsonValue` representing an array.45/// Make a `JsonnetJsonValue` representing an array.
46///46///
47/// Assign elements with [`jsonnet_json_array_append`].47/// Assign elements with [`jsonnet_json_array_append`].
48#[no_mangle]48#[unsafe(no_mangle)]
49pub extern "C" fn jsonnet_json_make_array(_vm: &VM) -> *mut Val {49pub extern "C" fn jsonnet_json_make_array(_vm: &VM) -> *mut Val {
50 Box::into_raw(Box::new(Val::arr(())))50 Box::into_raw(Box::new(Val::arr(())))
51}51}
5252
53/// Make a `JsonnetJsonValue` representing an object.53/// Make a `JsonnetJsonValue` representing an object.
54#[no_mangle]54#[unsafe(no_mangle)]
55pub extern "C" fn jsonnet_json_make_object(_vm: &VM) -> *mut Val {55pub extern "C" fn jsonnet_json_make_object(_vm: &VM) -> *mut Val {
56 Box::into_raw(Box::new(Val::Obj(ObjValue::empty())))56 Box::into_raw(Box::new(Val::Obj(ObjValue::empty())))
57}57}
modifiedbindings/jsonnet/src/val_modify.rsdiffbeforeafterboth
14///14///
15/// `arr` should be a pointer to array value allocated by `make_array`, or returned by other library call15/// `arr` should be a pointer to array value allocated by `make_array`, or returned by other library call
16/// `val` should be a pointer to value allocated using this library16/// `val` should be a pointer to value allocated using this library
17#[no_mangle]17#[unsafe(no_mangle)]
18pub unsafe extern "C" fn jsonnet_json_array_append(_vm: &VM, arr: &mut Val, val: &Val) {18pub unsafe extern "C" fn jsonnet_json_array_append(_vm: &VM, arr: &mut Val, val: &Val) {
19 match arr {19 match arr {
20 Val::Arr(old) => {20 Val::Arr(old) => {
38///38///
39/// `obj` should be a pointer to object value allocated by `make_object`, or returned by other library call39/// `obj` should be a pointer to object value allocated by `make_object`, or returned by other library call
40/// `name` should be NUL-terminated string40/// `name` should be NUL-terminated string
41#[no_mangle]41#[unsafe(no_mangle)]
42pub unsafe extern "C" fn jsonnet_json_object_append(42pub unsafe extern "C" fn jsonnet_json_object_append(
43 _vm: &VM,43 _vm: &VM,
44 obj: &mut Val,44 obj: &mut Val,
modifiedbindings/jsonnet/src/vars_tlas.rsdiffbeforeafterboth
13/// # Safety13/// # Safety
14///14///
15/// `name`, `code` should be a NUL-terminated strings15/// `name`, `code` should be a NUL-terminated strings
16#[no_mangle]16#[unsafe(no_mangle)]
17pub unsafe extern "C" fn jsonnet_ext_var(vm: &VM, name: *const c_char, value: *const c_char) {17pub unsafe extern "C" fn jsonnet_ext_var(vm: &VM, name: *const c_char, value: *const c_char) {
18 let name = unsafe { CStr::from_ptr(name) };18 let name = unsafe { CStr::from_ptr(name) };
19 let value = unsafe { CStr::from_ptr(value) };19 let value = unsafe { CStr::from_ptr(value) };
36/// # Safety36/// # Safety
37///37///
38/// `name`, `code` should be a NUL-terminated strings38/// `name`, `code` should be a NUL-terminated strings
39#[no_mangle]39#[unsafe(no_mangle)]
40pub unsafe extern "C" fn jsonnet_ext_code(vm: &VM, name: *const c_char, code: *const c_char) {40pub unsafe extern "C" fn jsonnet_ext_code(vm: &VM, name: *const c_char, code: *const c_char) {
41 let name = unsafe { CStr::from_ptr(name) };41 let name = unsafe { CStr::from_ptr(name) };
42 let code = unsafe { CStr::from_ptr(code) };42 let code = unsafe { CStr::from_ptr(code) };
60/// # Safety60/// # Safety
61///61///
62/// `name`, `value` should be a NUL-terminated strings62/// `name`, `value` should be a NUL-terminated strings
63#[no_mangle]63#[unsafe(no_mangle)]
64pub unsafe extern "C" fn jsonnet_tla_var(vm: &mut VM, name: *const c_char, value: *const c_char) {64pub unsafe extern "C" fn jsonnet_tla_var(vm: &mut VM, name: *const c_char, value: *const c_char) {
65 let name = unsafe { CStr::from_ptr(name) };65 let name = unsafe { CStr::from_ptr(name) };
66 let value = unsafe { CStr::from_ptr(value) };66 let value = unsafe { CStr::from_ptr(value) };
77/// # Safety77/// # Safety
78///78///
79/// `name`, `code` should be a NUL-terminated strings79/// `name`, `code` should be a NUL-terminated strings
80#[no_mangle]80#[unsafe(no_mangle)]
81pub unsafe extern "C" fn jsonnet_tla_code(vm: &mut VM, name: *const c_char, code: *const c_char) {81pub unsafe extern "C" fn jsonnet_tla_code(vm: &mut VM, name: *const c_char, code: *const c_char) {
82 let name = unsafe { CStr::from_ptr(name) };82 let name = unsafe { CStr::from_ptr(name) };
83 let code = unsafe { CStr::from_ptr(code) };83 let code = unsafe { CStr::from_ptr(code) };