コード例 #1
0
SWIGEXPORT jint JNICALL Java_com_google_webp_libwebpJNI_WebPGetInfo(JNIEnv *jenv, jclass jcls, jbyteArray jarg1, jint jarg2, jintArray jarg3, jintArray jarg4) {
  jint jresult = 0 ;
  uint8_t *arg1 = (uint8_t *) 0 ;
  uint32_t arg2 ;
  int *arg3 = (int *) 0 ;
  int *arg4 = (int *) 0 ;
  jbyte *jarr1 ;
  int temp3 ;
  int temp4 ;
  int result;

  (void)jenv;
  (void)jcls;
  if (!SWIG_JavaArrayInSchar(jenv, &jarr1, &arg1, jarg1)) return 0;
  arg2 = (uint32_t)jarg2;
  {
    if (!jarg3) {
      SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null");
      return 0;
    }
    if ((*jenv)->GetArrayLength(jenv, jarg3) == 0) {
      SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element");
      return 0;
    }
    arg3 = &temp3;
  }
  {
    if (!jarg4) {
      SWIG_JavaThrowException(jenv, SWIG_JavaNullPointerException, "array null");
      return 0;
    }
    if ((*jenv)->GetArrayLength(jenv, jarg4) == 0) {
      SWIG_JavaThrowException(jenv, SWIG_JavaIndexOutOfBoundsException, "Array must contain at least 1 element");
      return 0;
    }
    arg4 = &temp4;
  }
  {
    if (arg2 < 0) {
      {
        SWIG_JavaException(jenv, SWIG_ValueError, "Expected a non-negative value."); return 0;
      };
    }
  }
  result = (int)WebPGetInfo((uint8_t const *)arg1,arg2,arg3,arg4);
  jresult = (jint)result;
  SWIG_JavaArrayArgoutSchar(jenv, jarr1, arg1, jarg1);
  {
    jint jvalue = (jint)temp3;
    (*jenv)->SetIntArrayRegion(jenv, jarg3, 0, 1, &jvalue);
  }
  {
    jint jvalue = (jint)temp4;
    (*jenv)->SetIntArrayRegion(jenv, jarg4, 0, 1, &jvalue);
  }
  free(arg1);


  return jresult;
}
コード例 #2
0
SWIGEXPORT void JNICALL Java_drawerControllib_DrawerControlJNI_openDrawer(JNIEnv *jenv, jclass jcls) {
  (void)jenv;
  (void)jcls;
  {
    char *err;
    clear_exception();
    
    openDrawer();
    
    err = check_exception();
    
    if (err!=NULL) {
      {
        SWIG_JavaException(jenv, SWIG_IOError, err); return ; 
      };
    }
  }
}
コード例 #3
0
SWIGEXPORT jint JNICALL Java_drawerControllib_DrawerControlJNI_getStatus(JNIEnv *jenv, jclass jcls) {
  jint jresult = 0 ;
  Status result;
  
  (void)jenv;
  (void)jcls;
  {
    char *err;
    clear_exception();
    
    result = (Status)getStatus();
    
    err = check_exception();
    
    if (err!=NULL) {
      {
        SWIG_JavaException(jenv, SWIG_IOError, err); return 0; 
      };
    }
  }
  jresult = (jint)result; 
  return jresult;
}