Buy Contact NSDSP Home

hex_map_delete_block

This function removes a hex block from the Hex Map object.

Syntax

hex_block_t hex_map_delete_block(
        hex_map_t         map,
        hex_block_t       block
);

Parameters

map - a reference to the Hex Map object

block - a pointer to the Hex block being deleted. The block must belong to the Hex Map specified by map, otherwise the result is unpredictable.

Return

The function returns a pointer to the Hex block next to the block being deleted or NULL if the deleted block was the last.

Example

The example below shows how to enumerate Hex blocks while deleting unneeded blocks on the way.

void DeleteEEPROM(
  hex_map_t hm,
  mcu_t mcu)
{
  hex_block_t b;

  b = hex_map_first_block(hm);
  while (b) {
    if (mcu_test_memory(mcu,b->addr) == MCU_MEM_EEPROM) {
      b = hex_map_delete_block(hm,b);
    } else {
      b = hex_block_next(b);
    }
  }
}

 

Minimum library version - 163

Northern Software Home NSDSP Contact Us Purchase/View Cart

© 2007-2025 Northern Software Inc. All Rights Reserved.