#if PHASE == 1
# define DECLARE_CLASS(class, varname) \
  jclass varname;
# define DECLARE_FIELD_ID(class, field, type, varname) \
  jfieldID varname;
# define DECLARE_METHOD_ID(class, method, type, varname) \
  jmethodID varname;
#elif PHASE == 2
# define DECLARE_CLASS(class, varname) \
  varname = (*env)->NewGlobalRef(env, (*env)->FindClass(env, class));
# define DECLARE_FIELD_ID(classvar, field, type, varname) \
  varname = (*env)->GetFieldID(env, classvar, field, type);
# define DECLARE_METHOD_ID(classvar, method, type, varname) \
  varname = (*env)->GetMethodID(env, classvar, method, type);
#else
# define DECLARE_CLASS(class, varname) \
  (*env)->DeleteGlobalRef(env, varname);
# define DECLARE_FIELD_ID(class, field, type, varname)
# define DECLARE_METHOD_ID(classvar, method, type, varname)
#endif
#include "IDlist.h"
# undef  DECLARE_CLASS
# undef  DECLARE_FIELD_ID
# undef  DECLARE_METHOD_ID
