jnipacked.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*******************************************************************************
  2. * Licensed Materials - Property of IBM
  3. * "Restricted Materials of IBM"
  4. *
  5. * (c) Copyright IBM Corp. 2012, 2015 All Rights Reserved
  6. *
  7. * US Government Users Restricted Rights - Use, duplication or disclosure
  8. * restricted by GSA ADP Schedule Contract with IBM Corp.
  9. *******************************************************************************/
  10. /*******************************************************************************
  11. * The code and application programming interfaces herein are technology
  12. * preview information that may not be made generally available by IBM as or
  13. * in a product. You are permitted to use the information only for internal
  14. * use for evaluation purposes and not for use in a production environment.
  15. * IBM provides the information without obligation of support and "as is"
  16. * without warranty of any kind.
  17. *******************************************************************************/
  18. #ifndef JNIPACKED_H
  19. #define JNIPACKED_H
  20. /**
  21. * This file is intended for customer use. Do not add internal JVM dependencies.
  22. */
  23. #include "jni.h"
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /*
  28. * Version digits are: 7B VV vv mm
  29. * where:
  30. * 7B is fixed, and identifies this module
  31. * VV is the major version
  32. * vv is the minor version
  33. * mm is the modification number
  34. */
  35. #define J9PACKED_VERSION_0_1_PRERELEASE 0x7B000001
  36. #define J9PACKED_VERSION_0_2_PRERELEASE 0x7B000200
  37. #define J9PACKED_INTERFACE_EYECATCHER {'J','9','P','K'}
  38. typedef jobject jpackedarray;
  39. /**
  40. * This function table is per-JVM, not per-thread.
  41. */
  42. typedef struct J9PackedInterfaceFunctions_ {
  43. char eyecatcher[4];
  44. jint length;
  45. jint version;
  46. jint modification;
  47. void (JNICALL *SetNestedPackedField)(JNIEnv *env, jobject packedObject, jfieldID fieldID, jobject value);
  48. void (JNICALL *SetPackedArrayElement)(JNIEnv *env, jpackedarray array, jsize index, jobject value);
  49. void (JNICALL *SetPackedBooleanArrayElement)(JNIEnv *env, jpackedarray array, jsize index, jboolean value);
  50. void (JNICALL *SetPackedByteArrayElement)(JNIEnv *env, jpackedarray array, jsize index, jbyte value);
  51. void (JNICALL *SetPackedShortArrayElement)(JNIEnv *env, jpackedarray array, jsize index, jshort value);
  52. void (JNICALL *SetPackedCharArrayElement)(JNIEnv *env, jpackedarray array, jsize index, jchar value);
  53. void (JNICALL *SetPackedIntArrayElement)(JNIEnv *env, jpackedarray array, jsize index, jint value);
  54. void (JNICALL *SetPackedLongArrayElement)(JNIEnv *env, jpackedarray array, jsize index, jlong value);
  55. void (JNICALL *SetPackedFloatArrayElement)(JNIEnv *env, jpackedarray array, jsize index, jfloat value);
  56. void (JNICALL *SetPackedDoubleArrayElement)(JNIEnv *env, jpackedarray array, jsize index, jdouble value);
  57. jobject (JNICALL *GetPackedArrayElement)(JNIEnv *env, jpackedarray array, jsize index);
  58. jboolean (JNICALL *GetPackedBooleanArrayElement)(JNIEnv *env, jpackedarray array, jsize index);
  59. jbyte (JNICALL *GetPackedByteArrayElement)(JNIEnv *env, jpackedarray array, jsize index);
  60. jshort (JNICALL *GetPackedShortArrayElement)(JNIEnv *env, jpackedarray array, jsize index);
  61. jchar (JNICALL *GetPackedCharArrayElement)(JNIEnv *env, jpackedarray array, jsize index);
  62. jint (JNICALL *GetPackedIntArrayElement)(JNIEnv *env, jpackedarray array, jsize index);
  63. jlong (JNICALL *GetPackedLongArrayElement)(JNIEnv *env, jpackedarray array, jsize index);
  64. jfloat (JNICALL *GetPackedFloatArrayElement)(JNIEnv *env, jpackedarray array, jsize index);
  65. jdouble (JNICALL *GetPackedDoubleArrayElement)(JNIEnv *env, jpackedarray array, jsize index);
  66. jlong (JNICALL *GetClassPackedDataSize)(JNIEnv *env, jclass clazz);
  67. jobject (JNICALL *AllocNativePackedObject)(JNIEnv *env, jclass clazz, void *address);
  68. jpackedarray (JNICALL *AllocNativePackedArray)(JNIEnv *env, jclass elementClass, jsize length, void *address);
  69. jpackedarray (JNICALL *AllocPackedArray)(JNIEnv *env, jclass elementClass, jsize length);
  70. void (JNICALL *FreeNativePackedObject)(JNIEnv *env, jobject nativePackedObject);
  71. void *(JNICALL *GetPackedObjectPointer)(JNIEnv *env, jobject packedObject, jboolean *isCopy);
  72. void (JNICALL *ReleasePackedObjectPointer)(JNIEnv *env, jobject packedObject, void *ptr, jint mode);
  73. void *(JNICALL *GetPackedArrayElements)(JNIEnv *env, jpackedarray packedArray, jboolean *isCopy);
  74. void (JNICALL *ReleasePackedArrayElements)(JNIEnv *env, jpackedarray packedArray, void *elems, jint mode);
  75. void (JNICALL *GetPackedArrayRegion)(JNIEnv *env, jpackedarray packedArray, jsize start, jsize length, void *buf);
  76. void (JNICALL *SetPackedArrayRegion)(JNIEnv *env, jpackedarray packedArray, jsize start, jsize length, void *buf);
  77. jboolean (JNICALL *IsIdentical)(JNIEnv *env, jobject ref1, jobject ref2);
  78. jclass (JNICALL *GetPackedArrayClass)(JNIEnv *env, jclass elementClass);
  79. jclass (JNICALL *GetPackedArrayClassComponentType)(JNIEnv *env, jclass packedArrayClass);
  80. jint (JNICALL *GetPackedArrayLength)(JNIEnv *env, jpackedarray array);
  81. } J9PackedInterfaceFunctions_;
  82. typedef const struct J9PackedInterfaceFunctions_ *J9PackedJNIEnv;
  83. #ifdef __cplusplus
  84. }
  85. #endif
  86. #endif /* JNIPACKED_H */