_ntar_file_handlers Struct Reference
[Structures]

#include <ntar.h>


Detailed Description

This structure contains the read/write/seek callbacks that ntar uses to manage an ntar file when the application provides its own read/write/seek functions to deal with the underlying storage.

These callbacks are useful when the application wants to read and write data from non-standard files, or compressed/cripted files, or directly to memory.


Data Fields

void * handle
 Opaque handler defined by the application defining the read/write/seek handlers. This pointer is passed untouched by the library to the handlers as their first parameter. The user usually uses this opaque handle to store a pointer to some sort of descriptor (e.g. the typical FILE* pointer) of the underlying file.
ntar_read_handler read_handler
 This function is called by ntar to read some data out of the underlying storage. It is necessary to define this function when the file is opened in read mode.
ntar_seek_handler seek_handler
 This function is used by ntar in various occasions when the file is opened in both read or write mode. It is usually used to perform backwards seeks in the file, block skipping, and to rewrite some fields in the trace file. This function is optional (in case it's missing, it should be set to NULL).
ntar_write_handler write_handler
 This function is called by ntar to write some data to the underlying storage. It is necessary to define this function when the file is opened in write mode.


Field Documentation

void* _ntar_file_handlers::handle
 

Opaque handler defined by the application defining the read/write/seek handlers. This pointer is passed untouched by the library to the handlers as their first parameter. The user usually uses this opaque handle to store a pointer to some sort of descriptor (e.g. the typical FILE* pointer) of the underlying file.

ntar_read_handler _ntar_file_handlers::read_handler
 

This function is called by ntar to read some data out of the underlying storage. It is necessary to define this function when the file is opened in read mode.

ntar_seek_handler _ntar_file_handlers::seek_handler
 

This function is used by ntar in various occasions when the file is opened in both read or write mode. It is usually used to perform backwards seeks in the file, block skipping, and to rewrite some fields in the trace file. This function is optional (in case it's missing, it should be set to NULL).

ntar_write_handler _ntar_file_handlers::write_handler
 

This function is called by ntar to write some data to the underlying storage. It is necessary to define this function when the file is opened in write mode.


NTAR documentation. Copyright (c) 2004 - 2005 Condor Engineering, Inc. All rights reserved.