NAME

addseg, addsega - add segment definition to waveform

SYNOPSIS

#include "wiodef.h"
short addseg (WVFILE *wfp, char *segnam, long begbyt, long endbyt)
short addsega (WVFILE *wfp, char *segnam, long begbyt, long endbyt)

DESCRIPTION

addseg() adds a new segment definition to the waveform open as wfp. If segnam already exists, it returns an error.
addsega() adds a new segment definition to the waveform open as wfp. If segnam already exists, addsega() appends a number to segnam, truncating it if necessary, and tries again. Numbers are tried in sequence from 1 to the maximum positive short.
The segment definition is considered invalid if either endpoint is unset (a negative number.)

RETURN VALUES

On success, with no name collision, addseg() and addsega() return 0. If addsega() can successfully add the segment by appending a number to segnam, it will return the number appended. If the segment cannot be added, the reason is returned as follows:
-1
unalterable name collision
-2
invalid segment definition
-3
system error

SEE ALSO

delseg(), wavpst(), wavpest(),
Libcwav library

AUTHOR

Shirley Peters