interplane.Get Omega
Read in your language

omega-bridge

Omega-first language interoperability: checked conversion backends and native language bindings

Brought by drakestapleton

branch main Branches Tags History

omega-bridge / tests / native / g1 / caller.c

16 lines · 486 bytes Raw Blame History
1/* C caller for the G1 sample calc: reads "i0 i1" lines, prints "i0 i1 status result" per line. */
2#include <inttypes.h>
3#include <stdio.h>
4
5#include "omega_native.h" /* generated by tools/native, nothing typed by hand */
6
7int main(void)
8{
9 uint64_t a, b;
10 while (scanf("%" SCNu64 " %" SCNu64, &a, &b) == 2) {
11 uint64_t r = 0;
12 uint32_t s = omega_calc(&r, a, b);
13 printf("%" PRIu64 " %" PRIu64 " %" PRIu32 " %" PRIu64 "\n", a, b, s, r);
14 }
15 return 0;
16}