public static Structure createStructureDataType(Program program, Address address,
			int dataLength, String structureName, boolean makeUniqueName) {

		if (structureName == null) {
			throw new IllegalArgumentException("Structure name cannot " + "be null.");
		}

		if (dataLength <= 0) {
			throw new IllegalArgumentException(
				"Structure length must be positive, not " + dataLength);
		}

		Address endAddress;
		try {
			endAddress = address.addNoWrap(dataLength - 1);
		}
		catch (AddressOverflowException e1) {
			throw new IllegalArgumentException(
				"Can't create structure because length exceeds address " + "space" + dataLength);
		}

		AddressSet set = new AddressSet(address, endAddress);
		InstructionIterator iter = program.getListing().getInstructions(set, true);
		if (iter.hasNext()) {
			throw new IllegalArgumentException(
				"Can't create structure because the current selection " + "contains instructions");
		}

		DataTypeProviderContext providerContext = new ProgramProviderContext(program, address);

		String name = structureName;
		if (makeUniqueName) {
			name = providerContext.getUniqueName(name);
		}

		Structure newStructure = new StructureDataType(name, 0, program.getDataTypeManager());

		initializeStructureFromContext(newStructure, providerContext, dataLength);

		return newStructure;
	}
Creates a {@link StructureDataType} instance based upon the information
provided.  The instance will not be placed in memory.

@param  program The program to which the structure will belong.
@param  address The address of the structure.
@param  dataLength The number of components to add to the structure.
@param  structureName The name of the structure to create.
@param  makeUniqueName True indicates that the provided name should be
        altered as necessary in order to make it unique in the program.
@return A new structure not yet added to memory.
@throws IllegalArgumentException for the following conditions:
        <ul>
             <li>if <code>structureName</code> is <code>null</code></li>
             <li>if <code>dataLength</code> is not greater than zero</li>
             <li>if the number of components to add exceeds the available
                 address space</li>
             <li>if there are any instructions in the provided
                 address space</li>
             <li>if there are no data components to add to the structure</li>
        </ul>
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/data/StructureFactory.java