22 if (stack->top >= stack->capacity)
24 old_size = stack->capacity *
sizeof(
t_point);
26 stack->data = (
t_point *)ft_realloc_tentative(
27 stack->data, stack->capacity *
sizeof(
t_point), old_size);
28 if (stack->data == NULL)
30 perror(
"Failed to reallocate stack\n");
31 return (EXIT_FAILURE);
34 stack->data[stack->top++] = value;
35 return (EXIT_SUCCESS);
45 return (stack->data[--stack->top]);
55 return (stack->top == 0);