Packages

Interfaces Elixir with C/C++ code in a user-friendly way! Based on Erlang-ports. Provides a few Mix-tasks to kickstart the development process.

Current section

Files

Jump to
cure c_src elixir_comm.h
Raw

c_src/elixir_comm.h

#ifndef ELIXIR_COMM_H
#define ELIXIR_COMM_H
#ifdef __cplusplus
extern "C" {
#endif
#define MAX_BUFFER_SIZE 65535
typedef char byte;
/*
* Reads a message coming from Erlang/Elixir from stdin.
* Returns the number of bytes read (-1 on error), fills the buffer with data.
*/
int read_msg(byte* buffer);
/*
* Sends a message to Erlang/Elixir via stdout.
*/
void send_msg(byte* buffer, int length);
/*
* Helper function to send an error message back to Erlang/Elixir.
* The message has to be a string that terminates with \0.
*/
void send_error(byte* error_message);
#ifdef __cplusplus
}
#endif
#endif