ENVISAT Product Reader C API: Main Page

ENVISAT Product Reader API for C |

# Record Access
[Basic Data Access]

## Functions
EPR_SRecord * | epr_create_record (EPR_SDatasetId *dataset_id)
| Creates a new, empty record with a structure compatible with the dataset specified by dataset_id.
EPR_SRecord * | epr_read_record (EPR_SDatasetId *dataset_id, uint record_index, EPR_SRecord *record)
| Reads a record of a dataset specified by dataset_id.
void | epr_free_record (EPR_SRecord *record)
| Frees the memory allocated through the given record.

## Function Documentation

EPR_SRecord* epr_create_record | ( | EPR_SDatasetId * | dataset_id | ) |

Creates a new, empty record with a structure compatible with the dataset specified by dataset_id.

Such a record is typically used in subsequent calls to epr_read_record.

Parameters:

  | dataset_id | the dataset identifier, must not be `NULL`

Returns:
  the new record instance or `NULL` if an error occured.

EPR_SRecord* epr_read_record | ( | EPR_SDatasetId * | dataset_id,
|  | uint | record_index,
|  | EPR_SRecord * | record |
| ) |  |  |

Reads a record of a dataset specified by dataset_id.

The record is identified through the given dataset identifier and the given zero-based record index. In order to reduce memory reallocation, a record (pre-) created by the function `epr_create_record` can be passed to this function. Data is then read into this given record. If no record (`NULL`) is given, the function initiates a new one. In both cases, the record in which the data is read into will be returned.

Parameters:

  | dataset_id | the dataset identifier, must not be `NULL`
  | record_index | the zero-based record index
  | record | a pre-created record to reduce memory reallocation, can be `NULL` to let the function allocate a new record

Returns:
  the record in which the data has been read into or `NULL` if an error occured.

void epr_free_record | ( | EPR_SRecord * | record | ) |

Frees the memory allocated through the given record.

After calling this function the given record pointer becomes invalid and should not be used anymore.