String getUniqueName(Category category, String baseName) {
		DataTypeManager dtm = category.getDataTypeManager();
		String uniqueName = dtm.getUniqueName(category.getCategoryPath(), baseName);
		int oneUpNumber = 0;
		int pos = uniqueName.lastIndexOf('_');
		if (pos > 0) {
			try {
				String numStr = uniqueName.substring(pos + 1);
				oneUpNumber = Integer.parseInt(numStr);
				baseName = uniqueName.substring(0, pos);
			}
			catch (NumberFormatException e) {
				// leave at 0
			}
		}

		while (nameExists(dtm, uniqueName)) {
			++oneUpNumber;
			uniqueName = baseName + "_" + oneUpNumber;
		}
		return uniqueName;
	}
Generate a unique data type name; Checks the data type manager for the indicated category
to determine a unique name based on the specified base name. Also, checks the current
edit sessions so we don't use a name already being edited.
@param category the category where the data type will be saved after editing.
@param baseName the base name of the data type
@return the unique data type name.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/editor/DataTypeEditorManager.java