**********************************************************************
***               Stack functions NSIS plugin v1.2                 ***
**********************************************************************

2005 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)


Functions for working with NSIS stack:

	-Adds an element to the top of the NSIS stack (same as Push "string")

		stack::ns_push_front "string"


	-Removes the element from the top of the NSIS stack and
	 puts it in the variable (same as Pop $0)

		stack::ns_pop_front .r0 .r1

		$0-output
		$1-errorlevel: 0 on success
		               1 on empty stack


	-Adds an element to the beginning of the NSIS stack.

		stack::ns_push_back "string"


	-Finds the NSIS element with index and puts it in the variable.

		stack::ns_stack_read .r0 index .r1

		$0-output
		index-number of the element (only positive)
		$1-errorlevel: 0 on success
		               1 on empty stack


	-Finds the NSIS element with index and rewrite it.

		stack::ns_stack_write "string" index .r0

		"string"-text to write
		index-number of the element (only positive)
		$0-errorlevel: 0 on success
		               1 on empty stack


	-Gets the number of elements in the NSIS stack.

		stack::ns_stack_size .r0

		$0-the number of elements


	-Clears all NSIS stack

		stack::ns_stack_clear


Functions for working with private stack (NSIS independent):

	!Required: /NOUNLOAD flag in each call or SetPluginUnload
	otherwise private stack will be lost when the plug-in is unloaded.


	-Adds an element to the top of the private stack.

		stack::dll_push_front "string"


	-Removes the element from the top of the private stack and
	 puts it in the variable.

		stack::dll_pop_front .r0 .r1

		$0-output
		$1-errorlevel: 0 on success
		               1 on empty stack


	-Adds an element to the beginning of the private stack.

		stack::dll_push_back "string"


	-Removes the element from the beginning
	 of the private stack and puts it in the variable.

		stack::dll_pop_back .r0 .r1

		$0-output
		$1-errorlevel: 0 on success
		               1 on empty stack


	-Finds the private element with index and puts it in the variable.

		stack::dll_stack_read .r0 index .r1

		$0-output
		index-number of the element if positive search
		      from top if negative from beginning
		$1-errorlevel: 0 on success
		               1 on empty stack


	-Finds the private element with index and rewrite it.

		stack::dll_stack_write "string" index .r0

		"string"-text to write
		index-number of the element if positive search
		      from top if negative from beginning
		$0-errorlevel: 0 on success
		               1 on empty stack


	-Finds the private element with index and
	 inserts new element in it index.

		stack::dll_stack_insert "string" index .r0

		"string"-text to insert
		index-number of the element if positive search
		      from top if negative from beginning
		$0-errorlevel: 0 on success
		               1 on empty stack


	-Finds the elements with indexes and exchanges them.

		stack::dll_stack_exchange index index2 .r0

		index-number of the element if positive search
		      from top if negative from beginning
		index2-number of the element if positive search
		      from top if negative from beginning
		$0-errorlevel: 0 on success
		               1 on empty stack
		               2 indexes pointed to the same element


	-Reverse range of elements.

		stack::dll_stack_reverse_range index index2 .R0

		index-number of the element if positive search
		      from top if negative from beginning (range limit)
		index2-number of the element if positive search
		      from top if negative from beginning (range limit)
		$0-errorlevel: 0 on success
		               1 on empty stack
		               2 indexes pointed to the same element


	-Finds the private element with index, puts it in
	 the variable and removes it.

		stack::dll_stack_delete .r0 index .r1

		$0-output
		index-number of the element if positive search
		      from top if negative from beginning
		$1-errorlevel: 0 on success, 1 on empty stack


	-Finds the elements between indexes and removes.

		stack::dll_stack_delete_range index index2 .R0

		index-number of the element if positive search
		      from top if negative from beginning (range limit)
		index2-number of the element if positive search
		      from top if negative from beginning (range limit)
		$0-errorlevel: 0 on success
		               1 on empty stack


	-Finds the element with index and move it to the new index.

		stack::dll_stack_move index index2 .R0

		index-number of the element if positive search
		      from top if negative from beginning (source)
		index2-number of the element if positive search
		      from top if negative from beginning (destination)
		$0-errorlevel: 0 on success
		               1 on empty stack
		               2 source and destination indexes pointed to the same element


	-Finds the element with index and move it to the new index.

		stack::dll_stack_move_range index index2 index3 .R0

		index-number of the element if positive search
		      from top if negative from beginning (range limit)
		index2-number of the element if positive search
		      from top if negative from beginning (range limit)
		index3-number of the element if positive search
		      from top if negative from beginning (destination)
		$0-errorlevel: 0 on success
		               1 on empty stack
		               2 destination index pointed to the element in the range


	-Pushs element to the stack and sorts alphabetically in ascending or descending.

		stack::dll_push_sort "string" UpDown

		"string"-text to be pushed and sorted
		UpDown-sorts in "1"-ascending, "-1"-descending


	-Sorts the stack alphabetically in ascending or descending.

		stack::dll_stack_sort UpDown

		UpDown-sorts in "1"-ascending, "-1"-descending


	-Gets the number of elements in the private stack.

		stack::dll_stack_size .r0

		$0-the number of elements


	-Clears all private stack

		stack::dll_stack_clear
