Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
3c7e1b80
Commit
3c7e1b80
authored
9 years ago
by
Paul Sokolovsky
Browse files
Options
Downloads
Patches
Plain Diff
unix/modjni: Add missing get_jclass_name() function.
parent
35513684
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
unix/modjni.c
+11
-0
11 additions, 0 deletions
unix/modjni.c
with
11 additions
and
0 deletions
unix/modjni.c
+
11
−
0
View file @
3c7e1b80
...
...
@@ -45,6 +45,7 @@ static JavaVM *jvm;
static
JNIEnv
*
env
;
static
jclass
Class_class
;
static
jclass
String_class
;
static
jmethodID
Class_getName_mid
;
static
jmethodID
Class_getField_mid
;
static
jmethodID
Class_getMethods_mid
;
static
jmethodID
Class_getConstructors_mid
;
...
...
@@ -233,6 +234,14 @@ STATIC void jobject_attr(mp_obj_t self_in, qstr attr_in, mp_obj_t *dest) {
}
}
STATIC
void
get_jclass_name
(
jobject
obj
,
char
*
buf
)
{
jclass
obj_class
=
JJ
(
GetObjectClass
,
obj
);
jstring
name
=
JJ
(
CallObjectMethod
,
obj_class
,
Class_getName_mid
);
jint
len
=
JJ
(
GetStringLength
,
name
);
JJ
(
GetStringUTFRegion
,
name
,
0
,
len
,
buf
);
check_exception
();
}
STATIC
mp_obj_t
jobject_subscr
(
mp_obj_t
self_in
,
mp_obj_t
index
,
mp_obj_t
value
)
{
mp_obj_jobject_t
*
self
=
self_in
;
if
(
!
JJ
(
IsInstanceOf
,
self
->
obj
,
List_class
))
{
...
...
@@ -584,6 +593,8 @@ STATIC void create_jvm() {
Object_toString_mid
=
JJ
(
GetMethodID
,
Object_class
,
"toString"
,
"()Ljava/lang/String;"
);
Class_getName_mid
=
(
*
env
)
->
GetMethodID
(
env
,
Class_class
,
"getName"
,
"()Ljava/lang/String;"
);
Class_getField_mid
=
(
*
env
)
->
GetMethodID
(
env
,
Class_class
,
"getField"
,
"(Ljava/lang/String;)Ljava/lang/reflect/Field;"
);
Class_getMethods_mid
=
(
*
env
)
->
GetMethodID
(
env
,
Class_class
,
"getMethods"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment