@@ -67,12 +67,40 @@ struct IOClass {
6767 return exc;
6868 }
6969
70+ // boolean foo(void)
71+ int invokeBoolVoid (const char *name, var_s *retval) {
72+ int result = 0 ;
73+ if (_instance != nullptr ) {
74+ jmethodID method = env->GetMethodID (_clazz, name, " ()Z" );
75+ int value = 0 ;
76+ if (method != nullptr ) {
77+ value = env->CallBooleanMethod (_instance, method);
78+ }
79+ if (!checkException ()) {
80+ v_setint (retval, value);
81+ result = 1 ;
82+ }
83+ }
84+ return result;
85+ }
86+
7087 // float foo(void)
7188 int invokeFloatVoid (const char *name, var_s *retval) {
7289 int result = 0 ;
90+ if (_instance != nullptr ) {
91+ jmethodID method = env->GetMethodID (_clazz, name, " ()F" );
92+ var_num_t value = 0 ;
93+ if (method != nullptr ) {
94+ value = env->CallFloatMethod (_instance, method);
95+ }
96+ if (!checkException ()) {
97+ v_setreal (retval, value);
98+ result = 1 ;
99+ }
100+ }
73101 return result;
74102 }
75-
103+
76104 // int foo(void)
77105 int invokeIntVoid (const char *name, var_s *retval) {
78106 int result = 0 ;
@@ -90,12 +118,36 @@ struct IOClass {
90118 return result;
91119 }
92120
121+ // void foo(boolean)
122+ int invokeVoidBool (const char *name, int value, var_s *retval) {
123+ int result = 0 ;
124+ if (_instance != nullptr ) {
125+ jmethodID method = env->GetMethodID (_clazz, name, " (Z)V" );
126+ if (method != nullptr ) {
127+ env->CallVoidMethod (_instance, method, value);
128+ }
129+ if (!checkException ()) {
130+ result = 1 ;
131+ }
132+ }
133+ return result;
134+ }
135+
93136 // void foo(float)
94137 int invokeVoidFloat (const char *name, var_num_t value, var_s *retval) {
95138 int result = 0 ;
139+ if (_instance != nullptr ) {
140+ jmethodID method = env->GetMethodID (_clazz, name, " ()F" );
141+ if (method != nullptr ) {
142+ env->CallVoidMethod (_instance, method, value);
143+ }
144+ if (!checkException ()) {
145+ result = 1 ;
146+ }
147+ }
96148 return result;
97149 }
98-
150+
99151 // void foo(int)
100152 int invokeVoidInt (const char *name, int value, var_s *retval) {
101153 int result = 0 ;
0 commit comments