Lines Matching refs:jfunc
75 JFunc jfunc; in emitCode() local
80 jfunc = JFunc.convert(cfunc, true); in emitCode()
85 signature = jfunc.toString(); in emitCode()
94 emitNativeDeclaration(jfunc, javaImplStream); in emitCode()
95 emitJavaCode(jfunc, javaImplStream); in emitCode()
98 emitJavaInterfaceCode(jfunc, javaInterfaceStream); in emitCode()
101 emitJniCode(jfunc, cStream); in emitCode()
115 jfunc = JFunc.convert(cfunc, false); in emitCode()
117 signature = jfunc.toString(); in emitCode()
126 emitNativeDeclaration(jfunc, javaImplStream); in emitCode()
129 emitJavaInterfaceCode(jfunc, javaInterfaceStream); in emitCode()
132 emitJavaCode(jfunc, javaImplStream); in emitCode()
133 emitJniCode(jfunc, cStream); in emitCode()
137 public void emitNativeDeclaration(JFunc jfunc, PrintStream out) { in emitNativeDeclaration() argument
139 out.println(" /* @hide C function " + jfunc.getCFunc().getOriginal() + " */"); in emitNativeDeclaration()
142 out.println(" // C function " + jfunc.getCFunc().getOriginal()); in emitNativeDeclaration()
146 emitFunction(jfunc, out, true, false); in emitNativeDeclaration()
149 public void emitJavaInterfaceCode(JFunc jfunc, PrintStream out) { in emitJavaInterfaceCode() argument
150 emitFunction(jfunc, out, false, true); in emitJavaInterfaceCode()
153 public void emitJavaCode(JFunc jfunc, PrintStream out) { in emitJavaCode() argument
154 emitFunction(jfunc, out, false, false); in emitJavaCode()
157 boolean isPointerFunc(JFunc jfunc) { in isPointerFunc() argument
158 String name = jfunc.getName(); in isPointerFunc()
160 && jfunc.getCFunc().hasPointerArg(); in isPointerFunc()
163 void emitFunctionCall(JFunc jfunc, PrintStream out, String iii, boolean grabArray) { in emitFunctionCall() argument
164 boolean isVoid = jfunc.getType().isVoid(); in emitFunctionCall()
165 boolean isPointerFunc = isPointerFunc(jfunc); in emitFunctionCall()
169 jfunc.getType() + " _returnValue;"); in emitFunctionCall()
173 jfunc.getName() + in emitFunctionCall()
177 int numArgs = jfunc.getNumArgs(); in emitFunctionCall()
179 String argName = jfunc.getArgName(i); in emitFunctionCall()
180 JType argType = jfunc.getArgType(i); in emitFunctionCall()
574 boolean hasNonConstArg(JFunc jfunc, CFunc cfunc, List<Integer> nonPrimitiveArgs) { in hasNonConstArg() argument
578 int cIndex = jfunc.getArgCIndex(idx); in hasNonConstArg()
579 if (jfunc.getArgType(idx).isArray()) { in hasNonConstArg()
583 } else if (jfunc.getArgType(idx).isBuffer()) { in hasNonConstArg()
603 void emitFunction(JFunc jfunc, PrintStream out, boolean nativeDecl, boolean interfaceDecl) { in emitFunction() argument
604 boolean isPointerFunc = isPointerFunc(jfunc); in emitFunction()
618 jfunc.getType() + " " + in emitFunction()
619 jfunc.getName() + in emitFunction()
626 jfunc.getType() + " " + in emitFunction()
627 jfunc.getName() + in emitFunction()
631 int numArgs = jfunc.getNumArgs(); in emitFunction()
633 String argName = jfunc.getArgName(i); in emitFunction()
634 JType argType = jfunc.getArgType(i); in emitFunction()
657 emitFunctionCall(jfunc, out, iii, false); in emitFunction()
665 String fname = jfunc.getName(); in emitFunction()
737 boolean isVoid = jfunc.getType().isVoid(); in emitFunction()
826 public void emitJniCode(JFunc jfunc, PrintStream out) { in emitJniCode() argument
827 CFunc cfunc = jfunc.getCFunc(); in emitJniCode()
845 String outName = "android_" + jfunc.getName(); in emitJniCode()
846 boolean isPointerFunc = isPointerFunc(jfunc); in emitJniCode()
860 && !jfunc.getCFunc().hasPointerArg(); in emitJniCode()
866 out.println(getJniType(jfunc.getType())); in emitJniCode()
869 String rsignature = getJniName(jfunc.getType()); in emitJniCode()
872 int numArgs = jfunc.getNumArgs(); in emitJniCode()
874 JType argType = jfunc.getArgType(i); in emitJniCode()
897 jfunc.getName() + in emitJniCode()
921 JType argType = jfunc.getArgType(i); in emitJniCode()
930 if (jfunc.getArgType(i).isBuffer()) { in emitJniCode()
931 int cIndex = jfunc.getArgCIndex(i); in emitJniCode()
934 bufferArgTypes.add(jfunc.getArgType(i)); in emitJniCode()
943 out.print(getJniType(argType) + " " + jfunc.getArgName(i) + suffix); in emitJniCode()
955 JType argType = jfunc.getArgType(idx); in emitJniCode()
995 getJniDefaultReturn(jfunc.getType()) + ";"); in emitJniCode()
1033 && (hasNonConstArg(jfunc, cfunc, nonPrimitiveArgs) in emitJniCode()
1095 int cIndex = jfunc.getArgCIndex(idx); in emitJniCode()
1098 if (jfunc.getArgType(idx).isBuffer() in emitJniCode()
1099 || jfunc.getArgType(idx).isArray() in emitJniCode()
1100 || !jfunc.getArgType(idx).isEGLHandle()) in emitJniCode()
1103 CType type = cfunc.getArgType(jfunc.getArgCIndex(idx)); in emitJniCode()
1109 "GetHandleID, " + jfunc.getArgName(idx) + in emitJniCode()
1134 int cIndex = jfunc.getArgCIndex(idx); in emitJniCode()
1137 if (!jfunc.getArgType(idx).isBuffer() && !jfunc.getArgType(idx).isArray()) in emitJniCode()
1140 CType type = cfunc.getArgType(jfunc.getArgCIndex(idx)); in emitJniCode()
1142 if (jfunc.getArgType(idx).isArray() && !jfunc.getArgType(idx).isClass()) { in emitJniCode()
1146 jfunc.getArgName(idx) + in emitJniCode()
1156 jfunc.getArgName(idx) + in emitJniCode()
1168 int cIndex = jfunc.getArgCIndex(idx); in emitJniCode()
1188 int cIndex = jfunc.getArgCIndex(idx); in emitJniCode()
1194 CType type = cfunc.getArgType(jfunc.getArgCIndex(idx)); in emitJniCode()
1229 int cIndex = jfunc.getArgCIndex(idx); in emitJniCode()
1240 if (jfunc.getArgType(idx).isArray() in emitJniCode()
1241 && !jfunc.getArgType(idx).isEGLHandle()) { in emitJniCode()
1289 String arrayGetter = jfunc.getArgType(idx).getArrayGetterForPrimitiveArray(); in emitJniCode()
1294 jfunc.getArgName(idx) + in emitJniCode()
1308 } else if (jfunc.getArgType(idx).isArray() in emitJniCode()
1309 && jfunc.getArgType(idx).isEGLHandle()) { in emitJniCode()
1349 jfunc.getArgName(idx) + " = new " + in emitJniCode()
1358 } else if (jfunc.getArgType(idx).isBuffer()) { in emitJniCode()
1420 int cIndex = jfunc.getArgCIndex(idx); in emitJniCode()
1422 if(!jfunc.getArgType(idx).isBuffer() || isPointerFunc) continue; in emitJniCode()
1437 JType argType = jfunc.getArgType(idx); in emitJniCode()
1529 int cIndex = jfunc.getArgCIndex(idx); in emitJniCode()
1530 if (jfunc.getArgType(idx).isArray() && !jfunc.getArgType(idx).isClass()) { in emitJniCode()
1536 "if (" + jfunc.getArgName(idx) + "_base) {"); in emitJniCode()
1537 … String arrayReleaser = jfunc.getArgType(idx).getArrayReleaserForPrimitiveArray(); in emitJniCode()
1542 jfunc.getArgName(idx) + "_ref, " + in emitJniCode()
1543 … "(j" + jfunc.getArgType(idx).getBaseType() + "*)" + cfunc.getArgName(cIndex) + in emitJniCode()
1550 } else if (jfunc.getArgType(idx).isBuffer()) { in emitJniCode()
1552 JType argType = jfunc.getArgType(idx); in emitJniCode()
1593 int cIndex = jfunc.getArgCIndex(idx); in emitJniCode()
1608 int cIndex = jfunc.getArgCIndex(idx); in emitJniCode()
1610 if (jfunc.getArgType(idx).isArray() && jfunc.getArgType(idx).isClass()) { in emitJniCode()
1615 "if (" + jfunc.getArgName(idx) + ") {"); in emitJniCode()
1632 "delete[] " + jfunc.getArgName(idx) + ";"); in emitJniCode()
1650 getJniDefaultReturn(jfunc.getType()) + ";"); in emitJniCode()
1666 getJniType(jfunc.getType()) + ")_returnValue;"); in emitJniCode()