annotate src/vmsmap.c @ 68:0b7f3b634cf2 r19-16-pre9

Import from CVS: tag r19-16-pre9
author cvs
date Mon, 13 Aug 2007 09:00:03 +0200
parents 376386a54a3c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* VMS mapping of data and alloc arena for XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1986, 1987 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 /* Synched up with: Not synched with FSF. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 /* Written by Mukesh Prasad. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 #ifdef VMS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 #include <config.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 #include "lisp.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 #include <rab.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 #include <fab.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 #include <rmsdef.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 #include <secdef.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 /* RMS block size */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 #define BLOCKSIZE 512
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 /* Maximum number of bytes to be written in one RMS write.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 * Must be a multiple of BLOCKSIZE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 #define MAXWRITE (BLOCKSIZE * 30)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 /* This funniness is to ensure that sdata occurs alphabetically BEFORE the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 $DATA psect and that edata occurs after ALL Emacs psects. This is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 because the VMS linker sorts all psects in a cluster alphabetically
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 during the linking, unless you use the cluster_psect command. Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 uses the cluster command to group all Emacs psects into one cluster;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 this keeps the dumped data separate from any loaded libraries. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 globaldef {"$D$ATA"} char sdata[512]; /* Start of saved data area */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 globaldef {"__DATA"} char edata[512]; /* End of saved data area */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 /* Structure to write into first block of map file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 struct map_data
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 char * sdata; /* Start of data area */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 char * edata; /* End of data area */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 int datablk; /* Block in file to map data area from/to */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 };
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 static void fill_fab (), fill_rab ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 static int write_data ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 extern char *start_of_data ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 extern int vms_out_initial; /* Defined in malloc.c */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 /* Maps in the data and alloc area from the map file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 mapin_data (name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 char * name;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 struct FAB fab;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 struct RAB rab;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 int status, size;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 int inadr[2];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 struct map_data map_data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 /* Open map file. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 fab = cc$rms_fab;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 fab.fab$b_fac = FAB$M_BIO|FAB$M_GET;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 fab.fab$l_fna = name;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 fab.fab$b_fns = strlen (name);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 status = sys$open (&fab);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 if (status != RMS$_NORMAL)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 printf ("Map file not available, running bare Emacs....\n");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 return 0; /* Map file not available */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 /* Connect the RAB block */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 rab = cc$rms_rab;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 rab.rab$l_fab = &fab;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 rab.rab$b_rac = RAB$C_SEQ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 rab.rab$l_rop = RAB$M_BIO;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 status = sys$connect (&rab);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 if (status != RMS$_NORMAL)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 lib$stop (status);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 /* Read the header data */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 rab.rab$l_ubf = &map_data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 rab.rab$w_usz = sizeof (map_data);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 rab.rab$l_bkt = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 status = sys$read (&rab);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 if (status != RMS$_NORMAL)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 lib$stop (status);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 status = sys$close (&fab);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 if (status != RMS$_NORMAL)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 lib$stop (status);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 if (map_data.sdata != start_of_data ())
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 printf ("Start of data area has moved: cannot map in data.\n");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 if (map_data.edata != edata)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 printf ("End of data area has moved: cannot map in data.\n");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 fab.fab$l_fop |= FAB$M_UFO;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 status = sys$open (&fab);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 if (status != RMS$_NORMAL)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 lib$stop (status);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 /* Map data area. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 inadr[0] = map_data.sdata;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 inadr[1] = map_data.edata;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 status = sys$crmpsc (inadr, 0, 0, SEC$M_CRF | SEC$M_WRT, 0, 0, 0,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 fab.fab$l_stv, 0, map_data.datablk, 0, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 if (! (status & 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 lib$stop (status);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 /* Writes the data and alloc area to the map file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 mapout_data (into)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 char * into;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 struct FAB fab;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 struct RAB rab;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 int status;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 struct map_data map_data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 int datasize, msize;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 if (vms_out_initial)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 error ("Out of initial allocation. Must rebuild emacs with more memory (VMS_ALLOCATION_SIZE).");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 map_data.sdata = start_of_data ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 map_data.edata = edata;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 datasize = map_data.edata - map_data.sdata + 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 map_data.datablk = 2 + (sizeof (map_data) + BLOCKSIZE - 1) / BLOCKSIZE;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 /* Create map file. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 fab = cc$rms_fab;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 fab.fab$b_fac = FAB$M_BIO|FAB$M_PUT;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 fab.fab$l_fna = into;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 fab.fab$b_fns = strlen (into);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 fab.fab$l_fop = FAB$M_CBT;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 fab.fab$b_org = FAB$C_SEQ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 fab.fab$b_rat = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 fab.fab$b_rfm = FAB$C_VAR;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 fab.fab$l_alq = 1 + map_data.datablk +
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 ((datasize + BLOCKSIZE - 1) / BLOCKSIZE);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 status = sys$create (&fab);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 if (status != RMS$_NORMAL)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 error ("Could not create map file");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 /* Connect the RAB block */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 rab = cc$rms_rab;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 rab.rab$l_fab = &fab;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 rab.rab$b_rac = RAB$C_SEQ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 rab.rab$l_rop = RAB$M_BIO;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 status = sys$connect (&rab);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 if (status != RMS$_NORMAL)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 error ("RMS connect to map file failed");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 /* Write the header */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 rab.rab$l_rbf = &map_data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 rab.rab$w_rsz = sizeof (map_data);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 status = sys$write (&rab);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 if (status != RMS$_NORMAL)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 error ("RMS write (header) to map file failed");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 if (! write_data (&rab, map_data.datablk, map_data.sdata, datasize))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 status = sys$close (&fab);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 if (status != RMS$_NORMAL)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 error ("RMS close on map file failed");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 return 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 static int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 write_data (rab, firstblock, data, length)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 struct RAB * rab;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 char * data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 int status;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 rab->rab$l_bkt = firstblock;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 while (length > 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 rab->rab$l_rbf = data;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 rab->rab$w_rsz = length > MAXWRITE ? MAXWRITE : length;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 status = sys$write (rab, 0, 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 if (status != RMS$_NORMAL)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 error ("RMS write to map file failed");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 return 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 data = &data[MAXWRITE];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 length -= MAXWRITE;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 rab->rab$l_bkt = 0;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 return 1;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 } /* write_data */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 #endif /* VMS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227