Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

dsp/inc/mplist.h File Reference

#include <dsplink.h>
#include <mplistdefs.h>

Include dependency graph for dsp/inc/mplist.h:

Go to the source code of this file.

Defines

#define MPLIST_H

Functions

Int MPLIST_create (IN Uint16 procId, IN Char *name, IN MPLIST_List *mplistObj, IN MPLIST_Attrs *attrs)
 Allocates and initializes a doubly linked circular list in shared memory. The memory for the object may or may not be provided by the user. Uses POOl api to allocate a list object. The list object contains a MPCS object and a single element and initializes that element to indicate that it is the "end of the list" (i.e., the list is empty). An entry is added in the shared memory control structure for the list.
Int MPLIST_delete (IN Uint16 procId, IN Char *name)
 Removes a list by freeing its control structure's memory space. Must ONLY be used for empty lists, because it does not walk the chain of list elements. Calling this function on a non-empty list will cause a memory leak.
Int MPLIST_open (IN Uint16 procId, IN Char *name, OUT MPLIST_Handle *mplistHandle)
 This function opens an MPLIST object specified by its name and gets a handle to the object. Every process that needs to use the MPLIST object must get a handle to the object by calling this API.
Int MPLIST_close (IN MPLIST_Handle mplistHandle)
 This function closes an MPLIST instance.
Bool MPLIST_isEmpty (IN MPLIST_Handle mplistHandle)
 Check for an empty list.
Int MPLIST_insertBefore (IN MPLIST_Handle mplistHandle, IN MPLIST_Elem insertElement, IN MPLIST_Elem existingElement)
 Inserts the element before the existing element.
Int MPLIST_putTail (IN MPLIST_Handle mplistHandle, IN MPLIST_Elem element)
 Adds the specified element to the tail of the list.
Int MPLIST_removeElement (IN MPLIST_Handle mplistHandle, IN MPLIST_Elem element)
 Removes (unlinks) the given element from the list, if the list is not empty. Does not free the list element.
Int MPLIST_first (IN MPLIST_Handle mplistHandle, OUT MPLIST_Elem *element)
 Returns a pointer to the first element of the list, or NULL if the list is empty.
Int MPLIST_getHead (IN MPLIST_Handle mplistHandle, OUT MPLIST_Elem *element)
 Pops the head off the list and returns a pointer to it. If the list is empty, returns NULL.
Int MPLIST_next (IN MPLIST_Handle mplistHandle, IN MPLIST_Elem currentElement, OUT MPLIST_Elem *nextElement)
 Returns a pointer to the next element of the list, or NULL if the next element is the head of the list or the list is empty.


Define Documentation

#define MPLIST_H
 

Definition at line 46 of file dsp/inc/mplist.h.


Function Documentation

Int MPLIST_close IN MPLIST_Handle  mplistHandle  ) 
 

This function closes an MPLIST instance.

============================================================================

Function:
MPLIST_close
Parameters:
mplistHandle Handle for list operations.
Returns:
SYS_EOK Operation successfully completed. SYS_EFAIL General Failure. SYS_EFREE Operation failed due to a memory error. SYS_ENOTFOUND Specified MPLIST object name does not exist. SYS_EDEAD The MPLIST component has not been initialized.
Precondition:
mplistHandle must be a valid pointer.
Postcondition:
None
See also:
MPLIST_open_ ============================================================================

Int MPLIST_create IN Uint16  procId,
IN Char *  name,
IN MPLIST_List mplistObj,
IN MPLIST_Attrs attrs
 

Allocates and initializes a doubly linked circular list in shared memory. The memory for the object may or may not be provided by the user. Uses POOl api to allocate a list object. The list object contains a MPCS object and a single element and initializes that element to indicate that it is the "end of the list" (i.e., the list is empty). An entry is added in the shared memory control structure for the list.

============================================================================

Function:
MPLIST_create
Parameters:
procId Processor id of the processor making this create call.
name Name of the list to be created.
mpcsObj Pointer to the shared MPLIST object. If memory for the MPLIST object is provided by the user, the MPLIST object handle is not NULL. Otherwise, if the memory is to be allocated by the MPLIST component, the MPLIST object handle can be specified as NULL.
attrs Attributes of the list to be created.
Returns:
SYS_OK Operation successfully completed. SYS_EINVAL Invalid Parameters. SYS_EALLOC Operation failed due to a memory error. SYS_EBUSY The specified MPLIST name already exists. SYS_ENOTFOUND All MPLIST entries are currently in use. SYS_EDEAD The MPLIST component has not been initialized.
Precondition:
name must be a valid pointer. attr must be a valid pointer.
Postcondition:
None
See also:
None ============================================================================

Int MPLIST_delete IN Uint16  procId,
IN Char *  name
 

Removes a list by freeing its control structure's memory space. Must ONLY be used for empty lists, because it does not walk the chain of list elements. Calling this function on a non-empty list will cause a memory leak.

============================================================================

Function:
MPLIST_delete
Parameters:
procId Processor id of the processor making this delete call.
name Name of the list to be deleted.
Returns:
SYS_OK Operation successfully completed. SYS_EINVAL Invalid Parameters. SYS_EFREE Operation failed due to a memory error. SYS_ENOTFOUND Specified MPLIST object name does not exist. SYS_EDEAD The MPLIST component has not been initialized.
Precondition:
name must be a valid pointer.
Postcondition:
None
See also:
MPLIST_create ============================================================================

