private String getTypeDeclaration(String name, DataType dataType, int instanceLength,
			boolean writeEnabled, TaskMonitor monitor) throws IOException, CancelledException {

		if (name == null) {
			name = "";
		}

		StringBuilder sb = new StringBuilder();
		String componentString = null;
		if (dataType instanceof Dynamic) {
			componentString = getDynamicComponentString((Dynamic) dataType, name, instanceLength);
			if (componentString != null) {
				sb.append(componentString);
			}
			else {
				sb.append(comment(
					"ignoring dynamic datatype inside composite: " + dataType.getDisplayName()));
				sb.append(EOL);
			}
		}

		if (componentString == null) {
			if (dataType instanceof BitFieldDataType) {
				BitFieldDataType bfDt = (BitFieldDataType) dataType;
				name += ":" + bfDt.getDeclaredBitSize();
				dataType = bfDt.getBaseDataType();
			}

			while (true) {
				if (dataType instanceof Array array) {
					name += "[" + array.getNumElements() + "]";
					dataType = array.getDataType();
				}
				else if (dataType instanceof Pointer pointer) {
					DataType elem = pointer.getDataType();
					if (elem == null) {
						break;
					}
					name = "*" + name;
					dataType = elem;
					if (dataType instanceof Array) {
						name = "(" + name + ")";
					}
				}
				else {
					break;
				}
			}

			DataType baseDataType = getBaseDataType(dataType);
			if (baseDataType instanceof FunctionDefinition) {
				componentString = getFunctionPointerString((FunctionDefinition) baseDataType, name,
					dataType, writeEnabled, monitor);
			}
			else {
				componentString = getDataTypePrefix(dataType) + dataType.getDisplayName();
				if (name.length() != 0) {
					componentString += " " + name;
				}
			}
			sb.append(componentString);
		}
		return sb.toString();
	}
Writes the data type as ANSI-C using the underlying writer.
@param dt the data type to write as ANSI-C
@param monitor the task monitor
@throws IOException if there is an exception writing the output
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/DataTypeWriter.java