|
|
DataMuseum.dkPresents historical artifacts from the history of: CP/M |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about CP/M Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 62208 (0xf300)
Types: TextFile
Names: »READ.ME«
└─⟦57f0389e8⟧ Bits:30005761 SW1611 Access Manager v. 1.0
└─⟦this⟧ »READ.ME«
:
:
:
:
:
:
======================================== :
ø ø :
ø ACCESS MANAGER ø :
ø ø :
ø Version 1.1 ø :
ø ø :
ø READ.ME File Notes ø :
ø ø :
ø June 1983 ø :
ø ø :
ø ø :
ø Digital Research ø :
ø Pacific Grove, California : :
:______________________________________: :
:
:
:
:
:
Information and changes documented in this file :
supercede existing documentation. :
:
:
:
:
:
:
:
:
:
.---------------------------------------------------. :
ø The notes in this file are organized so that when ø :
ø printed on paper that is 11-inches long at six ø :
ø lines per inch, they can be trimmed on the indi- ø :
ø cates lines and placed in your product documenta- ø :
ø tion binder. ø :
ø___________________________________________________ø :
:
:
:
:
:
------------------------------------------------------------------
READ.ME File Notes :
:
:
TABLE OF CONTENTS :
================================================== :
:
CONCURRENT CP/M-86 IMPLEMENTATION . . . . . . . 1 :
Reserving Access Manager Queue Space . . . . 2 :
Invoking Shared Routines . . . . . . . . . . 3 :
Cancelling Shared Code . . . . . . . . . . . 4 :
Data and Index Files . . . . . . . . . . . . 4 :
ADDITIONAL COMPONENTS . . . . . . . . . . . . . 5 :
NOTE REGARDING MULTITASKING ENVIRONMENTS . . . 6 :
DIGITAL RESEARCH C APPLICATIONS . . . . . . . . 6 :
Linking Digital Research C Programs . . . . . 6 :
Access Manager Parameters . . . . . . . . . . 8 :
Coding Numeric Key Values . . . . . . . . . . 10 :
RECREATE.C Utility Program . . . . . . . . . 11 :
DATABASE Sample Program . . . . . . . . . . . 13 :
Data File Example . . . . . . . . . . . . . . 14 :
CHANGES TO PL/I-86 DATABASE SOURCE CODE . . . . 14 :
CHANGES TO PASCAL/MT+86 DATABASE SOURCE CODE . 15 :
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
Access Manager Page i :
:
------------------------------------------------------------------
READ.ME File Notes :
:
:
:
CONCURRENT CP/M-86 IMPLEMENTATION :
=================================================== :
:
Concurrent CP/M-86 is like CP/M-86 in that it sup- :
ports a single-user environment: it is like MP/M-86 :
in that it allows simultaneous processing of multiple :
tasks. Under Concurrent CP/M-86, your computer can :
perform several separate tasks (e.g., application :
programs) at the same time. And while each task :
operates independently, you can control each one :
through the same console device. :
:
Concurrent CP/M-86 uses a concept of virtual consoles :
to permit multiple tasks to run concurrently. The :
operating system can accommodate several :
separate virtual consoles. Every virtual console is :
assigned to the same physical console (normally your :
computer terminal). Each application running on :
your computer is assigned to a different virtual :
console. Thus, by switching from one virtual :
console to another, you can effectively move about :
freely from one task to another. :
:
For example, suppose you have a word processing :
program assigned to virtual console number one, a :
data base update program assigned to virtual console :
number two, and a printing program to console three. :
To use the word processing program you simply tell :
Concurrent CP/M-86 you want to use virtual console :
number one. The other two application programs :
continue to run even while you are attached to the :
first console. To check on the progress of or work :
with one of the other two programs, all you need do :
is enter the number of the assigned console. :
:
The concurrent execution of programs on the same :
computer is known as multitasking. Both Concurrent :
CP/M-86 and MP/M-86 provide multitasking ability. :
Consequently, using Access Manager under Concurrent :
CP/M-86 is practically identical to using it under :
MP/M-86. :
:
Access Manager Page 1 :
:
------------------------------------------------------------------
READ.ME File Notes :
:
:
Correct implementation of Access Manager under :
Concurrent CP/M-86 requires proper use of AM86.CMD, :
which contains the shared index file, data file, :
and buffer area. AM86.CMD automatically creates :
the queue structures necessary for its proper use. :
:
Reserving Access Manager Queue Space :
--------------------------------------------------- :
The queues created by AM86.CMD coordinate the multi- :
task, keyed file accessing requests. Table 1-3 in :
your Access Manager Programmer's Guide shows the :
queue space memory requirements. :
:
Ordinarily, Concurrent CP/M-86 is pre-configured :
with sufficient queue space to support multiuser :
applications. The Concurrent CP/M-86 utility pro- :
gram SYSTAT.CMD can be used to determine the :
available queue capacity. If there is insufficient :
space (based on the specifications in Table 1-3 in :
your Access Manager Programmer's Guide) you may be :
able to change the configuration of your operating :
system using the GENCCPM.CMD utility program. If :
you do not have this utility program, follow the :
procedure described in section 1.4.1 of your Access :
Manager Programmer's Guide to increase the available :
queue space capacity. :
:
After you complete the GENCCPM procedure, a new :
Concurrent CP/M-86 operating system is written to :
a disk file. The next time you boot the operating :
system, the new version of Concurrent CP/M-86 resides :
on disk. :
:
:
:
:
:
:
:
:
:
:
:
Access Manager Page 2 :
:
------------------------------------------------------------------
READ.ME File Notes :
:
:
Invoking Shared Routines under Concurrent CP/M-86 :
--------------------------------------------------- :
AM86.CMD contains the shared Access Manager code :
designed to run in its own memory segment under :
Concurrent CP/M-86. As distributed, it requires :
less than 34K bytes of memory, supports up to forty :
index files and forty data files, and uses twenty :
buffers with a node size of 512 bytes (NNSEC%=4). :
Instructions for changing this configuration are :
found under "Creating Custom Background Servers" :
in section 1.4.4 of your Programmer's Guide. :
:
To start AM86.CMD under Concurrent CP/M-86, type :
the following at your operating system prompt: :
:
AM86 :
:
If Access Manager starts successfully, the follow- :
ing banner appears on your screen: :
:
--------------------------------------------------- :
ACCESS MANAGER(tm) 8086 Version 1.1 :
Serial No. AM-9999-000000 All Rights Reserved :
Copyright (c) 1982,1983 Digital Research, Inc. :
--------------------------------------------------- :
:
Access Manager then detaches from the console and :
AM86.CMD is waiting in the background to service :
multitasked application programs. :
:
If Access Manager encounters a problem at start-up, :
one of the following messages appears on the console: :
:
"Access Manager could not open queues. Call Digital :
Research." :
:
"Access Manager Background Server (AM86.CMD) has :
illegal SETUP parameters. Check AM86MBUF.A86 for :
proper setup." :
:
"Access Manager could not open lock file. Are the :
disk and/or directory full?" :
:
Access Manager Page 3 :
:
------------------------------------------------------------------
READ.ME File Notes :
:
:
"Access Manager could not initialize lock file. :
Call Digital Research." :
:
"Error while making Access Manager queues. Either :
queues already exist (is Access Manager already :
running?); or there is insufficient space for :
queue control blocks and/or queue buffers :
(GENSYS required)." :
:
:
Cancelling the Shared Code under Concurrent CP/M-86 :
---------------------------------------------------- :
To close all open index and data files, delete the :
Access Manager queues, and free the memory segment :
occupied by AM86.CMD, type the command :
:
STOPAM86 :
:
If successful, the following message appears on the :
console: :
:
Access Manager (tm) Terminated :
:
If AM86.CMD is not running when you attempt to start :
STOPAM86, this message appears on the console: :
:
"Be sure that Access Manager is operational. Run :
SYSTAT to see." :
:
:
Data and Index Files under Concurrent CP/M-86 :
---------------------------------------------------- :
When Access Manager runs in the multitasking environ- :
ment, index and data files are opened in the locked :
mode. This places total control of these files :
under AM86.CMD. Further, the files are in the :
directory of the Concurrent CP/M-86 virtual console :
area from which AM86 is started. In most environ- :
ments, AM86.CMD is started from virtual console :
number zero or one. :
:
:
:
Access Manager Page 4 :
:
------------------------------------------------------------------
READ.ME File Notes :
:
:
ADDITIONAL COMPONENTS :
=================================================== :
:
The following components should be on your Access :
Manager distribution disks in addition to those :
listed in Section 1 of your Programmer's Guide. :
:
AM86DRCS.L86 A complete, binary-relocatable, :
indexed library of index and data :
file functions for Digital Research :
C application programs using the :
SMALL memory model. :
:
AM86DRCC.L86 Same as AM86DRCS.L86 except for use :
with COMPACT memory models. :
:
AM86DRCM.L86 Same as AM86DRCS.L86 except for use :
with MEDIUM memory models. :
:
AM86DRCB.L86 Same as AM86DRCS.L86 except for use :
with BIG memory models. :
:
AM86DRC.H Header file containing definition of :
special string structure for use in :
Digital Research C application :
programs. :
:
AMQ6DRCS.L86 Relocatable interface module to :
coordinate compiled Digital Research :
C application programs using the :
SMALL memory model and the shared :
Access Manager routines (AM86.CMD). :
:
AMQ6DRCC.L86 Same as AMQ6DRCS.L86 except for use :
with COMPACT memory models. :
:
AMQ6DRCM.L86 Same as AMQ6DRCS.L86 except for use :
with MEDIUM memory models :
:
AMQ6DRCB.L86 Same as AMQ6DRCS.L86 except for use :
with BIG memory models. :
:
:
Access Manager Page 5 :
:
------------------------------------------------------------------
READ.ME File Notes :
:
:
NOTE REGARDING MULTITASKING ENVIRONMENTS :
================================================== :
:
If AM86.CMD is aborted while being started in a :
multitasking environment, some of the queues that :
are created may not be deleted. If you attempt to :
start AM86.CMD again, the residual queues from the :
first attempt will confuse the second. :
:
:
:
:
:
:
DIGITAL RESEARCH C APPLICATIONS :
================================================== :
:
This section discusses a Digital Research C appli- :
cation program that you write and compile to pro- :
duce a binary object file named MYPROG.OBJ. :
:
Linking Single-user Digital Research C Applications :
--------------------------------------------------- :
You must link your compiled application program to :
the appropriate Access Manager subroutine library :
and the single-user buffer module. You can use the :
following command line to create an executable :
version of MYPROG: :
:
LINK86 MYPROG,AM86DRCx.L86,AM86BUF :
:
where x = S, C, M, or B. The appropriate choice :
for x is based on the memory model used when :
MYPROG was compiled, per the following: :
:
Memory Model Used x = :
_______________________________ :
SMALL S :
COMPACT C :
MEDIUM M :
BIG B :
:
:
Access Manager Page 6 :
:
------------------------------------------------------------------
READ.ME File Notes :
:
:
NOTE: if you link an application program compiled :
under one memory model with an Access Manager :
library designed for a different model, link-time :
errors are not reported but serious and unpredict- :
able run-time errors are bound to occur. :
:
AM86BUF contains the single-user buffer area :
beginning with entry point AM8FCB and ending with :
AM8END. :
:
Before linking, make sure that AM86BUF.OBJ is :
large enough to contain your buffers as specified :
in the SETUP function. You can use SETAMBUF.CMD :
to create a correctly sized buffer module. :
:
:
Linking Multiuser C Applications :
--------------------------------------------------- :
If your single-user version of MYPROG is coded with :
appropriate data locking procedures, you do not have :
to recompile it to create a multiuser version. You :
only need to relink the program. :
:
You must link your compiled application program to :
the appropriate Access Manager multiuser interface. :
The interface makes the queue calls to the shared :
code in the background server. The background :
server resides in its own memory segment. :
:
To create a CMD file that calls the Access Manager :
background server, use LINK86.CMD as follows: :
:
LINK86 MYPROG,AMQ6DRCx.L86 :
:
where x = S, C, M, or B, as explained earlier in :
this section. :
:
:
:
:
:
:
:
Access Manager Page 7 :
:
------------------------------------------------------------------
READ.ME File Notes :
:
:
Access Manager Parameters :
--------------------------------------------------- :
There are two types of parameters you can use with :
Access Manager: two-byte integers and strings. Two- :
byte integers can be either int (WORD) or unsigned :
int (UWORD) variables. Strings are usually repre- :
sented by character arrays ending in null ('Ø0'). :
Because Access Manager expects the first byte of a :
string to specify its length and does not interpret :
a null as a string delimiter, you must use a more :
generalized data structure. :
:
The header file AM86DRC.H, supplied on your distri- :
bution disks, contains the following data structure :
definition: :
:
struct am86strg æ :
BYTE len; :
BYTE strÆMAX_KEY_LEN+1Å; :
å ; :
:
This structure assumes your application program :
specifies the compile-time constant MAX_KEY_LEN :
in a #define macro. For example, the following :
code sequence specifies the maximum key length :
(which can range from one to 48) and sets up the :
extended string definition required by Access :
Manager: :
:
#define MAX_KEY_LEN 48 :
#include <am86drc.h> :
:
With these two statements in your program code, :
you can define extended strings and/or their :
pointers as follows: :
:
struct am86strg keyval,*ptrkey; :
:
You must pass all string parameters (file names :
and key values) to Access Manager using a pointer :
to an am86strg structure or its equivalent. :
:
:
Access Manager Page 8 :
:
------------------------------------------------------------------
READ.ME File Notes :
:
:
NOTE: make certain the length byte of the am86strg :
structure is valid before passing a string parameter :
to Access Manager. :
:
Following are two examples of ways to set the length :
byte correctly, assuming the key value ends with a :
null byte. The first example shows how to place a :
constant value into an extended string structure :
and set its length byte: :
:
struct am86strg keyval,filname; :
:
The second example demonstrates how to place a value :
into the character array and then set its length :
byte: :
:
:
filname.len=strlen(strcpy(filname.str,"TEST.IDX")); :
scanf("%10s",keyval.str); :
keyval.len = strlen(keyval.str); :
:
:
NOTE: you can only use the "strlen" library function :
if the string ends with a null character; otherwise, :
you must use some other approach to set the length :
byte. :
:
With the preceding example in mind, here are two :
examples of passing extended strings to Access :
Manager: :
:
WORD file_no,drn; :
:
file_no = OPNIDX(-1,&filname,22,0,1); :
:
drn = GETKEY(file_no,0,0,&keyval); :
:
Notice how the & operator is used to pass a pointer :
to the extended string structure. :
:
:
:
:
Access Manager Page 9 :
:
------------------------------------------------------------------
READ.ME File Notes :
:
:
When you pass pointers to extended string structures :
(am86strg) to your own routines, you can declare the :
pointers as BYTE-type. This way, you can increment :
or decrement the pointers to move up or down the :
structure. If you declare them as pointers to :
am86strg structures, incrementing the pointer causes :
the size of the am86strg structure to be added to :
the pointer, instead of simply adding one. :
:
In addition to the definition of am86strg, AM86DRC.H :
contains the following compile-time constant defini- :
tions: :
:
:
#define N_LOCK 0 /* NO LOCK/UNLOCK REQUEST */ :
#define S_LOCK 1 /* SHARED RECORD LOCK/UNLOCK */ :
#define X_LOCK 2 /* EXCLUSIVE RECORD LOCK/UNLOCK */ :
#define S_FILE 3 /* SHARED FILE LOCK/UNLOCK */ :
#define X_FILE 4 /* EXCLUSIVE FILE LOCK/UNLOCK */ :
#define R_LOCK 5 /* SHARED/EXCLUSIVE RECORD UNLOCK */ :
#define A_FILE 6 /* UNLOCK ALL LOCKS ON A FILE */ :
/* FOR CALLING USER */ :
#define A_USER 7 /* UNLOCK ALL LOCKS ON ALL FILES */ :
/* FOR CALLING USER */ :
:
:
Coding Numeric Key Values :
--------------------------------------------------- :
There is a general discussion of coding numeric key :
values with the ADDKEY function description in :
Section 3 of your Reference Manual. :
:
In C, the most straightforward approach to represent :
numeric key values is to use long, four-byte integers. :
Four-byte integers accommodate key values ranging :
from -2147483648 to 2147483647. Because long inte- :
gers are stored with the least significant byte :
first and the sign bit set in the last byte, the :
key type parameter KEYTYP% should be one. :
:
:
:
:
Access Manager Page 10 :
:
------------------------------------------------------------------
READ.ME File Notes :
:
:
Even when key values are numeric, they must be repre- :
sented as extended strings (see "Access Manager Para- :
meters" earlier in this section). You can use the :
following declarations and assignments with long :
integer key values (the length of the keys used here :
is four bytes): :
:
#define MAX_KEY_LEN 48 :
#include <am86drc.h> :
:
struct am86strg keyval,idxval; :
long *linp,*lout; :
:
linp = keyval.str; /* overlay long integer */ :
/* on string */ :
keyval.len = 4; /* set key length */ :
lout = idxval.str; :
idxval.len = 4; :
:
:
When using a numeric quantity with an Access Manager :
function, use &keyval for input values and %idxval :
for output values. To manipulate the key as a :
numeric quantity, use *linp and *lout for input and :
output values, respectively. For example, :
:
*linp = 123456789; /* length bytes set above */ :
drn = SERKEY(key_no,dfile,dlock,&keyval,&idxval); :
if (drn øø DATVAL()) :
printf("ØnSERKEY output value = %d",*lout); :
else :
printf("ØnNo value found."); :
:
:
RECREATE.C Utility Program :
--------------------------------------------------- :
A detailed description of the RECREATE program is :
provided in Section 5 of your Reference Manual. :
Details about the Digital Research C version of the :
program are provided here. :
:
:
:
Access Manager Page 11 :
:
------------------------------------------------------------------
READ.ME File Notes :
:
:
RECREAT1.C, RECREAT2.C, and RECREATE.H contain the :
source code for the C version of the program. You :
can modify the code to fit your particular needs. :
To create RECREATE.CMD, use DRC.CMD to compile the :
two code modules and then link as follows: :
:
LINK86 RECREATE=RECREAT1,RECREAT2,AM86DRCS.L86ÆSÅ,AM86BUF :
:
The buffer area for RECREATE is 4,844 bytes based :
on the following SETUP function parameter values :
(note that only one data file and one index file are :
open at the same time): :
:
NNSEC% = 4 NBUFS% = 8 :
NDATF% = 1 NKEYS% = 1 :
:
You can use SETAMBUF.CMD to configure AM86BUF.OBJ. :
:
The following table shows the layout and content of :
records in a Recreate Parameter File. You can use :
this particular example file to reconstruct the files :
in the DATABASE sample program described later. :
:
TABLE: Example C Recreate Parameter File :
--------------------------------------------- :
Record Type Contents :
--------------------------------------------- :
Header 1 4 :
Data File CUSTOMER.DAT 100 3 0 :
Index File NAME.IDX 10 0 1 1 Y :
Key Part 22 8 :
Index File NUMB.IDX 4 0 0 1 N :
Key Part 2 4 :
Index File ZIPC.IDX 11 0 1 1 Y :
Key Part 84 9 :
:
:
If you want to change the capacities and, hence, :
memory requirements of the RECREATE program, you :
need to be concerned with the following key :
constants in the program: :
:
:
Access Manager Page 12 :
:
------------------------------------------------------------------
READ.ME File Notes :
:
:
MAX_KEYS specifies the maximum number of index :
files associated with a data file. MAX_PARTS :
indicates the maximum number of fields compris- :
ing a key value. :
:
MAX_SORT is the maximum number of key values the :
RECREATE program can leave in buffers before they :
are sorted and added to the index file being :
created. :
:
MAX_SPACE specifies the actual number of bytes :
available for buffering key values. Each key :
requires one more byte than its actual length. :
:
The actual number of key values that are buffered :
depends on length of the keys. MAX_SORT is the :
limiting factor for short keys and MAX_SPACE for :
long keys. :
:
You should increase the constant MAX_REC_LEN if :
your data files contain records exceeding 1024 :
bytes. :
:
:
DATABASE.C Sample Program :
--------------------------------------------------- :
Your Access Manager distribution disks contain a :
sample program coded in Digital Research C for :
creating and maintaining a database. You can make :
any changes you want to the source code; which is :
on your disks in these three files: :
:
DATABAS1.C :
DATABAS2.C :
DATABASE.H :
:
The DATABASE sample program demonstrates how to :
integrate Access Manager with Digital Research C :
applications. You can use this program to build, :
examine, update, and list a database containing :
name and address information. :
:
:
Access Manager Page 13 :
:
------------------------------------------------------------------
READ.ME File Notes :
:
:
ÆSINGLEÅ To create DATABASE.CMD, compile :
DATABAS1.C and DATABAS2.C with DRC.CMD and link :
as follows: :
:
LINK86 DATABASE=DATABAS1,DATABAS2, :
AM86DRCS.L86ÆSÅ,AM86BUF :
:
ÆMULTIÅ In a multiuser environment, enter the :
link statement as follows: :
:
LINK86 DATABASE=DATABAS1,DATABAS2,AMQ6DRCS.L86 :
:
:
Data File Example :
--------------------------------------------------- :
At the end of this READ.ME file is a listing :
illustrating several Access Manager functions used :
to update records in a data file. :
:
:
CHANGES TO PL/I-86 DATABASE SOURCE CODE :
=================================================== :
Note the following changes which should be made to :
the DATABASE source code: :
:
---------Page 3-22-----------------------------------------------:
FORMAT(X(28),5A); :
:
PUT FILE(LIST_FILE) EDIT(OLD_FLD(1),' ',OLD_FLD(2)) (col(29),5A);:
PUT FILE(LIST_FILE) SKIP EDIT(OLD_FLD(3)) (R(LFRMT)); :
PUT FILE(LIST_FILE) SKIP EDIT(OLD_FLD(4),', ',OLD_FLD(5), :
' ',OLD_FLD(6)) (R(LFRMT)); :
:
---------Page 3-29-----------------------------------------------:
GET EDIT (NEW_FLD(FLD))(A); :
:
---------Page 3-30-----------------------------------------------:
IF OP1 = 'S' ø OP1 = 's' THEN :
RETURN('SAVE'); :
:
:
:
:
Access Manager Page 14 :
:
------------------------------------------------------------------
READ.ME File Notes :
:
:
---------Page 3-32-----------------------------------------------:
GET EDIT (NEW_FLD(FIELD_NO))(A); :
:
:
CHANGES TO PASCAL/MT+86 DATABASE SOURCE CODE :
=================================================== :
Note the following changes which should be made to :
the DATABASE source code: :
:
---------Page 4-21-----------------------------------------------:
WRITELN(LIST_FILE,' ':4,OLD_FLDÆ0Å:10,' ',OLD_FLDÆ7Å); :
:
---------Page 4-30-----------------------------------------------:
IF (OP1 = 'C') OR (OP1 = 'c') THEN :
TMPDAT := SAVE; :
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
:
Access Manager Page 15 :
:
------------------------------------------------------------------
#include <stdio.h>
#define MAX_KEY_LEN 48
#include <am86drc.h>
#define YES 1
#define NO 0
main()
æ
/* ******************************************************************
Working Variables
****************************************************************** */
WORD progid,file_no;
struct am86strg filname;
struct æ
WORD lsw;
WORD msw;
å drn;
/* ******************************************************************
Data Buffer
****************************************************************** */
struct æ
BYTE part_noÆ4Å;
BYTE part_nameÆ20Å;
LONG part_quan;
å datbuf;
/* ******************************************************************
Initialize System
****************************************************************** */
progid = INTUSR(-1,YES,3); /* auto id; trap errors; 3 second time out */
if (ERRCOD())
err_handler(1);
if (SETUP(3,1,4,1)) /* 3 buffers; 1 key; 4 node sectors; 1 data file */
err_handler(2);
/* ******************************************************************
Open Files
****************************************************************** */
filname.len = strlen(strcpy(filname.str,"K:PART.DAT");
file_no = OPNDAT(-1,S_FILE,&filname,32); /* auto file #; share file lock
record length = 32 */
if (ERRCOD())
err_handler(3);
if (LOKCOD())
lok_conflict(3);
/* ******************************************************************
Set exclusive lock on data record 65686
****************************************************************** */
drn.msw = 1; /* Set high word to one which implies a base of 65536 */
drn.lsw = 150; /* 65686 = 65536 + 150 */
setdat(drn.msw);
if (SETLOK(file_no,X_LOCK,drn.lsw))
lok_conflict(4);
/* ******************************************************************
Read Data Record
****************************************************************** */
setdat(drn.msw);
if (READAT(file_no,drn.lsw,&datbuf))
err_handler(4);
/* ******************************************************************
Update Data Record
****************************************************************** */
part_quan = part_quan - 100L;
/* ******************************************************************
Write Data Record
****************************************************************** */
setdat(drn.msw);
if (WRTDAT(file_no,drn.lsw,&datbuf))
err_handler(5);
/* ******************************************************************
Release Record Lock
****************************************************************** */
setdat(drn.msw);
if (FRELOK(file_no,X_LOCK,drn.lsw))
lok_conflict(6);
/* ******************************************************************
Close Data File & Release File Lock
****************************************************************** */
if (CLSDAT(file_no))
err_handler(7);
if (FRELOK(file_no,S_FILE,0))
lok_conflict(7);
å
/* ******************************************************************
Exception Processing
****************************************************************** */
err_handler(locale)
WORD locale;
æ printf("ØnERROR #%d at LOCALE %d.",ERRCOD(),locale);
exit(1);
å
lok_conflict(locale)
WORD locale;
æ printf("ØnLOCK CONFLICT at LOCALE %d with code %d",locale, Ø
LOKCOD());
exit(1);
å
VVVVVVVVVVVVVVVVV
VVVVVVVVVVVVVVV
VVVVVVVVVVVVV
VVVVVVVVVVV
VVVVVVVVV
VVVVVVVVV
VVVVVVVVV
VVVVVVVVV
VVVVVVVVV
VVVVVVVVV
VVVVVVVVVVVVVVVVVVVVV
VVVVVVVVVVVVVVVVVVV
VVVVVVVVVVVVVVVVV
VVVVVVVVVVVVVVV
VVVVVVVVVVVVV
VVVVVVVVVVV
VVVVVVVVV
VVVVVVV
VVVVV
VVV
V
End of ACCESS MANAGER Read.Me File«eof»