@Override
	public boolean applyTo(Program program) {

		if (extSymbol == null) {
			return createExternalFunction(program);
		}

		if (!extSymbol.isExternal() || extSymbol.getSymbolType() != SymbolType.LABEL) {
			// status = "Invalid symbol specified";
			return false;
		}

		// Convert symbol to external function
		ExternalLocation extLoc = (ExternalLocation) extSymbol.getObject();
		Function function = extLoc.createFunction();
		extSymbol = function.getSymbol();
		if (extSymbol.getSource() != source) {
			extSymbol.setSource(source);
		}
		return true;
	}
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