private boolean createExternalFunction(Program program) {
		try {
			ExternalManager extMgr = program.getExternalManager();
			ExternalLocation extLoc;
			if (parentNamespace == null) {
				extLoc = extMgr.addExtFunction(libraryName, name, address, source);
			}
			else {
				extLoc = extMgr.addExtFunction(parentNamespace, name, address, source);
			}
			extSymbol = extLoc.getSymbol();
			return true;
		}
		catch (DuplicateNameException e) {
			status = e.getMessage();
		}
		catch (InvalidInputException e) {
			status = e.getMessage();
		}
		return false;
	}
Create an external function in the specified external namespace.
@param externalParentNamespace the external parent namespace where the named function should be created (required)
@param name function name (required)
@param address the address of the function's entry point in the external library (optional)
@param source the source type for this external function
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/function/CreateExternalFunctionCmd.java