with Semaphore;
generic
    type Item is private;
package Stack_Guarded_Unbounded_Unmanaged_Noniterator is

    type Stack is limited private;

    procedure Seize (The_Stack : in Stack);
    procedure Release (The_Stack : in Stack);
    procedure Copy (From_The_Stack : in Stack; To_The_Stack : in out Stack);
    procedure Clear (The_Stack : in out Stack);
    procedure Push (The_Item : in Item; On_The_Stack : in out Stack);
    procedure Pop (The_Stack : in out Stack);

    function Is_Equal (Left : in Stack; Right : in Stack) return Boolean;
    function Depth_Of (The_Stack : in Stack) return Natural;
    function Is_Empty (The_Stack : in Stack) return Boolean;
    function Top_Of (The_Stack : in Stack) return Item;

    Overflow : exception;
    Underflow : exception;

private
    type Node;
    type Structure is access Node;
    type Stack is
        record
            Guard : Semaphore.Kind;
            The_Items : Structure;
        end record;
end Stack_Guarded_Unbounded_Unmanaged_Noniterator;