Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-bridge/blob/main/tests/native/v2/dev/multi.c # omega-bridge Omega-first language interoperability: checked conversion backends and native language bindings Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-bridge / tests / native / v2 / dev / multi.c` 31 lines ยท 1473 bytes Raw Blame History 1 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 2 #include "omega_native.h" 3 #include 4 #include 5 #include 6 7 int main(void) { 8 omega_native_context *a = NULL, *b = NULL; 9 uint64_t handle = 0, ordinary = 0, result = 99; 10 assert(omega_native_context_create(1, &a) == 0); 11 assert(omega_native_context_create(1, &b) == 0); 12 assert(omega2_ctx_newmap(a, &handle) == 0 && (int64_t)handle > 0); 13 assert(omega2_ctx_putmap(a, &result, handle, 7) == 0 && result == 0); 14 assert(omega2_ctx_readmap(a, &result, handle) == 0 && result == 7); 15 result = 99; 16 assert(omega2_ctx_readmap(b, &result, handle) == 3 && result == 99); 17 assert(omega_native_context_destroy(a) == 36); 18 19 assert(omega2_newmap(&ordinary) == 0 && (int64_t)ordinary > 0); 20 assert(omega2_putmap(&result, ordinary, 9) == 0 && result == 0); 21 assert(omega2_readmap(&result, ordinary) == 0 && result == 9); 22 result = 99; 23 assert(omega2_ctx_readmap(a, &result, ordinary) == 3 && result == 99); 24 assert(omega2_readmap(&result, handle) == 3 && result == 99); 25 assert(omega2_dropmap(&result, ordinary) == 0 && result == 0); 26 assert(omega2_ctx_dropmap(a, &result, handle) == 0 && result == 0); 27 assert(omega_native_context_destroy(a) == 0); 28 assert(omega_native_context_destroy(b) == 0); 29 puts("NATIVE-MULTI-UNIT PASS three Omega inputs, one library, shared default/explicit contexts and foreign-handle refusals"); 30 return 0; 31 }