× 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 believe these are the APIs being discussed.


I think these are what people are calling "unix" APIs. (Not intended as a complete list)
They come from fcntl.h, which IBM considers under "Header Files for UNIX-Type Functions".

Dcl-Pr open Int(10) ExtProc('open');
path Pointer value options(*string);
openflags Int(10) value;
mode Uns(10) value options(*nopass);
ccsid Uns(10) value options(*nopass);
txtcreatid Uns(10) value options(*nopass);
End-Pr;

Dcl-Pr read Int(10) ExtProc('read');
fildes Int(10) value;
buf Pointer value;
bytes Uns(10) value;
End-Pr;

Dcl-Pr write Int(10) ExtProc('write');
fildes Int(10) value;
buf Pointer value;
bytes Uns(10) value;
End-Pr;



And these are the C-APIs (Not intended as a complete list)
These come from stdio.h

Dcl-S pFILE Pointer Template;

Dcl-Pr fopen ExtProc('_C_IFS_fopen') like(pFILE);
filename Pointer value options(*string);
mode Pointer value options(*string);
End-Pr;


Dcl-Pr fgets Pointer ExtProc('_C_IFS_fgets');
string Pointer value;
size Int(10) value;
stream like(pFILE) value;
End-Pr;

Dcl-Pr fputs Int(10) ExtProc('_C_IFS_fputs');
string Pointer value options(*string);
stream like(pFILE) value;
End-Pr;

Dcl-Pr fwrite Uns(10) ExtProc('_C_IFS_fwrite');
data Pointer value;
size Uns(10) value;
count Uns(10) value;
stream like(pFILE) value;
End-Pr;

Chris Hiebert
Senior Programmer/Analyst
Disclaimer: Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.


-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of John
Yeung
Sent: Friday, April 23, 2021 8:14 AM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: c_ifs_open Problem

I still don't know which APIs you mean. As someone who studied Unix
and C long ago but hasn't used APIs much in RPG, it sounds weird to
see "Unix API" mentioned as something distinct from "C API". Unix and
C are so intertwined that for all intents and purposes, one set of
APIs *ought to be* a thin wrapper over the other.

John Y.

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.