[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[open-cobol-list] Request For Comments - Driver Program
From: |
Roger While |
Subject: |
[open-cobol-list] Request For Comments - Driver Program |
Date: |
Fri Nov 19 04:35:07 2004 |
I would like to put into CVS a mini driver program equivalent
to MF's "cobrun" and ACU's "runcbl".
This would appear in a new directory "bin".
At the moment I am using the name "cobcrun".
Anybody got suggestions/objections or anything else
regarding the name ?
Here's the minimal source -
#include <stdio.h>
#include <libcob.h>
int
main (int argc, char **argv)
{
int (*func)();
if ( argc <= 1 ) {
fprintf(stderr, "Number of parameters incorrect\n");
return 1;
}
cob_init (argc - 1, &argv[1]);
func = cob_resolve (argv[1]);
if (func == NULL) {
cob_call_error ();
}
return func();
}
This is very useful as it allows a complete application to be compiled as
modules.
(You do not need to figure out what's a main program and what's a module)
The Makefile.am looks like this :
bin_PROGRAMS = cobcrun
cobcrun_SOURCES = cobcrun.c
AM_CFLAGS = -Wall -Wwrite-strings -Wmissing-prototypes -Wno-format-y2k
cobcrun_CFLAGS = $(AM_CFLAGS) $(COBC_CFLAGS) -I$(top_srcdir)
cobcrun_LDFLAGS = $(LIBCOB_LIBS)
cobcrun_LDADD = $(COBC_LIBS) $(top_builddir)/lib/libsupport.a \
$(top_builddir)/libcob/.libs/libcob.a
If there are no objections/other suggestions, I will put bin/cobcrun.c into
CVS.
The configure/make infrastructure will come later as I have a later version
of libtools
than that used for CVS; so the autoconf/automake/aclocal is generating
everything
fresh with a whole bunch of differences that I have to check through.
Roger
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [open-cobol-list] Request For Comments - Driver Program,
Roger While <=