push_head


Description:

public void push_head (owned G data)

Adds a new element at the head of the queue.

Example: Push head:

public static int main () {
Queue<string> stack = new Queue<string> ();
stack.push_head ("1");
stack.push_head ("2");
stack.push_head ("3");

// Output: ``3 2 1 ``
string item;
while ((item = stack.pop_head ()) != null) {
print ("%s ", item);
}
print ("\n");

return 0;
}

valac --pkg glib-2.0 GLib.Queue.push_head.vala

Parameters:

this

a Queue.

data

the data for the new element.