version 1.8, 2006/01/15 19:11:59 |
version 1.9, 2006/01/16 08:09:25 |
|
|
return copy; |
return copy; |
} |
} |
|
|
int |
size_t |
stack_size(const struct stack *stack) |
stack_size(const struct stack *stack) |
{ |
{ |
return stack->sp + 1; |
return stack->sp + 1; |
|
|
static void |
static void |
stack_grow(struct stack *stack) |
stack_grow(struct stack *stack) |
{ |
{ |
int new_size, i; |
size_t new_size, i; |
|
|
if (++stack->sp == stack->size) { |
if (++stack->sp == stack->size) { |
new_size = stack->size * 2 + 1; |
new_size = stack->size * 2 + 1; |
|
|
void |
void |
stack_print(FILE *f, const struct stack *stack, const char *prefix, u_int base) |
stack_print(FILE *f, const struct stack *stack, const char *prefix, u_int base) |
{ |
{ |
int i; |
ssize_t i; |
|
|
for (i = stack->sp; i >= 0; i--) { |
for (i = stack->sp; i >= 0; i--) { |
print_value(f, &stack->stack[i], prefix, base); |
print_value(f, &stack->stack[i], prefix, base); |
|
|
static __inline void |
static __inline void |
array_free(struct array *a) |
array_free(struct array *a) |
{ |
{ |
u_int i; |
size_t i; |
|
|
if (a == NULL) |
if (a == NULL) |
return; |
return; |
|
|
array_dup(const struct array *a) |
array_dup(const struct array *a) |
{ |
{ |
struct array *n; |
struct array *n; |
u_int i; |
size_t i; |
|
|
if (a == NULL) |
if (a == NULL) |
return NULL; |
return NULL; |