com.sun.jna.Function.checkCallingConvention()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(314)

本文整理了Java中com.sun.jna.Function.checkCallingConvention()方法的一些代码示例,展示了Function.checkCallingConvention()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Function.checkCallingConvention()方法的具体详情如下:
包路径:com.sun.jna.Function
类名称:Function
方法名:checkCallingConvention

Function.checkCallingConvention介绍

暂无

代码示例

代码示例来源:origin: net.java.dev.jna/jna

  1. /**
  2. * Create a new <code>Function</code> that is linked with a native
  3. * function that follows the given calling convention.
  4. *
  5. * <p>The allocated instance represents a pointer to the given
  6. * function address, called with the given calling
  7. * convention.
  8. *
  9. * @param functionAddress
  10. * Address of the native function
  11. * @param callFlags
  12. * Function <a href="#callflags">call flags</a>
  13. * @param encoding
  14. * Encoding for conversion between Java and native strings.
  15. */
  16. Function(Pointer functionAddress, int callFlags, String encoding) {
  17. checkCallingConvention(callFlags & MASK_CC);
  18. if (functionAddress == null
  19. || functionAddress.peer == 0) {
  20. throw new NullPointerException("Function address may not be null");
  21. }
  22. this.functionName = functionAddress.toString();
  23. this.callFlags = callFlags;
  24. this.peer = functionAddress.peer;
  25. this.options = Collections.EMPTY_MAP;
  26. this.encoding = encoding != null
  27. ? encoding : Native.getDefaultStringEncoding();
  28. }

代码示例来源:origin: net.java.dev.jna/jna

  1. checkCallingConvention(callFlags & MASK_CC);
  2. if (functionName == null) {
  3. throw new NullPointerException("Function name must not be null");

代码示例来源:origin: org.elasticsearch/jna

  1. /**
  2. * Create a new <code>Function</code> that is linked with a native
  3. * function that follows the given calling convention.
  4. *
  5. * <p>The allocated instance represents a pointer to the given
  6. * function address, called with the given calling
  7. * convention.
  8. *
  9. * @param functionAddress
  10. * Address of the native function
  11. * @param callFlags
  12. * Function <a href="#callflags">call flags</a>
  13. * @param encoding
  14. * Encoding for conversion between Java and native strings.
  15. */
  16. Function(Pointer functionAddress, int callFlags, String encoding) {
  17. checkCallingConvention(callFlags & MASK_CC);
  18. if (functionAddress == null
  19. || functionAddress.peer == 0) {
  20. throw new NullPointerException("Function address may not be null");
  21. }
  22. this.functionName = functionAddress.toString();
  23. this.callFlags = callFlags;
  24. this.peer = functionAddress.peer;
  25. this.options = Collections.EMPTY_MAP;
  26. this.encoding = encoding != null
  27. ? encoding : Native.getDefaultStringEncoding();
  28. }

代码示例来源:origin: org.elasticsearch/jna

  1. checkCallingConvention(callFlags & MASK_CC);
  2. if (functionName == null) {
  3. throw new NullPointerException("Function name must not be null");

相关文章