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



I wrote a C function char *FOUNDDIR(char *fn) to return a string (pointer to a 
string) and compiled it as a service program using CRTSRVPGM SRVPGM(sudsrvpgm) 
EXPORT(*ALL) SRCFILE(c_src) BNDDIR(SUDBNDDIR).

I then called this service program from my rpgle as follows.

d founddir        pr              *
d  dir                            *    value options(*string)

d ptr              s              *
d rtnstr           s           20     based(ptr)

c                 ptr = founddir('/')
c                 dsplay           rtnstr

The rtnstr is a junk value.  ptr is a regular pointer value.   I also tried

d founddir        pr           20
d  dir                            *    value options(*string)

and did a rtnstr = founddir('/'). rtnstr is still some junk value.

I also cannot debug since My C function does not show the source.  So I created 
a module by

 CRTCMOD MODULE(sudsrvpgm) SRCFILE(C_Src) OUTPUT(*print) OPTION(*SHOWSRC
 *SHOWUSR) DBGVIEW(*ALL) SYSIFCOPT(*IFSIO *IFS64IO)

But it does not show any debug.

I must be doing all wrong.

TIA,
Sudha

Sudha Ramanujan
SunGard Futures Systems
(312)577-6179


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.