Mapper
dotepre.c
Go to the documentation of this file.
1 /*Translated by FOR_C, v3.4.2 (-), on 04/06/95 at 20:26:05 */
2 /*FOR_C Options SET: c=2 com=u do=r4 ftn=2ln6kk op=iv s=dvn str=l sq=i */
3 
4 #define _POSIX_SOURCE
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <ctype.h>
8 #include <dirent.h>
9 #include <unistd.h>
10 #include <math.h>
11 #include <string.h>
12 #include <fcntl.h>
13 #include <sys/stat.h>
14 #include "shef_structs_external.h"
15 
16 
18 {
19 
20  int i, k, j, ii, iii, notfound, nullit;
21  int l;
22  int DEBUG4;
23  short *const Ibuf = &buffer_.ibuf[0] -1 ;
24  memset(tempfiles_.temp1,0,sizeof(tempfiles_.temp1));
25  memset(tempfiles_.temp2,0,sizeof(tempfiles_.temp2));
26  DEBUG4 = 0;
27 
28  notfound = 1;
29 
30  ii = 0;
31 
32  if ( DEBUG4 )
33  {
34  for ( i=0; i< MAX_SHEF_INPUT; i++)
35  printf("%c", Ibuf[i+1]);
36 
37  }
38 
39  /* determine if first line or .E with not continuation */
40  if ( ( Ibuf[1] == codes_.idot ) &&
41  ( Ibuf[2] == codes_.iche ) &&
42  ( Ibuf[3] == codes_.iblnk )
43  )
44  {
45 
46  efound = 0;
47  econtinuation = 0;
48  find_dotend();
49  }
50  else
51  {
52 
53  if (
54  ( Ibuf[1] == codes_.idot ) &&
55  ( Ibuf[2] == codes_.iche ) &&
56  ( Ibuf[3] >= codes_.ich0 && Ibuf[3] <= codes_.ich9 )
57  )
58  {
59 
60  if ( !efound )
61  {
62 
63  efound_it();
64  remove_slash();
65  econtinuation = 1;
66  }
67  else
68  {
69 
70  find_dotbegin();
71  if ( !dotend && !dotbegin )
72  {
73  }
74  else
75  if ( dotend && !dotbegin )
76  {
77  }
78  else
79  if ( !dotend && dotbegin && econtinuation==0 )
80  {
81  /* remove leading slash */
82 
83  remove_slash();
84  econtinuation = 1;
85 
86  for ( i=0; i< MAX_SHEF_INPUT; i++)
87  printf("%c", Ibuf[i+1]);
88 
89  }
90 
91  find_dotend();
92  }
93  }
94 
95  }
96 
97  for ( i=0; i< MAX_SHEF_INPUT; i++)
98  tempfiles_.temp1[i] = Ibuf[i+1]; /* dgb:10/05/98 */
99  null_it();
100 
101 }
102 
104 {
105 int DEBUG1, i;
106  short *const Ibuf = &buffer_.ibuf[0] - 1;
107 
108  DEBUG1 = 0;
109  dotend = 0;
110 
111 
112 
113  i = MAX_SHEF_INPUT;
114 
115  while ( Ibuf[i] == ' ' )
116  i--;
117 
118 
119  if ( Ibuf[i] == '/' )
120  dotend = 1;
121 
122 }
123 
125 {
126 int i, notfound, ii,iii;
127  short *const Ibuf = &buffer_.ibuf[0] - 1;
128 
129 
130 
131 
132  /* check for beginning slash */
133  dotbegin = 0;
134  i = 4;
135  while( notfound )
136  {
137  if ( Ibuf[i] == codes_.iblnk )
138  {
139  }
140  else
141  if ( Ibuf[i] == codes_.islash )
142  {
143  dotbegin = 1;
144  /* Ibuf[i] = ' '; */
145  notfound = 0;
146  }
147  else
148  if ( Ibuf[i] == codes_.icolon )
149  {
150  i++;
151  iii = 0;
152  {
153  i++;
154  if ( iii > 5000 )
155  notfound = 0;
156  iii++;
157  }
158 
159  }
160  else
161  {
162  notfound = 0;
163  }
164  i++;
165  ii++;
166  if ( ii > 5000 )
167  {
168  notfound = 0;
169  }
170  }
171 
172 
173 }
174 
176 {
177 int i, notfound, ii,iii;
178  short *const Ibuf = &buffer_.ibuf[0] - 1;
179 
180 
181 
182 
183  /* check for first valid record */
184  i = 4;
185  while( notfound )
186  {
187  if ( Ibuf[i] == codes_.iblnk )
188  {
189  }
190  else
191  if ( Ibuf[i] == codes_.islash )
192  {
193  efound = 1;
194  notfound = 0;
195  }
196  else
197  if ( Ibuf[i] == codes_.icolon )
198  {
199  i++;
200  iii = 0;
201  while( Ibuf[i] != codes_.icolon )
202  {
203  i++;
204  if ( iii > 5000 )
205  notfound = 0;
206  iii++;
207  }
208 
209  }
210  else
211  {
212  efound = 1;
213  notfound = 0;
214  }
215  i++;
216  ii++;
217  if ( ii > 5000 )
218  {
219  notfound = 0;
220  }
221  }
222 }
223 
224 
225 
227 {
228 int i, notfound, ii, iii;
229  short *const Ibuf = &buffer_.ibuf[0] - 1;
230 
231 
232 
233  notfound = 1;
234  i = 4;
235  while( notfound )
236  {
237 
238  if ( Ibuf[i] == codes_.iblnk )
239  {
240  }
241  else
242  if ( Ibuf[i] == codes_.islash )
243  {
244  Ibuf[i] = ' ';
245  notfound = 0;
246  }
247  else
248  if ( Ibuf[i] == codes_.icolon )
249  {
250  i++;
251  iii = 0;
252  while( Ibuf[i] != codes_.icolon )
253  {
254  i++;
255  if ( iii > 5000 )
256  notfound = 0;
257  iii++;
258  }
259 
260  }
261  else
262  {
263  notfound = 0;
264  }
265  i++;
266  ii++;
267  if ( ii > 5000 )
268  {
269  notfound = 0;
270  }
271  }
272 
273 }
274 
276 {
277 
278 int i,k,kk,ii,nullit;
279  short *const Ibuf = &buffer_.ibuf[0] - 1;
280 
281 
282  i = 0;
283  k = 0;
284  ii = 0;
285  nullit = 0;
286 
287  kk = strlen(tempfiles_.temp1);
288 
289  while ( i < kk )
290  {
291  if ( tempfiles_.temp1[i] == ' ' )
292  {
293  tempfiles_.temp2[k] = ' ' ;
294  k++;
295  i++;
296  }
297  else
298  if ( tempfiles_.temp1[i] != '/' )
299  {
300 
302  nullit = 0;
303  k++;
304  i++;
305  }
306  else
307  if ( tempfiles_.temp1[i] == '/' && nullit == 0 )
308  {
310  k++;
311  i++;
312  nullit = 1;
313  }
314  else
315  if ( tempfiles_.temp1[i] == '/' && nullit == 1 )
316  {
317  tempfiles_.temp2[k] = 'N';
318  k++;
319  tempfiles_.temp2[k] = '/';
320  k++;
321  i++;
322  nullit = 1;
323  }
324  ii++;
325 
326  if ( ii > 5000 ) /* check for endless loop */
327  {
328  i = 10000;
329  }
330 
331  if ( i == kk)
332  i = 10000;
333  if ( k == kk )
334  i = 10000;
335 
336  }
337 
338  for ( i = 0; i < MAX_SHEF_INPUT; i++)
339  Ibuf[i+1] = tempfiles_.temp2[i];
340 
341 
342 }
static int i
null_it()
Definition: dotepre.c:275
pre_process_dote()
Definition: dotepre.c:17
remove_slash()
Definition: dotepre.c:226
find_dotend()
Definition: dotepre.c:103
efound_it()
Definition: dotepre.c:175
find_dotbegin()
Definition: dotepre.c:124
printf("fbuf is %s\n", fbuf)
int j
Definition: mapp2h.h:48
int k
Definition: mapp2h.h:48
#define MAX_SHEF_INPUT
Definition: shef.h:38
int dotbegin
Definition: shef_structs.h:247
int efound
Definition: shef_structs.h:247
int econtinuation
Definition: shef_structs.h:247
struct t_codes_ codes_
struct t_buffer_ buffer_
struct t_tempfiles_ tempfiles_
int dotend
Definition: shef_structs.h:247
short int ibuf[MAX_SHEF_INPUT]
Definition: shef_structs.h:109
short int iblnk
Definition: shef_structs.h:81
short int iche
Definition: shef_structs.h:78
short int ich0
Definition: shef_structs.h:80
short int islash
Definition: shef_structs.h:81
short int icolon
Definition: shef_structs.h:81
short int ich9
Definition: shef_structs.h:81
short int idot
Definition: shef_structs.h:82
char temp2[MAX_SHEF_INPUT]
Definition: shef_structs.h:223
char temp1[MAX_SHEF_INPUT]
Definition: shef_structs.h:223