× 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.


  • Subject: RE: Passing ownership of object locks?
  • From: Buck Calabro <mcalabro@xxxxxxxxxxxx>
  • Date: Thu, 30 Apr 1998 09:00:22 -0400
  • Organization: commsoft

On Wednesday, April 29, 1998 9:38 AM, Vernon Hamberg 
[SMTP:hambergv@goldengate.net] wrote:
> Have I heard that any C functions can be called from ILE RPG, too?
> With
> appropriate prototype declarations?

Yes, and it's rather helpful!  Here's a quickie example that I think 
Jon Paris put on the list.  If not, any errors are mine, but he 
certainly pointed me in the right place to start looking!  (compile 
with BNDDIR(QC2LE)):

 *  Description of "C" function from the "C" manual
 *
 *     void cvtch (_SPCPTR receiver,
 *                 _SPCPTRCN source,
 *                 int size););

D C2H             Pr                  ExtProc('cvtch')
D  RecPtrP                        *   Value
D  SrcPtrP                        *   Value
D  SizeP                        10I 0 Value


D RecPtr          S               *   INZ
D SrcPtr          S               *   INZ

D OutStrD         S             20    INZ
D InpStrD         S             10    INZ('F1F2F3')
D Size            S             10I 0 INZ

C                   Eval      RecPtr=%Addr(OutStrD)
C                   Eval      SrcPtr=%Addr(InpStrD)
C                   Eval      Size=%len(%trim(InpStrD))

C                   CALLP     C2H(RecPtr :
C                                 SrcPtr :
C                                 Size)

C     InpStrD       Dsply
C     OutStrD       Dsply

C                   SetOn                                          LR

hth,
Buck

Buck Calabro
Commsoft, Albany, NY
mailto:mcalabro@commsoft.net

+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


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.