Inline-BC

 view release on metacpan or  search on metacpan

mylib/bcdefs.h  view on Meta::CPAN

/* bc arrays can also be "auto" variables and thus need the same
   kind of stacking mechanisms. */

typedef struct bc_array_node
    {
      union
	{
	  bc_num n_num [NODE_SIZE];
	  struct bc_array_node *n_down [NODE_SIZE];
	} n_items;
    } bc_array_node;

typedef struct bc_array
    {
      bc_array_node *a_tree;
      short a_depth;
    } bc_array;

typedef struct bc_var_array
    {
      bc_array *a_value;
      char      a_param;
      struct bc_var_array *a_next;
    } bc_var_array;


/* For the stacks, execution and function, we need records to allow
   for arbitrary size. */

typedef struct estack_rec {
	bc_num s_num;
	struct estack_rec *s_next;
} estack_rec;

typedef struct fstack_rec {
	int  s_val;
	struct fstack_rec *s_next;
} fstack_rec;


/* The following are for the name tree. */

typedef struct id_rec {
	char  *id;      /* The program name. */
			/* A name == 0 => nothing assigned yet. */
	int   a_name;   /* The array variable name (number). */
	int   f_name;   /* The function name (number).  */
	int   v_name;   /* The variable name (number).  */
        short balance;  /* For the balanced tree. */
	struct id_rec *left, *right; /* Tree pointers. */
} id_rec;


/* A list of files to process. */

typedef struct file_node {
	char *name;
	struct file_node *next;
} file_node;

/* Macro Definitions */

#if defined(LIBEDIT)
#define HISTORY_SIZE(n) history(hist, &histev, H_SETSIZE, n)
#define UNLIMIT_HISTORY history(hist, &histev, H_SETSIZE, INT_MAX)
#endif

#if defined(READLINE)
#define HISTORY_SIZE(n) stifle_history(n)
#define UNLIMIT_HISTORY unstifle_history()
#endif



( run in 0.643 second using v1.01-cache-2.11-cpan-d8267643d1d )