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



sure learned something today.  thanks Scott :)

-----Original Message-----
From: rpg400-l-bounces+lim.hock-chai=arch.com@xxxxxxxxxxxx
[mailto:rpg400-l-bounces+lim.hock-chai=arch.com@xxxxxxxxxxxx]On Behalf
Of Scott Klement
Sent: Friday, October 22, 2004 12:06 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: QC2LE documentation



On Fri, 22 Oct 2004, Lim Hock-Chai wrote:

> okay.  Now I'm a bit confuse.  I understand when you said stat() is a
> unix api not a c run time function, but I don't understand the part
> about it is not in one of the service program in QC2LE binding
> directory.

When a program is compiled, not every bit of the code is generated.
Instead, the compiler generates routines that call routines in service
programs -- these services programs are known as the "ILE RPG Runtime" (or
"ILE C Runtime" or "ILE CL Runtime" or whatever language you're compiling)

So, each ILE language will automagically bind to binding directories that
you don't specify.

QC2LE is one of the binding directories that is automatically specified
for you if you code an ILE C program.  It's necessary to explicitly
specify it in an RPG program because RPG doesn't by default use the ILE C
runtime.

Likewise there's a binding directory for RPG -- I think it's QRNXLE, but
not 100% sure...   if an ILE C program really wanted to, it could use some
of RPG's functions by binding to that binding directory.

System APIs, like stat(), are automatically included in all languages
binding directories.  Stat() will work just fine if you omit
BNDDIR('QC2LE') from your RPG program.


> If stat() is not in QC2LE, how can the binder find it when creating
> program that uses this api.  I use your socket program example to create
> scoket program before and I know those socket functions are unix api and
> I also know that it require Bnddir('QC2LE') on the H spec to get the RPG
> program to compile.


Wrong. The socket functions do NOT require QC2LE on the H-spec.  The only
thing in my sockets tutorial that requires the QC2LE binding directory are
the __errno() and strerror() functions.

Everything else (socket(), listen(), connect(), bind(), recv(), send(),
close(), etc) are automatically bound to by any ILE language if needed.

The same is true of all of the IFS APIs...  open(), read(), write(),
close(), stat(), etc.  The only need for QC2LE is to get __errno() or
strerror().

However, the ILE C runtime does have some IFS functions of it's own.
fopen(), fgets(), fputs(), fclose()... that whole class of functions is
part of the ILE C runtime and are not system APIs!  So, for those, you
need QC2LE, and the documentation is in the ILE C/C++ Runtime Library
reference manual.

--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



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.