xb-stack

xb-stack

Functions

gchar * xb_stack_to_string ()
gboolean xb_stack_pop ()
gboolean xb_stack_push ()

Description

Functions

xb_stack_to_string ()

gchar *
xb_stack_to_string (XbStack *self);

Returns a string representing a stack.

Parameters

self

a XbStack

 

Returns

text

Since: 0.1.4


xb_stack_pop ()

gboolean
xb_stack_pop (XbStack *self,
              XbOpcode *opcode_out,
              GError **error);

Pops an opcode off the stack.

Parameters

self

a XbStack

 

opcode_out

return location for the popped XbOpcode.

[out caller-allocates][optional]

error

a GError, or NULL

 

Returns

TRUE if popping succeeded, FALSE if the stack was empty already

Since: 0.2.0


xb_stack_push ()

gboolean
xb_stack_push (XbStack *self,
               XbOpcode **opcode_out,
               GError **error);

Pushes a new empty opcode onto the end of the stack. A pointer to the opcode is returned in opcode_out so that the caller can initialise it. This must be done before the stack is next used as, for performance reasons, the newly pushed opcode is not zero-initialised.

Parameters

self

a XbStack

 

opcode_out

return location for the new XbOpcode.

[out][nullable]

error

a GError, or NULL

 

Returns

TRUE if a new empty opcode was returned, or FALSE if the stack has reached its maximum size

Since: 0.2.0