home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / database / informix / 1866 < prev    next >
Encoding:
Internet Message Format  |  1992-09-02  |  1.2 KB

  1. Path: sparky!uunet!olivea!gossip.pyramid.com!pyramid!infmx!news
  2. From: cortesi@informix.com (David Cortesi)
  3. Newsgroups: comp.databases.informix
  4. Subject: Re: memory allocation under AIX 3.2
  5. Message-ID: <1992Sep2.230122.16010@informix.com>
  6. Date: 2 Sep 92 23:01:22 GMT
  7. References: <9448@emory.mathcs.emory.edu>
  8. Sender: news@informix.com (Usenet News)
  9. Reply-To: cortesi@informix.com
  10. Organization: Informix Software, Inc.
  11. Lines: 25
  12.  
  13. In article <9448@emory.mathcs.emory.edu> mm@ssf.pt (Manuel Monteiro) writes:
  14. > I have several ec functions similar to
  15. > f(fgl_pcnt)
  16. >      int fgl_pcnt;
  17. > {
  18. >   ...;
  19. >   char *x = malloc(...);        /* x size is not known in compile time */
  20. >   
  21. >   ...;                          /* calculates x value */
  22. >   
  23. >   /* RETURN x */
  24. >   pushquote(x, strlen(x));
  25. >   doretalloc(1);
  26. >   free( x );                    /* must free x space before returning */
  27. >   return(1);
  28. > }
  29.  
  30.  
  31. There is a retquote() function (also retint, retdub, etc etc)
  32. for precisely this purpose -- it copies the value to the 4GL stack
  33. instead of merely pushing the pointer.
  34.  
  35. In the 4GL 4.1 Supplement manual there is an extensive discussion
  36. of the C-to-4GL API and these functions are documented there.
  37.