Cotton code
30 lines · 864 B · CRaw
/* * The C ABI of crates/cotton-mac-ffi, the core the Mac app Cotton links. * Written by hand; tests/header.rs fails when a function here and in * src/lib.rs stop agreeing. * * Every answer is UTF-8 JSON with `ok: true|false` (failures carry `error` * and `code`), returned as a heap string the caller releases with * cotton_mac_free. Calls may come from any thread. */#ifndef COTTON_MAC_FFI_H#define COTTON_MAC_FFI_H#ifdef __cplusplusextern "C" {#endif/* Open the one App from its camelCase Config JSON. */char *cotton_mac_open(const char *config_json);/* One method on the open App; args_json may be NULL. */char *cotton_mac_call(const char *method, const char *args_json);/* Release a string the two functions above returned. NULL is ignored. */void cotton_mac_free(char *ptr);#ifdef __cplusplus}#endif#endif /* COTTON_MAC_FFI_H */