Linked List Utilities
The project source code has been moved to the linked list repository at Bitbucket.org.
This section shows some examples how the linked list can be used to make returning a list of simple data easier than using a userspace.
List File Members
This IBM i API - QUSLMBR - uses a userspace to return the data to the caller. The creation and handling of a userspace is sometimes rather cumbersome. Using a linked list for just returning the names of the file members gives the caller some advantages:
- checking if file has members using list_isEmpty
- checking if file has a specific member using list_indexOf or list_contains
- getting the number of members using list_size
- iterating through all members using list_getNext
List Record Formats
This IBM i API - QUSLRCD - uses a userspace to return the data to the caller. The creation and handling of a userspace is sometimes rather cumbersome. Using a linked list for just returning the names of the record formats is a lot easier than working with userspaces.
List Objects
This procedure is a convience procedure for the IBM i API QUSLOBJ. It accepts the same parameters for library, object name and object type. It also has the same restrictions.