1 /* $XConsortium: recread.c /main/2 1996/05/09 04:15:18 drk $ */
3 * COMPONENT_NAME: austext
9 * OBJECT CODE ONLY SOURCE MATERIALS
11 /*-----------------------------------------------------------------------
12 recread.c -- db_VISTA current record read module.
14 (C) Copyright 1987 by Raima Corporation.
15 -----------------------------------------------------------------------*/
17 /* ********************** EDIT HISTORY *******************************
19 SCR DATE INI DESCRIPTION
20 ----- --------- --- -----------------------------------------------------
21 103 27-Jun-88 RSC Improve generation of single user version
22 04-Aug-88 RTK MULTI_TASK changes
30 /* Read contents of current record
32 d_recread(rec TASK_PARM DBN_PARM)
33 char FAR *rec; /* ptr to record area */
37 INT rt; /* record type */
42 RECORD_ENTRY FAR *rec_ptr;
44 DB_ENTER(DB_ID TASK_ID LOCK_SET(RECORD_IO));
46 if ( ! dbopen ) RETURN( dberr(S_DBOPEN) );
48 /* Make sure we have a current record */
50 RETURN( dberr(S_NOCR) );
52 /* set up to allow unlocked read access */
58 /* read current record */
59 dio_read( curr_rec, (char FAR * FAR *)&crloc, NOPGHOLD);
63 if ( db_status != S_OKAY )
66 /* copy record type from record */
67 bytecpy(&rt, crloc, sizeof(INT));
69 RETURN( db_status = S_DELETED );
73 rt &= ~RLBMASK; /* mask off rlb */
74 rlb_status = S_LOCKED;
77 rlb_status = S_UNLOCKED;
80 rec_ptr = &record_table[NUM2INT(rt, rt_offset)];
82 /* Copy db_addr from record and check with curr_rec */
83 bytecpy(&dba, crloc+sizeof(INT), DB_ADDR_SIZE);
84 if ( ADDRcmp(&dba, &curr_rec) != 0 )
85 RETURN( dberr(S_INVADDR) );
87 /* Copy data from crloc into rec */
88 bytecpy(rec, &crloc[rec_ptr->rt_data], rec_ptr->rt_len - rec_ptr->rt_data);
90 RETURN( db_status = S_OKAY );
92 /* vpp -nOS2 -dUNIX -nBSD -nVANILLA_BSD -nVMS -nMEMLOCK -nWINDOWS -nFAR_ALLOC -f/usr/users/master/config/nonwin recread.c */