private void collectFunctionDefinitions(Category cat, TaskMonitor monitor,
			Map<String, FunctionDefinition> functionNameMap) throws CancelledException {

		monitor.checkCancelled();

		for (DataType dt : cat.getDataTypes()) {
			monitor.checkCancelled();
			if (!(dt instanceof FunctionDefinition)) {
				continue;
			}

			FunctionDefinition fdef = (FunctionDefinition) dt;
			String name = fdef.getName();
			if (functionNameMap.containsKey(name)) {
				FunctionDefinition dupeFdef = functionNameMap.get(name);
				if (!fdef.isEquivalent(dupeFdef)) {
					// set the functionDef to null to mark dupes
					functionNameMap.put(name, null);
				}
			}
			else {
				functionNameMap.put(name, fdef);
			}
		}

		for (Category subcat : cat.getCategories()) {
			collectFunctionDefinitions(subcat, monitor, functionNameMap);
		}
	}
Apply all descendants starting at each category node.
@param monitor task monitor
@param symbolMap symbol map where possible function definitions may be applied
@throws CancelledException if task cancelled
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/function/ApplyFunctionDataTypesCmd.java