2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these libraries and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /*%% (c) Copyright 1993, 1994 Hewlett-Packard Company */
24 /*%% (c) Copyright 1993, 1994 International Business Machines Corp. */
25 /*%% (c) Copyright 1993, 1994 Sun Microsystems, Inc. */
26 /*%% (c) Copyright 1993, 1994 Novell, Inc. */
27 /*%% $XConsortium: isfab.c /main/3 1995/10/23 11:38:24 rswiston $ */
29 * Copyright (c) 1988 by Sun Microsystems, Inc.
36 * The ISAM file access block functions.
41 #include "isam_impl.h"
45 * fab = *fab_new(isfname, mode, varlen, minreclen, maxreclen)
47 * Fab_new() creates an File access block (fab object) that is used
48 * for all subsequent operations in this file. Return a pointer to
49 * the fab object, or NULL in the case of an error.
51 * isfname, Local path on the host
56 _fab_new(char *isfname, enum openmode openmode, Bool varlen, int minreclen, int maxreclen)
60 /* Allocate memory for the fab object. */
61 fab = (Fab *) _ismalloc(sizeof(*fab));
62 memset((char *)fab, 0, sizeof(*fab));
69 /* Set fields in the fab objects. */
70 fab->openmode = openmode;
71 fab->varlength = varlen;
72 fab->minreclen = minreclen;
73 fab->maxreclen = maxreclen;
74 fab->isfname = _isallocstring(isfname);
76 if (fab->isfname == NULL) {
86 _fab_destroy(Fab *fab)
89 assert(fab->isfname != NULL);
91 _isfreestring(fab->isfname);
93 _bytearr_free(&fab->isfhandle);
94 _bytearr_free(&fab->curpos);