Element parent = functionSignature.getParentElement(); if (parent instanceof TypeRef.Pointer) parent = parent.getParentElement();
Element parent = functionSignature.getParentElement(); if (parent instanceof TypeRef.Pointer) parent = parent.getParentElement();
/** * @return true if the functionSignature changed and triggerered * revisitation */ private boolean chooseNameIfMissing(FunctionSignature functionSignature) { Function function = functionSignature.getFunction(); Element parent = functionSignature.getParentElement(); if (function != null && (isNull(function.getName()) || parent instanceof VariablesDeclaration || parent instanceof Arg)) { String name = null; String exact = JNAeratorUtils.getExactTypeDefName(functionSignature); if (exact != null) { name = exact; } else { List<String> ownerNames = JNAeratorUtils.guessOwnerName(function); if (function.getName() != null) { ownerNames.add(function.getName().toString()); } name = chooseName(functionSignature, ownerNames, true); } if (name != null) { function.setName(ident(name)); function.accept(this); return true; } } return false; } Map<String, Integer> nextUnnamedId = new LinkedHashMap<String, Integer>();
@Override public void visitFunctionSignature(FunctionSignature functionSignature) { Identifier origName = functionSignature.getFunction() == null ? null : functionSignature.getFunction().getName(); Element parent = functionSignature.getParentElement(); if (functionSignature.getParentElement() instanceof Arg) { Arg arg = (Arg) functionSignature.getParentElement(); if (arg.getName() == null) { arg.setName(origName.toString());
@Override public void visitFunctionSignature(FunctionSignature functionSignature) { Identifier origName = functionSignature.getFunction() == null ? null : functionSignature.getFunction().getName(); Element parent = functionSignature.getParentElement(); if (functionSignature.getParentElement() instanceof Arg) { Arg arg = (Arg) functionSignature.getParentElement(); if (arg.getName() == null) { arg.setName(origName.toString());
Element parent = functionSignature.getParentElement(); Element comel = parent != null && parent instanceof TypeDef ? parent : functionSignature;
Element parent = functionSignature.getParentElement(); Element comel = parent != null && parent instanceof TypeDef ? parent : functionSignature;
/** * @return true if the functionSignature changed and triggerered * revisitation */ private boolean chooseNameIfMissing(FunctionSignature functionSignature) { Function function = functionSignature.getFunction(); Element parent = functionSignature.getParentElement(); if (function != null && (isNull(function.getName()) || parent instanceof VariablesDeclaration || parent instanceof Arg)) { String name = null; String exact = JNAeratorUtils.getExactTypeDefName(functionSignature); if (exact != null) { name = exact; } else { List<String> ownerNames = JNAeratorUtils.guessOwnerName(function); if (function.getName() != null) { ownerNames.add(function.getName().toString()); } name = chooseName(functionSignature, ownerNames, true); } if (name != null) { function.setName(ident(name)); function.accept(this); return true; } } return false; } Map<String, Integer> nextUnnamedId = new LinkedHashMap<String, Integer>();
public void visitFunctionSignature(FunctionSignature e) { if (e.getFunction() == null) { return; } assert e.getFunction().getBody() == null; modifiersStringPrefix(e); append(e.getFunction().getValueType()).space(e.getFunction().getValueType() != null); if (e.getParentElement() instanceof TypeRef.Pointer) { append("("); modifiersStringPrefix(e.getFunction()); switch (e.getType()) { case CFunction: append("*"); break; case ObjCBlock: append("^"); break; } append(e.getFunction().getName()); append(")"); } else { append(e.getFunction().getName()); } append("("); implode(e.getFunction().getArgs(), ", "); append(")"); append(e.getModifiers().isEmpty() ? "" : " "); implode(e.getModifiers(), " "); }