gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[open-cobol-list] user generated final bindings, more day dreaming


From: Patrick
Subject: [open-cobol-list] user generated final bindings, more day dreaming
Date: Sun, 30 Jun 2013 10:22:58 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6

Hi Everyone

I find writing bindings difficult. I have never been able to write anything reusable by others, only for myself.

structs are tough to work with from outside of C, at least for me and other types can be annoying like enumerations, in that you have to figure out the int they represent.

We have a language that plays well with C but we also have a small community and not enough manpower to write a lot of bindings.

I am day dreaming about another approach.

What if I made a .c file that had what was need to use a library, various function calls and such but I placed markers through it. These markers would be substituted out by binding generated program, based on the input from a developer.

so a little pseudo code:

some_function(tricky_struct[i]->some_func(%%SOME_MARKER-NAME), some_easy_int )

The developer enters foo as the value of %%SOME_MARKER_NAME and after binding program it looks like:


cob_some_function(some_easy_int)
{     
some_function(tricky_struct[i]->some_func(foo, some_easy_int) 
}


The emitted C file could then be compiled and linked into the application by the developer.

The harder part would be hard wired into the one-off binding based on user input but the easier part would not be and would be callable from Cobol.

I am sure there will be many cases were this just isn't enough and the hard part is just too variable and vital but it might help a lot of the time, especially for smaller libraries.

Seem logical?

Happy Canada Day to Brian


reply via email to

[Prev in Thread] Current Thread [Next in Thread]