Have you seen the API description at IBM's website?
This describes the API and how to use it:
NOTE: I am working in RPGLE. If you are working in C or some other language, you will have to translate some of what I say into your own terms.
The array returned in the buffer pointed to by the buffer_ptr parameter that you give to the API is an array of users with authorities to the object. You can create a User Space object (auto-extending) to hold the information, and give the API the address of the start of the space -- that way you can 'slide' a structure over the User Space by applying offsets to the start address.
Now when the API is executed, it fills the User Space whose address you passed in Buffer_ptr. Read the first 64 bytes into your Qp0l_Authority_General_t structure. The array of users starts at the User Space address plus the offset specified.
Now, for each user in turn, base a structure on the User Space address + offset + (48 * (user entry number - 1))The structure will be Qp0l_Authority_Users_t as described in the API documentation. Now you can just read the fields in the structure. Here's the the source for a set of User Space procedures we use that can help, and which include list handling of the sort that is involved here.
For the second question, you need to use a list API or QShell command to list the objects in the IFS directories you want to examine. Read that list, and for each object you are interested in call your authority reporting routine. Note that once the User Space has been created, it can be reused just by passing its start address to each call of the API.
================================== MORE INFORMATION ON THIS TOPIC ==================================
The Best Web Links: tips, tutorials and more.
Ask your programming questions--or help out your peers by answering them--in our live discussion forums.
Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.
This was first published in September 2004