PREV UP NEXT The Ftape Tools Manual - API


8.4.2.1: Controlling the behaviour of the library.

Library Function: void ftvt_set_ctrl (unsigned long FLAGS)

With this function it is possible to modify the behaviour of the library. The argument to this function is the bitwise or of flags defined in [INCLUDEDIR/]ftvt.h . Only two flag values are defined so far, namely

FTVT_VERBOSE

Be verbose. If not set, no error messages will be printed to stderr, and no status messages. Note however, that the last error message always is remembered by the library and one can use ftvt_get_ctrl(info) to retrieve the last error message.


FTVT_TAGGED

If set, ftvt_print() uses a tagged output format, i.e. pairs of keywords and values. This really only affects the function ftvt_print(). See Printing and Parsing.

Library Function: const struct ftvt_ctrl * ftvt_get_ctrl (void)

Query some information about the library and the tape cartridge. It isn't necessary to use this function to manipulate the volume table, but it might provide useful information. The return value is a pointer to a static storage area which's contents is valid until the next call to ftvt_get_ctrl(). struct ftvt_ctrl is defined in [INCLUDEDIR/]ftvt.h like follows:

typedef struct ftvt_ctrl {
	const char *version;
	unsigned long flags;
	int fmt_code;
	int first_seg;
	int last_seg;
	int max_volumes;
	const char *errstr;
    const char *drivetype;
} ftvt_ctrl;

Its components have the following meaning:

const char *version

A string identifying the library version, e.g. `"libftvt.la (ftape-tools) 1.07.1\n"'.


unsigned long flags

The flags specified with ftvt_set_ctrl().


int fmt_code
int first_seg
int last_seg

The so called format code identifier of the floppy tape cartridge, the first data segment and the last data segment. These values are invalid until ftvt_read() has been called to read the volume table. See Accessing the tape drive.


const char *errstr

A pointer to the error string which would have been printed in case the flag FTVT_VERBOSE had been specified in the argument to ftvt_set_ctrl. errstr always be a valid pointer, but in case there was no error errstr nevertheless still points to the previously generated error string, if any, or is a NULL pointer. The library functions will return a value of -1 in case of an error.


ftape logo Use these buttons to jump to the top menu

TOP (previous node) TOP (parent node) TOP (next node) TOP (this node)