Lines Matching defs:jfunc
74 JFunc jfunc;
79 jfunc = JFunc.convert(cfunc, true);
84 signature = jfunc.toString();
93 emitNativeDeclaration(jfunc, javaImplStream);
94 emitJavaCode(jfunc, javaImplStream);
97 emitJavaInterfaceCode(jfunc, javaInterfaceStream);
100 emitJniCode(jfunc, cStream);
108 jfunc = JFunc.convert(cfunc, false);
110 signature = jfunc.toString();
119 emitNativeDeclaration(jfunc, javaImplStream);
122 emitJavaInterfaceCode(jfunc, javaInterfaceStream);
125 emitJavaCode(jfunc, javaImplStream);
126 emitJniCode(jfunc, cStream);
130 public void emitNativeDeclaration(JFunc jfunc, PrintStream out) {
132 out.println(" /* @hide C function " + jfunc.getCFunc().getOriginal() + " */");
135 out.println(" // C function " + jfunc.getCFunc().getOriginal());
139 emitFunction(jfunc, out, true, false);
142 public void emitJavaInterfaceCode(JFunc jfunc, PrintStream out) {
143 emitFunction(jfunc, out, false, true);
146 public void emitJavaCode(JFunc jfunc, PrintStream out) {
147 emitFunction(jfunc, out, false, false);
150 boolean isPointerFunc(JFunc jfunc) {
151 String name = jfunc.getName();
153 && jfunc.getCFunc().hasPointerArg();
156 void emitFunctionCall(JFunc jfunc, PrintStream out, String iii, boolean grabArray) {
157 boolean isVoid = jfunc.getType().isVoid();
158 boolean isPointerFunc = isPointerFunc(jfunc);
162 jfunc.getType() + " _returnValue;");
166 jfunc.getName() +
170 int numArgs = jfunc.getNumArgs();
172 String argName = jfunc.getArgName(i);
173 JType argType = jfunc.getArgType(i);
492 boolean hasNonConstArg(JFunc jfunc, CFunc cfunc, List<Integer> nonPrimitiveArgs) {
496 int cIndex = jfunc.getArgCIndex(idx);
497 if (jfunc.getArgType(idx).isArray()) {
501 } else if (jfunc.getArgType(idx).isBuffer()) {
521 void emitFunction(JFunc jfunc, PrintStream out, boolean nativeDecl, boolean interfaceDecl) {
522 boolean isPointerFunc = isPointerFunc(jfunc);
536 jfunc.getType() + " " +
537 jfunc.getName() +
544 jfunc.getType() + " " +
545 jfunc.getName() +
549 int numArgs = jfunc.getNumArgs();
551 String argName = jfunc.getArgName(i);
552 JType argType = jfunc.getArgType(i);
574 // emitBoundsChecks(jfunc, out, iii);
575 emitFunctionCall(jfunc, out, iii, false);
583 String fname = jfunc.getName();
655 boolean isVoid = jfunc.getType().isVoid();
731 public void emitJniCode(JFunc jfunc, PrintStream out) {
732 CFunc cfunc = jfunc.getCFunc();
750 String outName = "android_" + jfunc.getName();
751 boolean isPointerFunc = isPointerFunc(jfunc);
755 !jfunc.getCFunc().hasPointerArg();
761 out.println(getJniType(jfunc.getType()));
764 String rsignature = getJniName(jfunc.getType());
767 int numArgs = jfunc.getNumArgs();
769 JType argType = jfunc.getArgType(i);
792 jfunc.getName() +
815 JType argType = jfunc.getArgType(i);
824 if (jfunc.getArgType(i).isBuffer()) {
825 int cIndex = jfunc.getArgCIndex(i);
836 out.print(getJniType(argType) + " " + jfunc.getArgName(i) + suffix);
848 JType argType = jfunc.getArgType(idx);
926 && (hasNonConstArg(jfunc, cfunc, nonPrimitiveArgs)
974 int cIndex = jfunc.getArgCIndex(idx);
977 if (jfunc.getArgType(idx).isBuffer()
978 || jfunc.getArgType(idx).isArray()
979 || !jfunc.getArgType(idx).isEGLHandle())
982 CType type = cfunc.getArgType(jfunc.getArgCIndex(idx));
988 "GetHandleID, " + jfunc.getArgName(idx) +
1013 int cIndex = jfunc.getArgCIndex(idx);
1016 if (!jfunc.getArgType(idx).isBuffer() && !jfunc.getArgType(idx).isArray())
1019 CType type = cfunc.getArgType(jfunc.getArgCIndex(idx));
1021 if (jfunc.getArgType(idx).isArray() && !jfunc.getArgType(idx).isClass()) {
1025 jfunc.getArgName(idx) +
1035 jfunc.getArgName(idx) +
1046 int cIndex = jfunc.getArgCIndex(idx);
1059 int cIndex = jfunc.getArgCIndex(idx);
1062 CType type = cfunc.getArgType(jfunc.getArgCIndex(idx));
1084 int cIndex = jfunc.getArgCIndex(idx);
1092 if (jfunc.getArgType(idx).isArray()
1093 && !jfunc.getArgType(idx).isEGLHandle()) {
1131 jfunc.getArgName(idx) +
1140 } else if (jfunc.getArgType(idx).isArray()
1141 && jfunc.getArgType(idx).isEGLHandle()) {
1167 jfunc.getArgName(idx) + " = new " +
1171 } else if (jfunc.getArgType(idx).isBuffer()) {
1220 int cIndex = jfunc.getArgCIndex(idx);
1222 if(!jfunc.getArgType(idx).isBuffer() || isPointerFunc) continue;
1318 int cIndex = jfunc.getArgCIndex(idx);
1319 if (jfunc.getArgType(idx).isArray() && !jfunc.getArgType(idx).isClass()) {
1325 "if (" + jfunc.getArgName(idx) + "_base) {");
1330 jfunc.getArgName(idx) + "_ref, " +
1338 } else if (jfunc.getArgType(idx).isBuffer()) {
1361 int cIndex = jfunc.getArgCIndex(idx);
1376 int cIndex = jfunc.getArgCIndex(idx);
1378 if (jfunc.getArgType(idx).isArray() && jfunc.getArgType(idx).isClass()) {
1383 "if (" + jfunc.getArgName(idx) + ") {");
1400 "delete[] " + jfunc.getArgName(idx) + ";");