Skip to content

Commit

Permalink
Extended the <HTML> feature farther with <HTML "filename">,
Browse files Browse the repository at this point in the history
which allows the HTML insert to be read from a source file.  
This makes it easier to add the same notice to a bunch of 
source files and then to easily maintain it afterward.  
This has been illustrated by adding the sample file 
AgcHtmlNotice.txt and inserting it into Luminary131's 
GROUND_TRACKING_DETERMINATION_PROGRAM.s.
  • Loading branch information
info@sandroid.org committed Jun 30, 2009
1 parent 127c6f9 commit 7bf7a9e
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 2 deletions.
11 changes: 11 additions & 0 deletions AgcHtmlNotice.txt
@@ -0,0 +1,11 @@
<table style="margin-left: auto; margin-right: auto; width: 60%; text-align: left;" border="1" cellpadding="2" cellspacing="2">

<tbody>
<tr>
<td style="vertical-align: top;"><span style="font-weight: bold;"></span>This is a program for the Apollo Guidance Computer (AGC).&nbsp;
Documentation of AGC assembly language, the AGC register structure, and the AGC memory map can be found at the <a href="http://www.ibiblio.org/apollo/assembly_language_manual.html">Virtual AGC website</a>.<br>
</td>
</tr>
</tbody>
</table>

1 change: 1 addition & 0 deletions Luminary131/GROUND_TRACKING_DETERMINATION_PROGRAM.s
Expand Up @@ -13,6 +13,7 @@
# Mod history: 05/21/03 RSB. Began transcribing.
# 05/14/05 RSB Corrected website reference above.

<HTML "../AgcHtmlNotice.txt">
# Page 661
# GROUND TRACKING DETERMINATION PROGRAM -- P21
#
Expand Down
33 changes: 31 additions & 2 deletions yaYUL/SymbolTable.c
Expand Up @@ -48,6 +48,7 @@
to a dimmer bluish color.
06/30/09 RSB Added HtmlCheck for processing
"<HTML>...</HTML>" stuff in source files.
Includes <HTMLn> and <HTML=f>.
Concerning the concept of a symbol's namespace. I had originally
intended to implement this, and so many functions had a namespace
Expand Down Expand Up @@ -203,17 +204,45 @@ HtmlClose (void)
// turns the default HTML styling back on.
//
// Also accepts "<HTMLn>...</HTML>", where n is a decimal number from
// 1 to 100. In this case, it embeds the HTML within a centered table
// 1 to 99. In this case, it embeds the HTML within a centered table
// which is n% of the width of the display.
//
// Also accepts <HTML="filename"> (no closing tag needed), in which case
// html will be imported from the indicated file (at the yaYUL or yaLEMAP
// is run, not at browse-time) if the file exists. If the file does not
// exist, it is not treated as an error. The purpose of this feature is
// to allow a common notice to be added to a group of files, but to
// eliminate that notice easily by removing the file containing it.
int
HtmlCheck (int WriteOutput, FILE *InputFile, char *s, int sSize,
char *CurrentFilename, int *CurrentLineAll, int *CurrentLineInFile)
{
int Width;
char c = 0;
if (!strncmp (s, "<HTML \"", 7))
{
FILE *Include;
char *ss;
if (!WriteOutput || !Html || HtmlOut == NULL)
return (1);
for (ss = &s[7]; *ss && *ss != '\"'; ss++);
if (*ss != '\"')
return (1);
*ss = 0;
Include = fopen (&s[7], "r");
*ss = '\"';
if (Include == NULL)
return (1);
fprintf (HtmlOut, "%s", HTML_STYLE_END);
while (NULL != fgets (s, sSize - 1, Include))
fprintf (HtmlOut, "%s", s);
fprintf (HtmlOut, "%s", HTML_STYLE_START);
fclose (Include);
return (1);
}
if (!strncmp (s, "<HTML>", 6) ||
(2 == sscanf (s, "<HTML%d%c", &Width, &c) &&
Width > 0 && Width <= 100 && c == '>'))
Width > 0 && Width <= 99 && c == '>'))
{
char *ss;
// Turn off default HTML styling.
Expand Down

0 comments on commit 7bf7a9e

Please sign in to comment.