[Info-vax] Any Way to Pass Arrays of Strings from C to Basic?
Bob Gezelter
gezelter at rlgsc.com
Fri Nov 8 09:48:32 EST 2019
On Friday, November 8, 2019 at 8:16:44 AM UTC-5, Simon Clubley wrote:
> On 2019-11-07, Dave Froble <davef at tsoft-inc.com> wrote:
> > On 11/7/2019 11:40 AM, seasoned_geek wrote:
> >> The only portion which
> >> needed to be in C was the piece which originally called Xerces XML
> >> parser which was, at the time heavily supported by IBM. There was a
> >> correct decision all XML parsing should be done by an industry
> >> standard library.
> >
> > A while back we looked at several XML parsers. When done looking, we
> > looked at each other and basically said WTF? The products would test
> > some XML for matching tag pairs, but nothing else we could see. One
> > thing they didn't do was parse out the actual data that we needed.
> > That, we still had to custom program. Have to wonder just what these
> > bloatware products are good for? Nothing we could see or justify.
> >
> > Note, perhaps there may be products that actually extract your data, but
> > we never saw one.
> >
>
> Are you sure you are not confusing a XML validator with a XML parser ?
>
> There are two basic types of XML parser I am aware of.
>
> The first one, the SAX style parser, calls back into a handler you
> declare when an event (such as tag start seen, text seen, etc) occurs
> during parsing.
>
> The second one, the DOM style parser, parses the entire XML document
> at once and places it in a DOM style tree which you can then pull
> bits out of as required.
>
> BTW, I don't know DEC Basic. Can you _directly_ call into a DEC BASIC
> function from a C language routine and if so, are there limits on
> what can be passed from the C routine into the DEC BASIC routine ?
>
> If there are not, then I don't see why you can't just use one of
> the various C language SAX parsers and register your BASIC function
> as the callback handler if you didn't want to bother with one of
> the DOM style parsers.
>
> Simon.
>
> --
> Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
> Walking destinations on a map are further away than they appear.
Simon,
Been there, done that. In a variety of language combinations, some involving BASIC, some not.
There are two basic categories of issues:
- language RTL initialization; and
- headers/bindings
Some language RTLs presume, throjugh one path or another, that the INIT routines have been called. This is easily remedied, but may require some research to determine the right routines to invoke.
Defining the headers is a question of determining what parameter lists look like and writing the necessary declarations. Most, if not all of the OpenVMAS languages have the necessary facilities to define the needed interfaces, but it can be a tedious task.
C to/from BASIC can be tedious, but it is quite doable. The biggest nuisance is that BASIC is more demanding of supplied parameter lists than C is. BASIC will actually check the count and types of parameters, even if not used.
- Bob Gezelter, http://www.rlgsc.com
More information about the Info-vax
mailing list