Browse Prior Art Database

Generic List Functions with Comprehensive List Data Processing

IP.com Disclosure Number: IPCOM000113540D
Original Publication Date: 1994-Sep-01
Included in the Prior Art Database: 2005-Mar-27
Document File: 4 page(s) / 144K

Publishing Venue

IBM

Related People

Davis, RA: AUTHOR [+2]

Abstract

Most programming projects require various types of lists for maintaining requests, transactions, queues, and similar groupings of related elements. In a given project, there may be several different types of queues, with different kinds of data associated with each.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 41% of the total text.

Generic List Functions with Comprehensive List Data Processing

      Most programming projects require various types of lists for
maintaining requests, transactions, queues, and similar groupings of
related elements.  In a given project, there may be several different
types of queues, with different kinds of data associated with each.

      In prior art, function sets have provided limited generic list
functions, but have not provided the capability to process the data
contained within the list.  A need exists for a set of generic list
functions with comprehensive list data processing capabilities which
allow specific processing on list elements, yet is made up of code
that can be reused many times.  Such list-handling capabilities
achieves reduced time and costs for coding as well as for support and
maintenance.  The set of generic list handling functions disclosed
herein provide the required capability for comprehensive processing
of different kinds of data contained in various kinds of lists.

      The set of generic list functions includes OpenList,
SetListFlags, CloseList, QueryListItem, QueryItemSize, SearchList,
EnumerateList, QueryListCount, QueryNextItem, and QueryPreviousItem.
Some of these functions are similar to the ones currently used, but
others provided far more comprehensive processing capabilities.  In
the following paragraphs, each of the functions is described in
detail.

OpenList - This function, used to establish a new list, allocates
memory for the data used to maintain the list, and returns to the
caller a handle to this information.  Following is a description of
the data that might be used in a typical implementation:
  o  Flags - Used to determine whether elements are added in FIFO or
              LIFO order.
  o  Items - A count of the number of elements currently in the list.
  o  Head  - A pointer to the first element in the list.
  o  Tail  - A pointer to the last element in the list.
  o  Sem   - A semaphore used to lock the list while elements are
being
             processed.

SetListFlags - This function is used to set the various flags used
for list maintenance, to determine whether the list type is FIFO or
LIFO, for example, in a given implementation.

CloseList - This function is used to clean up any elements left in
the list, as well as the list itself.  In a typical implementation,
this function traverses the list, first freeing the storage allocated
for each element, then freeing the storage for the list maintenance
structure itself.

QueryListItem - This function, useful when an ordered list is being
maintained, returns the element occupying a specific place in the
order.  For example, specifying 3 for this function would return the
third list element.  In a typical implementation, the function might
be set up to return a pointer to the element, but not to remove the
element from the list.

QueryItemSize - This function returns the field size ...