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 librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: recread.c /main/2 1996/05/09 04:15:18 drk $ */
25 * COMPONENT_NAME: austext
27 * FUNCTIONS: d_recread
31 * OBJECT CODE ONLY SOURCE MATERIALS
33 /*-----------------------------------------------------------------------
34 recread.c -- db_VISTA current record read module.
36 (C) Copyright 1987 by Raima Corporation.
37 -----------------------------------------------------------------------*/
39 /* ********************** EDIT HISTORY *******************************
41 SCR DATE INI DESCRIPTION
42 ----- --------- --- -----------------------------------------------------
43 103 27-Jun-88 RSC Improve generation of single user version
44 04-Aug-88 RTK MULTI_TASK changes
52 /* Read contents of current record
54 d_recread(rec TASK_PARM DBN_PARM)
55 char FAR *rec; /* ptr to record area */
59 INT rt; /* record type */
64 RECORD_ENTRY FAR *rec_ptr;
66 DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_IO));
68 if ( ! dbopen ) RETURN( dberr(S_DBOPEN) );
70 /* Make sure we have a current record */
72 RETURN( dberr(S_NOCR) );
74 /* set up to allow unlocked read access */
80 /* read current record */
81 dio_read( curr_rec, (char FAR * FAR *)&crloc, NOPGHOLD);
85 if ( db_status != S_OKAY )
88 /* copy record type from record */
89 bytecpy(&rt, crloc, sizeof(INT));
91 RETURN( db_status = S_DELETED );
95 rt &= ~RLBMASK; /* mask off rlb */
96 rlb_status = S_LOCKED;
99 rlb_status = S_UNLOCKED;
102 rec_ptr = &record_table[NUM2INT(rt, rt_offset)];
104 /* Copy db_addr from record and check with curr_rec */
105 bytecpy(&dba, crloc+sizeof(INT), DB_ADDR_SIZE);
106 if ( ADDRcmp(&dba, &curr_rec) != 0 )
107 RETURN( dberr(S_INVADDR) );
109 /* Copy data from crloc into rec */
110 bytecpy(rec, &crloc[rec_ptr->rt_data], rec_ptr->rt_len - rec_ptr->rt_data);
112 RETURN( db_status = S_OKAY );
114 /* vpp -nOS2 -dUNIX -nBSD -nVANILLA_BSD -nVMS -nMEMLOCK -nWINDOWS -nFAR_ALLOC -f/usr/users/master/config/nonwin recread.c */