NAME
wavgest, wavpest - Read or write an arbitrarily lengthed segment table
SYNOPSIS
#include "wiodef.h"
SEGETBL * wavgest (WVFILE *wfp)
short wavpest (WVFILE *wfp, SEGETBL *fm_etbl)
DESCRIPTION
wavgest() copies the segment data from the waveform associated with
wfp and returns a pointer to a newly allocated SEGETBL structure
containing the data. On error a NULL is returned
wavpest() applies the segment data from fm_etbl to the waveform
associated with wfp. The segment data in the waveform is overwritten
with the data in the segment table.
In wavpest(), invalid segments (name duplication or invalid
endpoints) will cause an error message, and will not be added to the waveform.
The segment data is stored in a SEGETBL structure
containing an arbitrary number of SEGMENT structures. These
structures are defined:
typedef struct {
long begin;
long end;
char name[8];
} SEGMENT;
typedef struct {
short nseg;
SEGMENT *segs;
} SEGETBL;
RETURN VALUES
wavgest() returns a pointer to the segment table on success or a NULL on
error.
wavpest() returns 0 on success. If any segment cannot be added, the
copy is terminated immediatly, and the reason is returned in an error
value as follows:
- -1
- unalterable name collision
- -2
- invalid segment definition
- -3
- system error
SEE ALSO
addseg(),
addsega(),
free_segetbl(),
wavmrgest(),
wavcpyest(),
SEGMENT,
SEGETBL,
Libcwav library
AUTHOR
H.T.Bunnell, Shirley Peters