xmos / lib_random

Random number generation
Other
1 stars 8 forks source link

Missing C API #12

Open mbanth opened 3 years ago

mbanth commented 3 years ago

The api/random.h header file defines a REFERENCE_PARAM macro to define some function parameters as either C pointers or XC references. In this way, the repository sets itself up to support a C API.

However, the only implementation of that API resides in the src/random.xc file. This file explicitly uses XC references in its function signatures. In addition, due to the .xc extension on the source file, the xcc compiler assumes that it contains XC unless overridden by the -x option.

To provide a proper C API, this repository needs an random.c file containing a pure C implementation.

xross commented 3 weeks ago

Using REFERENCE_PARAM should mean it's callable from c, regardless of the implementation language.