On Fri, 28 Jun 2013 15:52:58 -0400, zMan wrote:
>
>Would you:
>a) Design the API to pass data/length pairs
>b) Use null-terminated strings to keep the C people happy, and have to
>create some sort of layer for languages like COBOL to keep usage from that
>world sane?
>    ...
>
>My contention is that C folks can surely understand the concept of passing
>a length, especially since C validates parameters -- that is, if a C person
>might expect to call
>SOMEFUNCTION(char*, char*)
>
>and instead the function definition is
>SOMEFUNCTION(char*, int*, char*, int*)
>they shouldn't exactly be confused. Surely they understand the *concept* of
>a length.
>
FWIW:

The BPX* z/OS UNIX assembler calls use descriptors.  The C RTL converts
strings and builds descriptors.

I once tried interfacing from a C program to a VMS RTL, designed for the
VAX flavor of FORTRAN.  FORTRAN is VMS's PL/S.  Descriptors.  Not just
address and length, but also type and a few other things in a struct.
It was hellish, even though they provided a mapping macro and constant
defiitions.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to