private int addExternalSymbolsToSet(Program program, AddressSetView addressSet,
			TaskMonitor monitor, Set<Address> set) throws CancelledException {
		int externalCount = 0;

		SymbolTable symbolTable = program.getSymbolTable();
		AddressIterator aiter = program.getSymbolTable().getExternalEntryPointIterator();
		while (aiter.hasNext()) {
			externalCount++;
			monitor.checkCancelled();
			Address entryAddr = aiter.next();
			Symbol entry = symbolTable.getPrimarySymbol(entryAddr);
			// make sure to put on things that are external entry points, but not defined symbols.
			if (addressSet.contains(entryAddr) && entry.getSource() == SourceType.DEFAULT) {
				set.add(entryAddr);
			}
		}

		return externalCount;
	}
Check for a single external entry point.

@param program - program to check
@param externalCount - count of external entry points found
@param doNowSet - set of functions that are to be done now

@return true if this program has only one external entry point
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/EntryPointAnalyzer.java