Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/generic_types/evaluation/c-stack.c

    rd919f47 r87c5f40  
    1111}
    1212
    13 void copy_stack(struct stack* s, struct stack* t, void* (*copy)(void*)) {
     13void copy_stack(struct stack* s, const struct stack* t, void* (*copy)(const void*)) {
    1414        struct stack_node** crnt = &s->head;
    1515        struct stack_node* next = t->head;
     
    2323}
    2424
    25 void clear_stack(struct stack* s) {
     25void clear_stack(struct stack* s, void (*free_el)(void*)) {
    2626        struct stack_node* next = s->head;
    2727        while ( next ) {
    2828                struct stack_node* crnt = next;
    2929                next = crnt->next;
    30                 free(crnt->value);
     30                free_el(crnt->value);
    3131                free(crnt);
    3232        }
Note: See TracChangeset for help on using the changeset viewer.