static int getNumberOfUndefinedsStartingAtOffset(Structure structure, int offset,
			TaskMonitor monitor) throws CancelledException {

		int numUndefineds = 0;
		int index = offset;

		while (index < structure.getLength()) {
			monitor.checkCancelled();
			DataTypeComponent component = structure.getComponentAt(index);
			if (component.getDataType() == DataType.DEFAULT) {
				index++;
				numUndefineds++;
			}
			else {
				return numUndefineds;
			}
		}
		return numUndefineds;
	}
Method to retrieve the number of undefined size 1 components starting at the given offset in the given structure
@param structure the given structure
@param offset the given offset
@param monitor task monitor
@return the number of undefined size 1 components starting at the given offset in the given structure
@throws CancelledException if cancelled
Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/EditStructureUtils.java