method.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // method.h - Header file for methodID instances. -*- c++ -*-
  2. /* Copyright (C) 1999, 2000 Free Software Foundation
  3. This file is part of libgcj.
  4. This software is copyrighted work licensed under the terms of the
  5. Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
  6. details. */
  7. #ifndef __GCJ_METHOD_H__
  8. #define __GCJ_METHOD_H__
  9. #include <java/lang/Class.h>
  10. #include <java/lang/reflect/Constructor.h>
  11. #include <java/lang/reflect/Method.h>
  12. extern inline jmethodID
  13. _Jv_FromReflectedMethod (java::lang::reflect::Method *method)
  14. {
  15. return (jmethodID)
  16. ((char *) method->declaringClass->methods + method->offset);
  17. }
  18. extern inline jmethodID
  19. _Jv_FromReflectedConstructor (java::lang::reflect::Constructor *constructor)
  20. {
  21. return (jmethodID)
  22. ((char *) constructor->declaringClass->methods + constructor->offset);
  23. }
  24. extern inline jint
  25. JvNumMethods (jclass klass)
  26. {
  27. return klass->method_count;
  28. }
  29. extern inline jmethodID
  30. JvGetFirstMethod (jclass klass)
  31. {
  32. return &klass->methods[0];
  33. }
  34. #endif /* __GCJ_METHOD_H__ */