@@ -100,7 +100,11 @@ static MonoArray* stdb_buffer_consume(Buffer buf);
100100// return out;
101101// }
102102
103- __attribute__((import_module ("spacetime" ),
103+ #define STDB_ABI_MAJOR_VERSION 5
104+ #define STDB_IMPORT_MODULE_MINOR (minor ) ("spacetime_" #STDB_ABI_MAJOR_VERSION "." #minor)
105+ #define STDB_IMPORT_MODULE STDB_IMPORT_MODULE_MINOR(0)
106+
107+ __attribute__((import_module (STDB_IMPORT_MODULE ),
104108 import_name ("_get_table_id" ))) extern uint16_t
105109_get_table_id (const char * name , size_t name_len , uint32_t * out );
106110
@@ -117,7 +121,7 @@ static uint32_t stdb_get_table_id(MonoString* name_) {
117121 return out ;
118122}
119123
120- __attribute__((import_module ("spacetime" ),
124+ __attribute__((import_module (STDB_IMPORT_MODULE ),
121125 import_name ("_create_index" ))) extern uint16_t
122126_create_index (const char * index_name ,
123127 size_t index_name_len ,
@@ -141,7 +145,7 @@ static void stdb_create_index(MonoString* index_name_,
141145 check_result (result );
142146}
143147
144- __attribute__((import_module ("spacetime" ),
148+ __attribute__((import_module (STDB_IMPORT_MODULE ),
145149 import_name ("_iter_by_col_eq" ))) extern uint16_t
146150_iter_by_col_eq (uint32_t table_id ,
147151 uint32_t col_id ,
@@ -163,7 +167,7 @@ static MonoArray* stdb_iter_by_col_eq(uint32_t table_id,
163167 return stdb_buffer_consume (out );
164168}
165169
166- __attribute__((import_module ("spacetime" ),
170+ __attribute__((import_module (STDB_IMPORT_MODULE ),
167171 import_name ("_insert" ))) extern uint16_t
168172_insert (uint32_t table_id , uint8_t * row , size_t row_len );
169173
@@ -175,7 +179,7 @@ static void stdb_insert(uint32_t table_id, MonoArray* row_) {
175179 check_result (result );
176180}
177181
178- // __attribute__((import_module("spacetime" ),
182+ // __attribute__((import_module(STDB_IMPORT_MODULE ),
179183// import_name("_delete_pk"))) extern uint16_t
180184// _delete_pk(uint32_t table_id, const uint8_t* pk, size_t pk_len);
181185
@@ -187,7 +191,7 @@ static void stdb_insert(uint32_t table_id, MonoArray* row_) {
187191// check_result(result);
188192// }
189193
190- // __attribute__((import_module("spacetime" ),
194+ // __attribute__((import_module(STDB_IMPORT_MODULE ),
191195// import_name("_delete_value"))) extern uint16_t
192196// _delete_value(uint32_t table_id, const uint8_t* row, size_t row_len);
193197
@@ -199,7 +203,7 @@ static void stdb_insert(uint32_t table_id, MonoArray* row_) {
199203// check_result(result);
200204// }
201205
202- __attribute__((import_module ("spacetime" ),
206+ __attribute__((import_module (STDB_IMPORT_MODULE ),
203207 import_name ("_delete_by_col_eq" ))) extern uint16_t
204208_delete_by_col_eq (uint32_t table_id ,
205209 uint32_t col_id ,
@@ -221,7 +225,7 @@ static uint32_t stdb_delete_by_col_eq(uint32_t table_id,
221225 return out ;
222226}
223227
224- // __attribute__((import_module("spacetime" ),
228+ // __attribute__((import_module(STDB_IMPORT_MODULE ),
225229// import_name("_delete_range"))) extern uint16_t
226230// _delete_range(uint32_t table_id,
227231// uint32_t col_id,
@@ -248,7 +252,7 @@ static uint32_t stdb_delete_by_col_eq(uint32_t table_id,
248252// return out;
249253// }
250254
251- __attribute__((import_module ("spacetime" ),
255+ __attribute__((import_module (STDB_IMPORT_MODULE ),
252256 import_name ("_iter_start" ))) extern uint16_t
253257_iter_start (uint32_t table_id , BufferIter * out );
254258
@@ -258,7 +262,7 @@ static void stdb_iter_start(uint32_t table_id, BufferIter* iter) {
258262 check_result (result );
259263}
260264
261- __attribute__((import_module ("spacetime" ),
265+ __attribute__((import_module (STDB_IMPORT_MODULE ),
262266 import_name ("_iter_start_filtered" ))) extern uint16_t
263267_iter_start_filtered (uint32_t table_id ,
264268 const uint8_t * filter ,
@@ -276,7 +280,7 @@ static void stdb_iter_start_filtered(uint32_t table_id,
276280 check_result (result );
277281}
278282
279- __attribute__((import_module ("spacetime" ),
283+ __attribute__((import_module (STDB_IMPORT_MODULE ),
280284 import_name ("_iter_next" ))) extern uint16_t
281285_iter_next (BufferIter iter , Buffer * out );
282286
@@ -289,7 +293,7 @@ static MonoArray* stdb_iter_next(BufferIter iter) {
289293 return stdb_buffer_consume (out );
290294}
291295
292- __attribute__((import_module ("spacetime" ),
296+ __attribute__((import_module (STDB_IMPORT_MODULE ),
293297 import_name ("_iter_drop" ))) extern uint16_t
294298_iter_drop (BufferIter iter );
295299
@@ -307,7 +311,7 @@ static void stdb_iter_drop(BufferIter* iter) {
307311 check_result (result );
308312}
309313
310- __attribute__((import_module ("spacetime" ),
314+ __attribute__((import_module (STDB_IMPORT_MODULE ),
311315 import_name ("_console_log" ))) extern void
312316_console_log (uint8_t level ,
313317 const char * target ,
@@ -335,7 +339,7 @@ static void stdb_console_log(MonoString* text_,
335339 free_string (filename );
336340}
337341
338- __attribute__((import_module ("spacetime" ),
342+ __attribute__((import_module (STDB_IMPORT_MODULE ),
339343 import_name ("_schedule_reducer" ))) extern void
340344_schedule_reducer (const char * name ,
341345 size_t name_len ,
@@ -360,19 +364,19 @@ static void stdb_schedule_reducer(
360364 free_string (name );
361365}
362366
363- __attribute__((import_module ("spacetime" ),
367+ __attribute__((import_module (STDB_IMPORT_MODULE ),
364368 import_name ("_cancel_reducer" ))) extern void
365369_cancel_reducer (ScheduleToken token );
366370
367371static void stdb_cancel_reducer (ScheduleToken * token ) {
368372 _cancel_reducer (* token );
369373}
370374
371- __attribute__((import_module ("spacetime" ),
375+ __attribute__((import_module (STDB_IMPORT_MODULE ),
372376 import_name ("_buffer_len" ))) extern size_t
373377_buffer_len (Buffer buf );
374378
375- __attribute__((import_module ("spacetime" ),
379+ __attribute__((import_module (STDB_IMPORT_MODULE ),
376380 import_name ("_buffer_consume" ))) extern void
377381_buffer_consume (Buffer buf , uint8_t * into , size_t len );
378382
@@ -387,7 +391,7 @@ static MonoArray* stdb_buffer_consume(Buffer buf) {
387391 return result ;
388392}
389393
390- __attribute__((import_module ("spacetime" ),
394+ __attribute__((import_module (STDB_IMPORT_MODULE ),
391395 import_name ("_buffer_alloc" ))) extern Buffer
392396_buffer_alloc (const uint8_t * data , size_t data_len );
393397
0 commit comments