ITEM

NAME

item - high-level data file manipulation routines

OVERVIEW

These routines provide a simple interface to the SFS library for users operating on small data sets. The routines allow the user to locate, load, process and write out data sets providing that they may be kept entirely within memory buffers.

SYNOPSIS


getitem(filename,it,ty,item,buff)
char    *filename;          /* pathname of file */
int     it;                 /* item type */
char    *ty;                /* item specifier */
struct item_header *item;   /* returned item header */
void    *(buff[]);          /* returned buffer address */

putitem(filename,item,numf,buff)
char    *filename;          /* pathname of file */
struct item_header *item;   /* item header */
int     numf;               /* # frames to write */
void    *buff;              /* buffer address */

putNitems(filename,item,numf,buff,numitem)
char    *filename;          /* pathname of file */
struct item_header *item;   /* item header */
int     numf;               /* # frames to write */
void    *buff;              /* buffer address */
int     numitem;            /* number of items */

DESCRIPTION

getitem searches filename and for a data set of type it and of subtype specification ty. If the data set is found, its item header is returned in item and the data is loaded into a dynamically-allocated buffer, the address of which is returned in buff. The routine does not return on failure.

putitem adds to existing data file filename the data set described by item, numf and buff.

putNitems is a generalisation of putitem for adding multiple items to a file. putNitems stores the data sets passed in item, numf and buff in temporary files and only updates the existing data file filename the last time it is called. The parameter numitem should be used to specify the number of data sets. Example use is:


	#define NUMITEMS 3
	:
	putNitems(filename,&item1,numf1,data1,NUMITEMS);
	:
	putNitems(filename,&item2,numf2,data2,NUMITEMS);
	:
	putNitems(filename,&item3,numf3,data3,NUMITEMS);

DIAGNOSTICS

These routines terminate if any error is discovered. They report failure using a call to error(SFS3) which may be provided in the user program.

VERSION/AUTHOR

3.0 - SFS versions: Mark Huckvale

SEE ALSO

sfs(SFS3) error(SFS3)
Fri Jul 09 14:54:51 2004