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



These appear to be variable length entries, so the generic header entry length does not apply. You still need to do as Adam says - and the generic header is retrieved as it is for all the other list APIs.

I would not use the QUSRTVUS program - I'd use pointers. First, have a DS for the generic header - based on a pointer, which will be the address of the user space - there is an API to get that address (Retrieve Pointer to User Space (QUSPTRUS)). Have a DS defined to match the MODL0100 format - there should be one in QSYSINC/QRPGLESRC that you can model after - and base it on a pointer. Set the entry pointer to the address of the user space you retrieved, plus the offset to the list as found in the generic header.

The first subfield in the entry is the size of the entry - once you have processed the entry, add that size to the pointer and you have the next entry. Do this in a FOR loop as suggested in the other post. The description of this subfield says not to use the entry length of the generic header. By the way, QSYSINC/QRPGLESRC has a member for the generic header - QUSGEN, as I recall - as well as for user spaces - QUS. You don't need QUS, I think. Nothing in there matches this list format.

HTH
Vern

-------------- Original message ----------------------
From: Adam Glauser <adamglauser@xxxxxxxxxxxx>
Manuel Cerda wrote:
All,
I am having some difficulties with retrieving the list of exported
procedures with api QBNLMODI.
I want to use the format MODL0100
Here is what the documentation says :
[...]
**Note:* Do not use the generic header entry size for this format. Use
the Size of this entry field returned in this format for the size of
each entry.*
[...]
This format is different than the one I use usually as I cannot retrieve
the header first.
I cannot use QUSRTVUS to retrieve the list.

Why can't you use QUSRTVUS? As far as I could tell from a (somewhat
quick) look at the documentation, the MODL0100 format returns a list of
exports in a user space, so I'd expect QUSRTVUS would be the way to go.

The way I read that documentation, you _do_ need to retrieve the generic
header, just don't use the "size of each entry" field from the header.
You still need to know the offset to the list data, which is provided in
the generic header.

As for processing this list data, it seems that you need to read the
entry header defined by format MODL0100, get the offset of the exported
symbol name, process the exported symbol name, then move to (exported
symbol name offset + length of exported symbol name) to read the next
entry header.

I haven't personally used this API, I wasn't able to find an example at
think400.dk which is what I usually do when I'm unclear about the usage
of an API. I hope my interpretation of the documentation is useful even
though it is untested.
--
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.