@Override
	public ExternalLocation addExtFunction(String extLibraryName, String extLabel, Address extAddr,
			SourceType sourceType) throws InvalidInputException, DuplicateNameException {
		SourceType locSourceType = checkExternalLabel(extLabel, extAddr, sourceType);
		lock.acquire();
		try {
			Library libraryScope = getLibraryScope(extLibraryName);
			if (libraryScope == null) {
				libraryScope = addExternalName(extLibraryName, null,
					sourceType != SourceType.DEFAULT ? sourceType : SourceType.ANALYSIS);
			}
			return addExtLocation(libraryScope, extLabel, extAddr, true, locSourceType, true);
		}
		finally {
			lock.release();
		}
	}
Constructs a new ExternalManagerDB
@param handle the open database handle
@param addrMap the address map
@param openMode the program open mode.
@param lock the program synchronization lock
@param monitor the progress monitor used when upgrading
@throws CancelledException if the user cancelled while an upgrade was occurring
@throws IOException if a database io error occurs.
@throws VersionException if the database version does not match the expected version
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/external/ExternalManagerDB.java