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



Martin Effenberg wrote on 09/03/2007 10:42:18:

fd = open(%trimr(ifsfile): O_RDONLY: 511: 1252); 
[...]
read() is the only function, that needs the pointer adress to read data 
into..
open() just wants the plain filename.

Actually, the open() function requires a pointer too, passes pointers by 
default anyway.  I would guess that your prototype for the open() function 
looks like this:

     D open            PR            10I 0 ExtProc('open')
     D  path                           *   value options(*string)
     D  openflags                    10I 0 value
     D  mode                         10U 0 value options(*nopass)
     D  ccsid                        10U 0 value options(*nopass)
     D/if defined(*V5R2M0)
     D  txtcreatid                   10U 0 value options(*nopass)
     D/endif

That is Scott Klement's code from his IFSIO_H, which I expect is what most 
people are using.  The only reason that passing a 'plain filename' to 
open() works is because the compiler does the required magic for you, due 
to the 'value' and 'options(*string)' keywords on the path parameter.  The 
keyword 'options(*string)' adds a C end of string character to the result 
of %trimr(ifsfile).  Without *value, you would get an error the parameter 
not being valid for passing by reference because you would be passing the 
automatically created intermediate result of the %trimr() builtin.

HTH,
Adam

Attention:

The information contained in this message and or attachments is 
intended only for the person or entity to which it is addressed and may contain 
confidential and/or privileged material. Any review, retransmission, 
dissemination or other use of, or taking of any action in reliance upon, this 
information by persons or entities other than the intended recipient is 
prohibited. If you received this message in error, please contact the sender 
and 
delete the material from any system and destroy any copies. Thank you for your 
time and consideration.

Attention: 

Le contenu de ce message et(ou) les fichiers ci-joints s?adressent 
exclusivement à la personne ou -entité à laquelle ils sont destinés. Ils 
peuvent 
contenir de l?information confidentielle, protégée et(ou) classifiée. Il est 
strictement interdit à toute personne ou entité autre que le(la) destinataire 
prévu(e) de ce message d?examiner, de réviser, de retransmettre ou de diffuser 
cette information, de prendre une quelconque action en fonction ou sur la base 
de celle-ci, ou d?en faire tout autre usage. Si vous avez reçu ce message par 
erreur, veuillez communiquer avec l?expéditeur(trice), supprimer ce message et 
les fichiers ci-inclus de tout système, et en détruire toutes copies, qu?elles 
soient électroniques ou imprimées. Nous vous remercions de votre entière 
collaboration. 

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.