On Friday 08 September 2006 03:38, Leopold Toetsch wrote:
> typical socket ocde currently looks a bit unfriendly due to magic
> constants, e.g.
>
>     socket sock, 2, 1, 6      # PF_INET, SOCK_STREAM, tcp
>
> I'd like to have symbolic constants for all that stuff:
>
>     socket sock .PF_INET, .SOCK_STREAM, .PROTO_tcp
>
> Appended is a C snippet, which produces such constants[1]. It's incomplete
> and not integegrated in Configure/make at all, but maybe it is a starting
> point.
>
> Q: is there a better option to generate these constants?

It'd sure be nice to have a PGE/TGE parser that could understand C header 
files and generate static NCI code.  (That is, don't make the FFI mistake of 
parsing the header files every time you run the program that uses them.)

-- c

Reply via email to