× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello Walden,

You wrote:
>Where did you find out about the TERASPACE__ define?

Nowhere.  That's just my version of the __TERASPACE__ define used in the C
include for stdlib since RPG IV doesn't allow names beginning with
underscores.  Its only effect is to change the EXTPROC associated with the
various storage allocation functions.

>Also, what's in your STDLIB include?

An RPG IV version of all the stuff that is in the C stdlib . . .  but
that's not really what you were asking is it?  Here is an excerpt from my
STDLIB that contains the definitions you need.

*========================================================================*
      * Allocate and initialise storage for an array
*
      *                void    *calloc   ( size_t, size_t );
*

*========================================================================*
             D calloc          PR                  LIKE(pointer_t)
 @A1A  /if defined(TERASPACE__)
 @A1A D                                     EXTPROC('_C_TS_calloc')
 @A1A  /else
      D                                     EXTPROC('calloc')
 @A1A  /endif
       *
       * Required parameter group:
       *                             Number of elements to allocate
      D   nbrElem                           LIKE(size_t) VALUE
       *                             Size of each element
      D   size                              LIKE(size_t) VALUE


*========================================================================*
       * Release allocated storage
*
       *                void     free     ( void * );
*

*========================================================================*
      D free            PR
 @A1A  /if defined(TERASPACE__)
 @A1A D                                     EXTPROC('_C_TS_free')
 @A1A  /else
      D                                     EXTPROC('free')
 @A1A  /endif
       *
       * Required parameter group:
       *                             Address of storage to release
      D   stgPtr                            LIKE(pointer_t) VALUE


*========================================================================*
       * Allocate and initialise storage block
*
       *                void    *malloc   ( size_t );
*

*========================================================================*
      D malloc          PR                  LIKE(pointer_t)
 @A1A  /if defined(TERASPACE__)
 @A1A D                                     EXTPROC('_C_TS_malloc')
 @A1A  /else
      D                                     EXTPROC('malloc')
 @A1A  /endif
       *
       * Required parameter group:
       *                             Size of storage to allocate
      D   size                              LIKE(size_t) VALUE


*========================================================================*
       * Change allocated storage block size
*
       *                void    *realloc  ( void *, size_t );
*

*========================================================================*
      D realloc         PR                  LIKE(pointer_t)
 @A1A  /if defined(TERASPACE__)
 @A1A D                                     EXTPROC('_C_TS_realloc')
 @A1A  /else
      D                                     EXTPROC('realloc')
 @A1A  /endif
       *
       * Required parameter group:
       *                             Address of storage to reallocate
      D   stgPtr                            LIKE(pointer_t) VALUE
       *                             Size of storage to allocate
      D   size                              LIKE(size_t) VALUE

You'll also need the following from STDDEF

D size_t          S                   LIKE(uint_t)

and the following from my C_RPG_TYPE include

@A1A D char_t          S              3I 0
     D short_t         S              5I 0
     D int_t           S             10I 0
     D long_t          S                   LIKE(int_t)
@A1A D longLong_t      S             20I 0
@A1A D uchar_t         S              3U 0
     D ushort_t        S              5U 0
     D uint_t          S             10U 0
     D ulong_t         S                   LIKE(uint_t)
@A1A D ulongLong_t     S             20U 0
     D float_t         S              4F
     D double_t        S              8F
     D longDouble_t    S                   LIKE(double_t)
     D pointer_t       S               *
     D funcPtr_t       S               *   PROCPTR

Regards,
Simon Coulter.

--------------------------------------------------------------------
   FlyByNight Software         AS/400 Technical Specialists
   http://www.flybynight.com.au/

   Phone: +61 3 9419 0175   Mobile: +61 0411 091 400        /"\
   Fax:   +61 3 9419 0175   mailto: shc@flybynight.com.au   \ /
                                                             X
                 ASCII Ribbon campaign against HTML E-Mail  / \
--------------------------------------------------------------------



As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.