home *** CD-ROM | disk | FTP | other *** search
-
- ISAM0.9 BETA release - 4/5/1989
- ***********************************
-
- Functions: (13)
- ==========
-
- ISAMAdd
- ISAMClose
- ISAMDelete
- ISAMError
- ISAMFirst
- ISAMLast
- ISAMNext
- ISAMOpen
- ISAMPrev
- ISAMRead
- ISAMReplace
- ISAMSearch
- ISAMUpdate
-
-
-
- Descriptions:
- =============
-
- ISAMOpen
- ------------------------------------------------------------------------------
-
- Hd = ISAMOpen(new, mode);
-
- struct ISAMHeader *Hd;
-
- struct ISAMNewFile *new;
- USHORT mode;
-
- Hd - pointer to ISAMHeader structure. NULL if error.
-
- mode - ISAM_NEWFILE creates a new file. ISAM_REPLACE replaces an old
- file (with ISAM_NEWFILE only). ISAM_OLDFILE opens an old file
- for read/write access.
-
- new - points to an initialized ISAMNewFile structure
-
-
- This function opens the data file for r/w access, reads the index
- into memory and initializes all necessary structures.
- If you create a new file and want to set the maximum key number,
- put it in ISAMHeader->ISAMKeyHeader.MaxKeys
-
-
-
-
- ISAMClose
- ------------------------------------------------------------------------------
-
- error = ISAMClose(Hd);
-
- int error;
-
- struct ISAMHeader *Hd;
-
- error - NULL if no error occurred, else EOF (-1)
-
- Hd - pointer to ISAMHeader structure.
-
- ISAMClose saves the index to disk (if ISAM_MODIFIED flag set),
- frees all memory allocated for the key list and the structures
- and closes the data file.
-
-
-
-
- ISAMUpdate
- ------------------------------------------------------------------------------
-
- error = ISAMUpdate(Hd);
-
- int error;
-
- struct ISAMHeader *Hd;
-
- error - NULL if no error occurred, else EOF (-1)
-
- Hd - pointer to ISAMHeader structure.
-
- Updates the key list to disk if ISAM_MODIFIED is set. Then
- ISAM_MODIFIED is cleared.
-
-
-
-
- ISAMError
- ------------------------------------------------------------------------------
-
- errnum = ISAMError(Hd);
-
- int errnum;
-
- struct ISAMHeader *Hd;
-
- errnum - error number of last error.
-
- Hd - pointer to ISAMHeader structure.
-
- This function returns the number of the last error.
- Actual Error numbers:
-
-
-
-
- ISAMAdd
- -------------------------------------------------------------------------------
-
- error = ISAMAdd(Hd, data);
-
- int error;
-
- struct ISAMHeader *Hd;
- APTR data;
-
-
- error - NULL if no error occurred, else EOF (-1)
-
- Hd - pointer to ISAMHeader structure
- data - pointer to an initialized data record in memory.
- The data must correspond to the field definitions in the
- ISAMDataHeader structure!
-
-
- This function writes the data in memptr to the data file and adds
- a new key to key list. Then it sets the ISAM_MODIFIED flag in
- ISAMKeyHeader.
- If the ISAM_AUTOUPDATE flag is specified, ISAMUpdate() is called.
-
-
-
-
- ISAMReplace
- ------------------------------------------------------------------------------
-
- error = ISAMReplace(Hd, data);
-
- int error;
-
- struct ISAMHeader *Hd;
- APTR data;
-
- error - NULL if no error occurred, else EOF (-1)
-
- Hd - pointer to ISAMHeader structure
- data - pointer to an initialized data record in memory.
- The data must correspond to the field definitions in the
- ISAMDataHeader structure!
-
- This function replaces the items of the current record with the new
- ones in data. The new key word must be equal to that in the
- current record!
-
-
-
-
- ISAMDelete
- ------------------------------------------------------------------------------
-
- error = ISAMDelete(Hd);
-
- int error;
-
- struct ISAMHeader *Hd;
-
- error - NULL if no error occurred, else EOF (-1)
- Hd - pointer to ISAMHeader structure.
-
- This function deletes the current record from the file.
-
-
-
-
- ISAMRead
- ------------------------------------------------------------------------------
-
- error = ISAMRead(Hd, data);
-
- int error;
-
- struct ISAMHeader *Hd;
- APTR data;
-
- error - NULL if no error occurred, else EOF (-1)
-
- Hd - pointer to ISAMHeader structure
- data - pointer to an initialized data record in memory.
- The data must correspond to the field definitions in the
- ISAMDataHeader structure!
-
- This function reads the current record into the specified memory.
- The memory space MUST be big enough to hold the whole record!
-
-
-
-
- ISAMSearch
- ------------------------------------------------------------------------------
-
- error = ISAMSearch(Hd, keyword, mode);
-
- int error;
-
- struct ISAMHeader *Hd;
- STRPTR keyword;
- int mode;
-
- error - NULL if no error occurred, else EOF (-1)
-
- Hd - pointer to ISAMHeader structure
- keyword - string pointer to the key word to search for
- mode - searching mode
-
- This function searches for the specified keyword in the key list.
-
-
-
-
- ISAMFirst
- ------------------------------------------------------------------------------
-
- error = ISAMFirst(Hd);
-
- int error;
-
- struct ISAMHeader *Hd;
-
- error - NULL if no error occurred, else EOF (-1)
-
- Hd - pointer to ISAMHeader structure
-
- This function makes the first 'real' key current, that is, the first
- key that contains information. If there is no 'real' record in the key
- list, an error is returned.
-
-
-
-
- ISAMLast
- ------------------------------------------------------------------------------
-
- error = ISAMLast(Hd);
-
- int error;
-
- struct ISAMHeader *Hd;
-
- error - NULL if no error occurred, else EOF (-1)
-
- Hd - pointer to ISAMHeader structure
-
- This function makes the last key current. If there are no keys in the
- list, an error is returned.
-
-
-
-
- ISAMNext
- ------------------------------------------------------------------------------
-
- error = ISAMNext(Hd);
-
- int error;
-
- struct ISAMHeader *Hd;
-
- error - NULL if no error occurred, else EOF (-1)
-
- Hd - pointer to ISAMHeader structure
-
- This function makes the next key in the list current. If there are no
- more keys or the current key is no valid 'real' key, an error is
- returned.
-
-
-
-
- ISAMPrev
- ------------------------------------------------------------------------------
-
- error = ISAMPrev(Hd);
-
- int error;
-
- struct ISAMHeader *Hd;
-
- error - NULL if no error occurred, else EOF (-1)
-
- Hd - pointer to ISAMHeader structure
-
- This function makes the previous key in the list current. If there are
- no more keys or the current key is no valid 'real' key, an error is
- returned.
-
-
-
-