private DataType resolveDataType(DataTypeManager openDTMgrs[], CategoryPath path, DataType dt) {
		if (openDTMgrs == null) {
			return dt;
		}
		// If the exact data type exists in any open DTMgr, use the open DTmgr type
		// instead

		for (int i = 0; i < openDTMgrs.length; i++) {
			// look for the data type by name
			//    equivalent, return it
			// look for the data type by category
			//    equivalent, return it
			DataType candidateDT = openDTMgrs[i].getDataType(dt.getCategoryPath(), dt.getName());

			if (candidateDT != null && candidateDT.isEquivalent(candidateDT)) {
				return candidateDT;
			}
		}

		return dt;
	}
Given a data type manager, populate defines with constant values as Enums
Ghidra/Features/Base/src/main/java/ghidra/app/util/cparser/CPP/DefineTable.java