Browse Prior Art Database

APL2 Calling C Routines that use Double Referencing Parameters

IP.com Disclosure Number: IPCOM000109009D
Original Publication Date: 1992-Jul-01
Included in the Prior Art Database: 2005-Mar-23
Document File: 2 page(s) / 61K

Publishing Venue

IBM

Related People

Beaty, KA: AUTHOR [+2]

Abstract

C functions often have the need to return more than a single character string. In the C environment this is normally accomplished by providing an address of a storage location for each additional string to be returned as part of the function argument list, and the called function can then set these storage locations to point to the strings to be returned. This disclosure describes how this can be accommodated when calling the same C routine from APL2*.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 60% of the total text.

APL2 Calling C Routines that use Double Referencing Parameters

       C functions often have the need to return more than a
single character string.  In the C environment this is normally
accomplished by providing an address of a storage location for each
additional string to be returned as part of the function argument
list, and the called function can then set these storage locations to
point to the strings to be returned.  This disclosure describes how
this can be accommodated when calling the same C routine from APL2*.

      Graphically, the situation can be illustrated by:

                            (Image Omitted)

      Calling functions that use this type of double referencing from
APL2 present a problem, in that the call process needs to manage
these intermediary storage pointers as well as building the argument
list.  The problem narrows down to being able to cater to the above
efficiently as well as avoiding the risk of storage fragmentation by
allocating lots of little chunks of storage.

      Both problems can be solved by determining how much space is
needed to store the intermediary pointers, and then to tack on this
additional space requirement onto the end of the argument list.  This
way, only a single storage allocation is needed, yielding an
efficient scheme as well as avoiding storage fragmentation.  The
picture from above therefore changes to:

      Note that this does not interface with the use o...