1 /*%% (c) Copyright 1993, 1994 Hewlett-Packard Company */
2 /*%% (c) Copyright 1993, 1994 International Business Machines Corp. */
3 /*%% (c) Copyright 1993, 1994 Sun Microsystems, Inc. */
4 /*%% (c) Copyright 1993, 1994 Novell, Inc. */
5 /*%% $XConsortium: isdelrec.c /main/3 1995/10/23 11:37:39 rswiston $ */
7 static char sccsid[] = "@(#)isdelrec.c 1.8 89/07/17 Copyr 1988 Sun Micro";
10 * Copyright (c) 1988 by Sun Microsystems, Inc.
17 * Delete a record in ISAM file.
21 #include "isam_impl.h"
25 * err = isdelrec(isfd, recnum)
27 * Isdelete() deletes a record from ISAM file. The record is identified
28 * by its record number. All indexes of the ISAM file are updated.
30 * Current record position is not changed.
31 * isrecnum is set to recnum.
34 * Returns 0 if successful, or -1 of any error.
37 * ELOCKED The file has been locked by another process.
38 * ENOTOPEN isfd does not correspond to an open ISAM file, or the
39 * ISAM file was not opened with ISINOUT mode.
40 * ENOREC Record with record number recnum does not exist.
44 isdelrec(isfd, recnum)
53 * Get File Access Block.
55 if ((fab = _isfd_find(isfd)) == NULL) {
56 _setiserrno2(ENOTOPEN, '9', '0');
61 * Check that the open mode was ISINOUT.
63 if (fab->openmode != OM_INOUT) {
64 _setiserrno2(ENOTOPEN, '9', '0');
68 if ((ret = _amdelrec(&fab->isfhandle, recnum, &fab->errcode)) == ISOK) {
69 isrecnum = recnum; /* Set isrecnum */
72 _seterr_errcode(&fab->errcode);
74 return (ret); /* Successful write */