Lines Matching refs:jfunc
74 JFunc jfunc; in emitCode() local
79 jfunc = JFunc.convert(cfunc, true); in emitCode()
84 signature = jfunc.toString(); in emitCode()
93 emitNativeDeclaration(jfunc, javaImplStream); in emitCode()
94 emitJavaCode(jfunc, javaImplStream); in emitCode()
97 emitJavaInterfaceCode(jfunc, javaInterfaceStream); in emitCode()
100 emitJniCode(jfunc, cStream); in emitCode()
114 jfunc = JFunc.convert(cfunc, false); in emitCode()
116 signature = jfunc.toString(); in emitCode()
125 emitNativeDeclaration(jfunc, javaImplStream); in emitCode()
128 emitJavaInterfaceCode(jfunc, javaInterfaceStream); in emitCode()
131 emitJavaCode(jfunc, javaImplStream); in emitCode()
132 emitJniCode(jfunc, cStream); in emitCode()
136 public void emitNativeDeclaration(JFunc jfunc, PrintStream out) { in emitNativeDeclaration() argument
138 out.println(" /* @hide C function " + jfunc.getCFunc().getOriginal() + " */"); in emitNativeDeclaration()
141 out.println(" // C function " + jfunc.getCFunc().getOriginal()); in emitNativeDeclaration()
145 emitFunction(jfunc, out, true, false); in emitNativeDeclaration()
148 public void emitJavaInterfaceCode(JFunc jfunc, PrintStream out) { in emitJavaInterfaceCode() argument
149 emitFunction(jfunc, out, false, true); in emitJavaInterfaceCode()
152 public void emitJavaCode(JFunc jfunc, PrintStream out) { in emitJavaCode() argument
153 emitFunction(jfunc, out, false, false); in emitJavaCode()
156 boolean isPointerFunc(JFunc jfunc) { in isPointerFunc() argument
157 String name = jfunc.getName(); in isPointerFunc()
159 && jfunc.getCFunc().hasPointerArg(); in isPointerFunc()
162 void emitFunctionCall(JFunc jfunc, PrintStream out, String iii, boolean grabArray) { in emitFunctionCall() argument
163 boolean isVoid = jfunc.getType().isVoid(); in emitFunctionCall()
164 boolean isPointerFunc = isPointerFunc(jfunc); in emitFunctionCall()
168 jfunc.getType() + " _returnValue;"); in emitFunctionCall()
172 jfunc.getName() + in emitFunctionCall()
176 int numArgs = jfunc.getNumArgs(); in emitFunctionCall()
178 String argName = jfunc.getArgName(i); in emitFunctionCall()
179 JType argType = jfunc.getArgType(i); in emitFunctionCall()
546 boolean hasNonConstArg(JFunc jfunc, CFunc cfunc, List<Integer> nonPrimitiveArgs) { in hasNonConstArg() argument
550 int cIndex = jfunc.getArgCIndex(idx); in hasNonConstArg()
551 if (jfunc.getArgType(idx).isArray()) { in hasNonConstArg()
555 } else if (jfunc.getArgType(idx).isBuffer()) { in hasNonConstArg()
575 void emitFunction(JFunc jfunc, PrintStream out, boolean nativeDecl, boolean interfaceDecl) { in emitFunction() argument
576 boolean isPointerFunc = isPointerFunc(jfunc); in emitFunction()
590 jfunc.getType() + " " + in emitFunction()
591 jfunc.getName() + in emitFunction()
598 jfunc.getType() + " " + in emitFunction()
599 jfunc.getName() + in emitFunction()
603 int numArgs = jfunc.getNumArgs(); in emitFunction()
605 String argName = jfunc.getArgName(i); in emitFunction()
606 JType argType = jfunc.getArgType(i); in emitFunction()
629 emitFunctionCall(jfunc, out, iii, false); in emitFunction()
637 String fname = jfunc.getName(); in emitFunction()
709 boolean isVoid = jfunc.getType().isVoid(); in emitFunction()
798 public void emitJniCode(JFunc jfunc, PrintStream out) { in emitJniCode() argument
799 CFunc cfunc = jfunc.getCFunc(); in emitJniCode()
817 String outName = "android_" + jfunc.getName(); in emitJniCode()
818 boolean isPointerFunc = isPointerFunc(jfunc); in emitJniCode()
832 && !jfunc.getCFunc().hasPointerArg(); in emitJniCode()
838 out.println(getJniType(jfunc.getType())); in emitJniCode()
841 String rsignature = getJniName(jfunc.getType()); in emitJniCode()
844 int numArgs = jfunc.getNumArgs(); in emitJniCode()
846 JType argType = jfunc.getArgType(i); in emitJniCode()
869 jfunc.getName() + in emitJniCode()
893 JType argType = jfunc.getArgType(i); in emitJniCode()
902 if (jfunc.getArgType(i).isBuffer()) { in emitJniCode()
903 int cIndex = jfunc.getArgCIndex(i); in emitJniCode()
906 bufferArgTypes.add(jfunc.getArgType(i)); in emitJniCode()
915 out.print(getJniType(argType) + " " + jfunc.getArgName(i) + suffix); in emitJniCode()
927 JType argType = jfunc.getArgType(idx); in emitJniCode()
967 getJniDefaultReturn(jfunc.getType()) + ";"); in emitJniCode()
1005 && (hasNonConstArg(jfunc, cfunc, nonPrimitiveArgs) in emitJniCode()
1067 int cIndex = jfunc.getArgCIndex(idx); in emitJniCode()
1070 if (jfunc.getArgType(idx).isBuffer() in emitJniCode()
1071 || jfunc.getArgType(idx).isArray() in emitJniCode()
1072 || !jfunc.getArgType(idx).isEGLHandle()) in emitJniCode()
1075 CType type = cfunc.getArgType(jfunc.getArgCIndex(idx)); in emitJniCode()
1081 "GetHandleID, " + jfunc.getArgName(idx) + in emitJniCode()
1106 int cIndex = jfunc.getArgCIndex(idx); in emitJniCode()
1109 if (!jfunc.getArgType(idx).isBuffer() && !jfunc.getArgType(idx).isArray()) in emitJniCode()
1112 CType type = cfunc.getArgType(jfunc.getArgCIndex(idx)); in emitJniCode()
1114 if (jfunc.getArgType(idx).isArray() && !jfunc.getArgType(idx).isClass()) { in emitJniCode()
1118 jfunc.getArgName(idx) + in emitJniCode()
1128 jfunc.getArgName(idx) + in emitJniCode()
1140 int cIndex = jfunc.getArgCIndex(idx); in emitJniCode()
1160 int cIndex = jfunc.getArgCIndex(idx); in emitJniCode()
1166 CType type = cfunc.getArgType(jfunc.getArgCIndex(idx)); in emitJniCode()
1201 int cIndex = jfunc.getArgCIndex(idx); in emitJniCode()
1212 if (jfunc.getArgType(idx).isArray() in emitJniCode()
1213 && !jfunc.getArgType(idx).isEGLHandle()) { in emitJniCode()
1261 String arrayGetter = jfunc.getArgType(idx).getArrayGetterForPrimitiveArray(); in emitJniCode()
1266 jfunc.getArgName(idx) + in emitJniCode()
1280 } else if (jfunc.getArgType(idx).isArray() in emitJniCode()
1281 && jfunc.getArgType(idx).isEGLHandle()) { in emitJniCode()
1321 jfunc.getArgName(idx) + " = new " + in emitJniCode()
1330 } else if (jfunc.getArgType(idx).isBuffer()) { in emitJniCode()
1392 int cIndex = jfunc.getArgCIndex(idx); in emitJniCode()
1394 if(!jfunc.getArgType(idx).isBuffer() || isPointerFunc) continue; in emitJniCode()
1409 JType argType = jfunc.getArgType(idx); in emitJniCode()
1501 int cIndex = jfunc.getArgCIndex(idx); in emitJniCode()
1502 if (jfunc.getArgType(idx).isArray() && !jfunc.getArgType(idx).isClass()) { in emitJniCode()
1508 "if (" + jfunc.getArgName(idx) + "_base) {"); in emitJniCode()
1509 … String arrayReleaser = jfunc.getArgType(idx).getArrayReleaserForPrimitiveArray(); in emitJniCode()
1514 jfunc.getArgName(idx) + "_ref, " + in emitJniCode()
1515 … "(j" + jfunc.getArgType(idx).getBaseType() + "*)" + cfunc.getArgName(cIndex) + in emitJniCode()
1522 } else if (jfunc.getArgType(idx).isBuffer()) { in emitJniCode()
1524 JType argType = jfunc.getArgType(idx); in emitJniCode()
1560 int cIndex = jfunc.getArgCIndex(idx); in emitJniCode()
1575 int cIndex = jfunc.getArgCIndex(idx); in emitJniCode()
1577 if (jfunc.getArgType(idx).isArray() && jfunc.getArgType(idx).isClass()) { in emitJniCode()
1582 "if (" + jfunc.getArgName(idx) + ") {"); in emitJniCode()
1599 "delete[] " + jfunc.getArgName(idx) + ";"); in emitJniCode()
1617 getJniDefaultReturn(jfunc.getType()) + ";"); in emitJniCode()
1633 getJniType(jfunc.getType()) + ")_returnValue;"); in emitJniCode()