Is your feature request related to a problem? Please describe.
When writing external Libraries in different languages, we have to write the interfaces by hand. It would be good if we could simply generate the given C header file for a given PLC project.
Describe the solution you'd like
Using a new command like plc generate ffi -o header.h we could generate headers for the project.
The command will generate a C header in header.h. If no output is provided, it will be output on stdout.
The documentation should be updated to reflect how to create external libraries.
We should define a C standard for the definition, and use appropriate data types.
I suggest we use the fixed size integer types from C99 defined in stdint.h
The double_tand float_ttypes from math.h
The char8_t and char16_t from wchar.h (C11) for CHAR and STRING types.
Describe alternatives you've considered
Writing headers by hand.
Is your feature request related to a problem? Please describe. When writing external Libraries in different languages, we have to write the interfaces by hand. It would be good if we could simply generate the given C header file for a given PLC project.
Describe the solution you'd like Using a new command like
plc generate ffi -o header.h
we could generate headers for the project. The command will generate a C header inheader.h
. If no output is provided, it will be output on stdout.The documentation should be updated to reflect how to create external libraries. We should define a C standard for the definition, and use appropriate data types.
I suggest we use the fixed size integer types from C99 defined in
stdint.h
Thedouble_t
andfloat_t
types frommath.h
Thechar8_t
andchar16_t
fromwchar.h
(C11) forCHAR
andSTRING
types.Describe alternatives you've considered Writing headers by hand.