# include "dvoshell.h"

void dbInitStack (dbStack *stack) {
  stack[0].type   = 0;
  stack[0].name   = NULL;
}

// free data for stack entries (free stack explicitly)
void dbFreeStack (dbStack *stack, int Nstack) {

  int i;

  for (i = 0; i < Nstack; i++) {
    if (stack[i].name != NULL) {
      free (stack[i].name);
      stack[i].name = NULL;
    }
  }
}

/* delete name and data */
void dbFreeEntry (dbStack *stack) {

  if (stack->type != 'T') return;
  free (stack);
}
