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: isfab.c /main/3 1995/10/23 11:38:24 rswiston $ */
7 static char sccsid[] = "@(#)isfab.c 1.8 89/07/17 Copyr 1988 Sun Micro";
10 * Copyright (c) 1988 by Sun Microsystems, Inc.
17 * The ISAM file access block functions.
21 #include "isam_impl.h"
25 * fab = *fab_new(isfname, mode, varlen, minreclen, maxreclen)
27 * Fab_new() creates an File access block (fab object) that is used
28 * for all subsequent operations in this file. Return a pointer to
29 * the fab object, or NULL in the case of an error.
33 _fab_new(isfname, openmode,
34 varlen, minreclen, maxreclen)
35 char *isfname; /* Local path on the host */
36 enum openmode openmode;
37 Bool varlen; /* 0/1 flag */
38 int minreclen, maxreclen;
42 /* Allocate memory for the fab object. */
43 fab = (Fab *) _ismalloc(sizeof(*fab));
44 memset((char *)fab, 0, sizeof(*fab));
51 /* Set fields in the fab objects. */
52 fab->openmode = openmode;
53 fab->varlength = varlen;
54 fab->minreclen = minreclen;
55 fab->maxreclen = maxreclen;
56 fab->isfname = _isallocstring(isfname);
58 if (fab->isfname == NULL) {
72 assert(fab->isfname != NULL);
74 _isfreestring(fab->isfname);
76 _bytearr_free(&fab->isfhandle);
77 _bytearr_free(&fab->curpos);