Int MPLIST_first IN MPLIST_Handle  mplistHandle,
OUT MPLIST_Elem element
 

Returns a pointer to the first element of the list, or NULL if the list is empty.

============================================================================

Function:
MPLIST_first
Parameters:
mplistHandle List handle for list operations.
element parameter for holding the first element.
Returns:
SYS_OK Operation successfully completed. SYS_EINVAL Invalid Parameters.
Precondition:
mplistHandle must be a valid pointer. Element must be a valid pointer.
Postcondition:
None
See also:
MPLIST_create, MPLIST_putTail, MPLIST_insertBefore ============================================================================

Int MPLIST_getHead IN MPLIST_Handle  mplistHandle,
OUT MPLIST_Elem element
 

Pops the head off the list and returns a pointer to it. If the list is empty, returns NULL.

============================================================================

Function:
MPLIST_getHead
Parameters:
mplistHandle List handle for list operations.
headElement Parameter to hold the head element.
Returns:
SYS_OK Operation successfully completed. SYS_EINVAL Invalid Parameters.
Precondition:
List handle must be a valid pointer. Head element must be a valid pointer.
Postcondition:
None
See also:
MPLIST_putTail, MPLIST_insertBefore ============================================================================

Int MPLIST_insertBefore IN MPLIST_Handle  mplistHandle,
IN MPLIST_Elem  insertElement,
IN MPLIST_Elem  existingElement
 

Inserts the element before the existing element.

============================================================================

Function:
MPLIST_insertBefore
Parameters:
mplistHandle List handle for list operations.
insertElement Pointer to element in list to insert.
existingElement Pointer to existing list element.
Returns:
SYS_OK Operation successfully completed. SYS_EINVAL Invalid Parameters.
Precondition:
mplistHandle must be a valid pointer. insertElement must be a valid pointer. existingElement must be a valid pointer.
Postcondition:
None
See also:
MPLIST_create, MPLIST_putTail ============================================================================

Bool MPLIST_isEmpty IN MPLIST_Handle  mplistHandle  ) 
 

Check for an empty list.

============================================================================

Function:
MPLIST_isEmpty
Parameters:
mplistHandle List handle for list operations.
Returns:
TRUE List is empty. FALSE List is not empty.
Precondition:
mplistHandle must be a valid pointer.
Postcondition:
None
See also:
None ============================================================================

Int MPLIST_next IN MPLIST_Handle  mplistHandle,
IN MPLIST_Elem  currentElement,
OUT MPLIST_Elem nextElement
 

Returns a pointer to the next element of the list, or NULL if the next element is the head of the list or the list is empty.

============================================================================

Function:
MPLIST_next
Parameters:
mplistHandle List handle for list operations.
currentElement Pointer to element in list to remove.
nextElement Pointer to next element.
Returns:
SYS_OK Operation successfully completed. SYS_EINVAL Invalid Parameters.
Precondition:
List handle must be a valid pointer. currentElement must be a valid pointer. nextElement must be a valid pointer.
Postcondition:
None
See also:
MPLIST_insertBefore, MPLIST_putTail ============================================================================

Int MPLIST_open IN Uint16  procId,
IN Char *  name,
OUT MPLIST_Handle mplistHandle
 

This function opens an MPLIST object specified by its name and gets a handle to the object. Every process that needs to use the MPLIST object must get a handle to the object by calling this API.

============================================================================

Function:
MPLIST_open
Parameters:
procId Processor id of the processor making this open call.
name Name of the list to be opened.
mplistHandle Handle of list which has to be opened.
Returns:
SYS_SOK Operation successfully completed. SYS_EINVAL Invalid Parameters. SYS_EALLOC Operation failed due to a memory error. SYS_ENOTFOUND Specified MPLIST object name does not exist. SYS_EDEAD The MPLIST component has not been initialized.
Precondition:
mplistHandle must be a valid pointer . name must be a valid pointer.
Postcondition:
None
See also:
MPLIST_close ============================================================================

Int MPLIST_putTail IN MPLIST_Handle  mplistHandle,
IN MPLIST_Elem  element
 

Adds the specified element to the tail of the list.

============================================================================

Function:
MPLIST_putTail
Parameters:
mplistHandle List handle for list operations.
element Pointer to list element to be added.
Returns:
SYS_OK Operation successfully completed. SYS_EINVAL Invalid Parameters.
Precondition:
mplistHandle must be a valid pointer. element must be a valid pointer.
Postcondition:
None
See also:
MPLIST_insertBefore ============================================================================

Int MPLIST_removeElement IN MPLIST_Handle  mplistHandle,
IN MPLIST_Elem  element
 

Removes (unlinks) the given element from the list, if the list is not empty. Does not free the list element.

============================================================================

Function:
MPLIST_removeElement
Parameters:
mplistHandle List handle for list operations.
element Pointer to element in list to remove.
Returns:
SYS_OK Operation successfully completed. SYS_EINVAL Invalid Parameters.
Precondition:
mplistHandle must be a valid pointer. Element must be a valid pointer.
Postcondition:
None
See also:
MPLIST_insertBefore, MPLIST_create, MPLIST_putTail ============================================================================


Generated on Fri Jul 16 14:34:08 2010 for DSP/BIOSLink by  doxygen 1.4.4