-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTim_notes.txt
More file actions
483 lines (318 loc) · 11.9 KB
/
Copy pathTim_notes.txt
File metadata and controls
483 lines (318 loc) · 11.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
Updated 03-29-2026 to fix TOC new page bug
To support TOC (Table of contents)
========================================================================================================================
File - gc.c
added
/******************************************************************************
Change Log
05-03-2024 - Added support for TOC (Table of contents) file - TRG
******************************************************************************/
#define toc_desc qual_tbl[QUAL_TOC] /* By TRG 20240503 to support TOC */
DEFTYP(def_toc,".toc") /* By TRG 20240503 to support TOC */
{qual_tbl+QUAL_TOC,def_toc}, /* /TOC=filename By TRG 20240503 to support TOC */
Changed
----------from
err_msg( MSG_FATAL, "Sorry, TEMP option is no longer supported\n" );
----------to
err_msg( MSG_FATAL, "Sorry, TEMP option is no longer supported, did you mean TOC\n" ); /* By TRG 20240503 to support TOC */
========================================================================================================================
File - gual_tbl.h
added
/******************************************************************************
Change Log
05-03-2024 - TRG - Added support for TOC (Table of contents) file
******************************************************************************/
QTBL(0, 1, 0, 1, 0, 1, QUAL_TOC, "TOC", OUT_FN_TOC), /* toc file description By TRG 20240503 to support TOC */
========================================================================================================================
File - token_def.h
added
/******************************************************************************
Change Log
05-03-2024 - TRG - Added support for TOC (Table of contents) file
******************************************************************************/
OUT_FN_TOC, /* By TRG 20240503 to support TOC */
========================================================================================================================
File - macxx.c
added
/******************************************************************************
Change Log
03-29-2026 - Bug Fix for TOC new page - TRG
05-03-2024 - Added support for TOC (Table of contents) file - TRG
******************************************************************************/
list_toc_line_no = 0; /* By TRG 20240503 to support TOC */
list_toc_page_no = 1; /* By TRG 20240503 to support TOC */
list_toc_new_page = 0; /* By TRG 20260329 to support TOC */
Changed
----------from
if (!(lis_fp = fopen(output_files[OUT_FN_LIS].fn_buff,"w")))
----------to
if (!(lis_fp = fopen(output_files[OUT_FN_LIS].fn_buff,"w+"))) /* By TRG 20240503 to support TOC */
added
if (output_files[OUT_FN_TOC].fn_present)
{ /* By TRG 20240503 to support TOC */
if (!(toc_fp = fopen(output_files[OUT_FN_TOC].fn_buff,"w")))
{
sprintf(emsg,"Error creating TOC file: %s\n",
output_files[OUT_FN_TOC].fn_buff);
perror(emsg);
EXIT_FALSE;
}
}
Changed
----------from
if (lis_fp) fclose(lis_fp);
----------to
if (toc_fp)
{ /* By TRG 20240503 to support TOC */
fprintf(toc_fp, "\n");
if (lis_fp)
{ /* If LIST file and TOC file - append LIST file to end of TOC file */
fflush(lis_fp); /* files have not been closed so write out rest of files */
fflush(toc_fp);
rewind(lis_fp); /* back to the beginning of list file */
while( fgets(list_stats.listBuffer, sizeof(list_stats.listBuffer), lis_fp) != NULL )
{ /* Can use listBuffer now that it's not needed any longer */
fputs(list_stats.listBuffer,toc_fp);
}
fclose(lis_fp);
fclose(toc_fp);
if (unlink(output_files[OUT_FN_LIS].fn_buff) < 0)
{ /* Delete current LIST file */
sprintf(inp_str,"Error deleting file: %s\n",output_files[OUT_FN_LIS].fn_buff);
perror(inp_str);
}
else
{ /* Rename appended TOC file and move to current location of LIST file */
rename(output_files[OUT_FN_TOC].fn_buff,output_files[OUT_FN_LIS].fn_buff);
}
}
else
{ /* No LIST file so keep TOC file */
fclose(toc_fp);
}
}
else if (lis_fp)
{ /* No TOC file so keep LIST file */
fclose(lis_fp);
}
========================================================================================================================
File - header.h
added
/******************************************************************************
Change Log
05-03-2024 - TRG - Added support for TOC (Table of contents) file
******************************************************************************/
#define toc_fp output_files[OUT_FN_TOC].fn_file /* By TRG 20240503 to support TOC */
Changed
----------from
extern void puts_titles(void);
----------to
extern void puts_titles(int plus_sign); /* TRG 20240503 to support TOC */
========================================================================================================================
File - psuedo_ops.c
added
05-03-2024 - Added support for TOC (Table of contents) file - TRG
changed int op_title(void)
int op_title(void)
{
int c, len = 0;
char *s = inp_ptr;
if ( lis_fp != 0 )
{
while ( len < LLIST_SIZE - 1 )
{
c = *s;
if ( (cttbl[c] & CT_EOL) == 1 )
break;
++s;
++len;
}
if ( !(c = lis_title[0]) )
c = '\f';
snprintf(lis_title, sizeof(lis_title), "%c%-40s %s %s %s",
c, " ", macxx_name, macxx_version, ascii_date);
if ( len > (int)sizeof(lis_title) - 3 )
len = sizeof(lis_title) - 3;
memcpy(lis_title + 1, inp_ptr, len);
}
f1_eatit();
return 0;
}
changed int op_sbttl(void)
added
if ( (options[QUAL_TOC] && options[QUAL_LIST] && list_toc) || (options[QUAL_TOC] && !options[QUAL_LIST]) )
{ /* By TRG 20240503 to support TOC */
if (pass !=0)
{
fprintf(toc_fp,"%5ld-%4ld%c",list_toc_page_no,list_toc_line_no,(include_level > 0) ? '+' : ' ');
fprintf(toc_fp, "%c%s",(include_level > 0) ? '\t' : ' ',inp_ptr);
}
}
changed int op_page(void)
int op_page(void)
{
show_line = 0; /* don't display .page */
lis_line = 0;
if ( options[QUAL_TOC] ) /* By TRG 20240503 to support TOC */
{
++list_toc_page_no;
list_toc_line_no = 0;
}
return 0;
}
changed int op_include(void)
added
if ( (options[QUAL_TOC] && options[QUAL_LIST] && list_toc) || (options[QUAL_TOC] && !options[QUAL_LIST]) )
{ /* By TRG 20240503 to support TOC */
if (pass !=0)
{
fprintf(toc_fp,"%5ld-%4ld \t",list_toc_page_no,list_toc_line_no); /* write page and line number */
fprintf(toc_fp, "%s",current_fnd->fn_name_only); /* write include filename */
fprintf(toc_fp, "\t%s",inp_ptr); /* write rest of .include line */
}
}
========================================================================================================================
File - listctrl.h
added
03-29-2026 - Bug Fix for TOC new page - TRG
05-03-2024 - Added support for TOC (Table of contents) file - TRG
extern unsigned long list_toc_page_no; /* page number of TOC listing - By TRG 20240503 */
extern unsigned long list_toc_line_no; /* line number of TOC listing - By TRG 20240503 */
extern int list_toc_hd; /* header flag for TOC listing - By TRG 20240503 */
extern int list_toc_new_page; /* new page flag for TOC listing - By TRG 20260329 */
========================================================================================================================
File - listctrl.c
added
03-29-2026 - Bug Fix for TOC new page - TRG
05-03-2024 - Added support for TOC (Table of contents) file - TRG
unsigned long list_toc_page_no = 1; /* page number of TOC listing - By TRG 20240503 */
unsigned long list_toc_line_no = 0; /* line number of TOC listing - By TRG 20240503 */
int list_toc_hd = 0; /* header flag for TOC listing - By TRG 20240503 */
int list_toc_new_page = 0; /* new page flag for TOC listing - By TRG 20260329 */
changed
-----------------------from
sprintf(outLinePtr + LLIST_SEQ, "%5ld%c",
lstat->line_no, (lstat->include_level > 0) ? '+' : ' ');
----------------------to
if ( options[QUAL_TOC] ) /* By TRG 20240503 to support TOC */
{
sprintf(outLinePtr + LLIST_SEQ, "%5ld%c",
list_toc_line_no, (lstat->include_level > 0) ? '+' : ' ');
}
else
{
sprintf(outLinePtr + LLIST_SEQ, "%5ld%c",
lstat->line_no, (lstat->include_level > 0) ? '+' : ' ');
}
---------------------
========================================================================================================================
File - pass1.c
added
/******************************************************************************
Change Log
03-29-2026 - Bug Fix for TOC new page - TRG
05-03-2024 - Added support for TOC (Table of contents) file - TRG
******************************************************************************/
removed
++current_fnd->fn_line; /* increment the source line # */
added
/* must be here incase end of file return - should not be incremented - By TRG 20240503 to support TOC */
++current_fnd->fn_line; /* increment the source line # */
++list_toc_line_no; /* increment the TOC source line number */
if(list_toc_line_no == 1) list_toc_new_page = 1; /* set TOC new page flag */
changed void puts_titles(void)
void puts_titles(int plus_sign)
{
fputs(lis_title,lis_fp); /* write title line */
if ( options[QUAL_TOC] ) /* By TRG 20240503 to support TOC */
{
if (!list_toc_hd) /* write TOC header only one time */
{
fputs(lis_title,toc_fp); /* write title header to TOC file */
fprintf(toc_fp,"\nTABLE OF CONTENTS\n\n");
list_toc_hd = 1;
}
fprintf(lis_fp," PAGE %ld%c\n",list_toc_page_no,(plus_sign > 0) ? '+' : ' '); /* Page number for listing file */
}
else
{
fprintf(lis_fp,"\n");
}
if (!lis_subtitle[0])
{
fputs("\n\n",lis_fp); /* no subtitle yet */
}
else
{
fputs(lis_subtitle,lis_fp); /* write subtitle line */
}
lis_line = LIS_LINES_PER_PAGE-3; /* reset the line counter */
*lis_title = '\f'; /* make first char a Form Feed */
}
changed void puts_lis(void)
void puts_lis(const char *string, int lines )
/*
* At entry:
* string - pointer to text to write to map file
* lines - number of lines in the text (0=don't know how many)
*/
{
int i;
const char *s;
if (lis_fp == 0)
return; /* easy out if no lis file */
if (!lis_title[0])
{
snprintf(lis_title,sizeof(lis_title),"\f%-40s %s %s %s",
output_files[OUT_FN_OBJ].fn_name_only,
macxx_name,macxx_version,ascii_date);
}
if ((i=lines) == 0)
{
if ((s = string) != 0 ) /* point to string */
{
while (*s)
{
if (*s++ == '\n')
i++; /* count \n's in text */
}
}
}
if ( options[QUAL_TOC] ) /* By TRG 20240503 to support TOC */
{
if (list_toc_new_page) /* New page number ? */
{
puts_titles(0); /* print without plus sign */
list_toc_new_page = 0; /* clear TOC new page flag */
}
else if (i == 0 || i > lis_line)
{ /* room on page? */
puts_titles(1); /* print with plus sign */
}
}
else
{
if (i == 0 || i > lis_line)
{ /* room on page? */
puts_titles(1); /* print with plus sign */
}
}
if (i != 0)
{
fputs(string,lis_fp); /* write caller's text */
lis_line -= i; /* take lines from total */
}
return; /* done */
}
========================================================================================================================
File - sortsym.c - note: this has nothing to do with the TOC update - just a bug fix - I found
added
/******************************************************************************
Change Log
05/09/2024 - Bug Fix - lis_subtitle for "Segment Summary" missing NewLine - TRG
******************************************************************************/
changed
-----from
strncpy(lis_subtitle,"Segment summary",sizeof(lis_subtitle));
-----to
strncpy(lis_subtitle,"Segment Summary\n",sizeof(lis_subtitle)); /* Bug Fix - Added newline TRG 20240503 */