Metrologic Optimus S Programming Manual page 197

"c" programming guide
Table of Contents

Advertisement

delete_top
Purpose
To delete a specified number of bytes from the top (beginning-of-file position)
of a DAT file.
Syntax
int delete_top (int fd, int count);
int fd;
int count;
Example
delete_top (fd, 80);
This routine deletes the number of bytes (count) from a DAT file (fd).
Description
Return
If successful, it returns the number of bytes actually removed from the file.
On error, it returns -1.
An error code is set to the global variable fErrorCode to indicate the error
condition encountered. Below are possible error codes and their interpretation.
Error Code
2
4
7
8
9
delete_topln
See Also
delete_topln
Purpose
To delete a line (null-terminated string) from the top (beginning-of-file
position) of a DAT file.
Syntax
int delete_topln (int fd);
int fd;
Example
delete_topln (fd);
Description
This routine deletes a null-terminated string specified from a DAT file (fd).
Chapter 3 Terminal Specific Function Library
Removal of data starts at the beginning-of-file position of the file, and the
file pointer position is adjusted accordingly.
For example, if initially the file pointer points to the tenth character, after
deleting eight characters from the file, the new file pointer will points to
the 2nd character of the file.
This routine will resize the file size automatically.
Interpretation
File specified by fd does not exist.
File specified by fd is not a DAT file.
Invalid file handle.
File not opened.
The value of count is negative.
Characters are removed from the file until a null character (\0) or
end-of-file is encountered. The null character is also removed from the
file.
/* file handle of the target DAT file */
/* number of bytes to be deleted */
/* file handle of the target DAT file */
191

Advertisement

Table of Contents
loading

This manual is also suitable for:

Optimus r

Table of Contents