// Sesión 2: Stack con bloques enlazados. Escriban las funciones según stack.h.
// El bloque de arriba es top. Cada bloque apunta al que tiene debajo, y el último apunta a
// NULL. No usen realloc.
#include "stack.h"

#include <stdlib.h>

#define BLOCK_SIZE 4

struct block {
    int values[BLOCK_SIZE];
    int used;
    struct block *next;
};

struct stack {
    struct block *top;
    int size;
};

Stack *stack_new(void) {
    // Escriban aquí su código.
    return NULL;
}

void stack_free(Stack *stack) {
    (void) stack;  // borren estas líneas cuando usen los parámetros
    // Escriban aquí su código.
}

int stack_push(Stack *stack, int value) {
    (void) stack;
    (void) value;
    // Escriban aquí su código.
    return 0;
}

int stack_pop(Stack *stack, int *value) {
    (void) stack;
    (void) value;
    // Escriban aquí su código.
    return 0;
}

int stack_peek(const Stack *stack, int *value) {
    (void) stack;
    (void) value;
    // Escriban aquí su código.
    return 0;
}

int stack_size(const Stack *stack) {
    (void) stack;
    // Escriban aquí su código.
    return 0;
}
