|
of_addtail
|
|
Full name
|
pfc_n_cst_linkedlistbase.of_addtail
|
Access
|
protected
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
protected function integer of_addtail(n_cst_linkedlistnode)
|
protected function integer of_addtail (n_cst_linkedlistnode anv_newtailnode);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_AddTail
//
// Access: protected
//
// Arguments :
// anv_newtailnode The node to be added to the list as the new Tail node.
//
// Returns: integer
// 1 = success
// -1 = failure
//
// Description:
// Adds a new node to the end of the linked list.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 6.0 Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved.
// Any distribution of the PowerBuilder Foundation Classes (PFC)
// source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////
// Validate arguments.
if isnull(anv_newtailnode) or not isvalid(anv_newtailnode) then
return -1
end if
// Check to if this is the first node.
if isnull(inv_head) or not isvalid(inv_head) then
return of_AddHead(anv_newtailnode)
end if
// -- Add as the new tail. --
// Set the current tail as the previous node to the About to be new Tail.
anv_newtailnode.of_setprev(inv_tail)
// Tail nodes never have a next pointer.
anv_newtailnode.of_setnext(inv_nil)
// Set the current Tail next pointer to the About to be New Tail node.
inv_tail.of_setnext(anv_newtailnode)
// Replace the current Tail reference with the New Tail node.
inv_tail = anv_newtailnode
return 1
end function