/*
  Context for a host primitive operating in the NeXtMidas environment.

  @author Jeff Schoen
  @version $Id: context.h,v 1.5 2007/11/21 19:18:26 jxc Exp $

*/

#include "cdefs.h"
#include "native.h"
#include "midas.h"
#include "xmcompat.h"

#define MAXCONTROLS 16
#define MAXMALLOCS 1024 /* JC4: 30MAR06 I made this bigger. */

typedef struct {
  char    name[16];
  int_4   type;
  int_4   lval;
  double  dval;
  int_4   llist;
  char   *list;
} Control;
  
typedef struct {
  JNIEnv   *env;
  jobject   nm;   /* Pointer to NmJackets instance */
  int_8     initStackSize; /* Initial stack size */
  double    todo;
  int_4     isPiped;
  int_4     ncontrols;
  Control   controls[MAXCONTROLS];
  int_4     nmallocs;
  M_PTR_T   mallocs[MAXMALLOCS];
  MCSTRUCT *mc;
  MUSTRUCT *mu;
} Context;

