#include  <mpi.h>
#include "mpi_Errhandler.h"

#include "ID.h"

DECLARE_CLASS("mpi/Errhandler", errhandler_class)
DECLARE_FIELD_ID(errhandler_class, "handle", "J", ErrhandleID)

/*
 * Class:     mpi_Errhandler
 * Method:    init
 * Signature: ()V
 */
JNIEXPORT void JNICALL Java_mpi_Errhandler_init
  (JNIEnv *env, jclass thisClass)
{
}

/*
 * Class:     mpi_Errhandler
 * Method:    GetErrhandler
 * Signature: (I)V
 */
JNIEXPORT void JNICALL Java_mpi_Errhandler_GetErrhandler
  (JNIEnv *env, jobject jthis, jint type)
{
  switch (type) {
  case 0:
      (*env)->SetLongField(env,jthis, ErrhandleID, (jlong)MPI_ERRORS_RETURN);
  case 1:
      (*env)->SetLongField(env,jthis, ErrhandleID, (jlong)MPI_ERRORS_ARE_FATAL);
  }
}


