Stack

Stack — Stack.

Synopsis


#include <libhrel/stack.h>


            HStack;
HStack*     h_stack_new                     (void);
void        h_stack_free                    (HStack *stack);
void        h_stack_push                    (HStack *stack,
                                             gpointer data);
void        h_stack_pop                     (HStack *stack);
gpointer    h_stack_get_top                 (HStack *stack);

Description

Stack type.

Details

HStack

typedef struct _HStack HStack;


h_stack_new ()

HStack*     h_stack_new                     (void);

Creates a new HStack.

Returns : the new HStack

h_stack_free ()

void        h_stack_free                    (HStack *stack);

Frees the memory allocated to stack.

stack : a HStack

h_stack_push ()

void        h_stack_push                    (HStack *stack,
                                             gpointer data);

Pushes data onto stack.

stack : a HStack
data : data

h_stack_pop ()

void        h_stack_pop                     (HStack *stack);

Removes the top of stack.

stack : a HStack

h_stack_get_top ()

gpointer    h_stack_get_top                 (HStack *stack);

Returns the top of stack.

stack : a HStack
Returns : top data