[0001]
[0002]
[0003]
[0004]
[0005]
[0006]
[0007]
[0008]
[0009]
[0010]
[0011]
[0012]
[0013]
[0014]
[0015]
[0016]
[0017]
[0018]
[0019]
[0020]
[0021]
[0022]
[0023]
[0024]
[0025]
[0026]
[0027]
[0028]
[0029]
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036]
[0037]
[0038]
[0039]
[0040]
[0041]
[0042]
[0043]
[0044]
[0045]
[0046]
[0047]
[0048]
[0049]
[0050]
[0051]
[0052]
[0053]
[0054]
[0055]
[0056]
[0057]
[0058]
[0059]
[0060]
[0061]
[0062]
[0063]
[0064]
[0065]
[0066]
[0067]
[0068]
[0069]
[0070]
[0071]
[0072]
[0073]
[0074]
[0075]
[0076]
[0077]
[0078]
[0079]
[0080]
[0081]
[0082]
[0083]
[0084]
[0085]
[0086]
[0087]
[0088]
[0089]
[0090]
[0091]
[0092]
[0093]
[0094]
[0095]
[0096]
[0097]
[0098]
[0099]
[0100]
[0101]
$!-----------------------------------------------------------------------------
$! STYLE_WASDOC.COM
$!
$! turn WASDOC.CSS into a C header file
$! (just too easy to text-process on [Open]VMS! :-)
$!
$! 25-MAR-2019  MGD  initial
$!-----------------------------------------------------------------------------
$!
$ h_file_name = "[]css.h"
$ css_file_name = "[.doc]wasdoc.css"
$ if f$search(h_file_name) .nes. "" then delete/nolog/noconfirm 'h_file_name';*
$!
$ on error then goto controlY
$ on controly then goto controlY
$!
$ if f$trnlnm("HFILE","LNM$PROCESS") .nes. "" then close hfile
$ if f$trnlnm("CSSFILE","LNM$PROCESS") .nes. "" then close cssfile
$ open /read cssfile 'css_file_name
$ open /write hfile 'h_file_name
$!
$ write hfile "/* generated from ''css_file_name' by HTML_STYLE.COM */"
$ write hfile "/* DO NOT EDIT this file - edit ''css_file_name' " + -
              "and @HTML_STYLE.COM */"
$ write hfile ""
$ write hfile "#ifndef STYLE_DEFAULT"
$ write hfile "#define STYLE_DEFAULT ""\"
$!
$ read_loop:
$    read /end=end_read_loop cssfile line
$    length = f$length(line)
$    if f$locate("\",line) .le. length
$    then
$!      (escape backslashes)
$       line2 = ""
$       escape_loop:
$          length = f$length(line)
$          pos = f$locate("\",line)
$          if pos .ge. length then goto end_escape_loop
$          line2 = line2 + f$extract(0,pos,line) + "\\"
$          line = f$extract(pos+1,999,line)
$          if line .nes. "" then goto escape_loop
$       end_escape_loop:
$       line = line2 + line
$       line2 = ""
$       length = f$length(line)
$    endif
$    if f$locate("""",line) .le. length
$    then
$!      (escape double quotes)
$       line2 = ""
$       escape_loop:
$          length = f$length(line)
$          pos = f$locate("""",line)
$          if pos .ge. length then goto end_escape_loop
$          line2 = line2 + f$extract(0,pos,line) + "\"""
$          line = f$extract(pos+1,999,line)
$          if line .nes. "" then goto escape_loop
$       end_escape_loop:
$       line = line2 + line
$       line2 = ""
$       length = f$length(line)
$    endif
$    if f$locate("'",line) .le. length
$    then
$!      (escape single quotes)
$       line2 = ""
$       escape_loop:
$          length = f$length(line)
$          pos = f$locate("'",line)
$          if pos .ge. length then goto end_escape_loop
$          line2 = line2 + f$extract(0,pos,line) + "\'"
$          line = f$extract(pos+1,999,line)
$          if line .nes. "" then goto escape_loop
$       end_escape_loop:
$       line = line2 + line
$       line2 = ""
$       length = f$length(line)
$    endif
$    write hfile line + "\n\"
$    goto read_loop
$ end_read_loop:
$!
$ write hfile """"
$ write hfile "#endif"
$ write hfile ""
$ write hfile "/* end */"
$!
$ close hfile
$ close cssfile
$!
$ purge /nolog 'h_file_name
$!
$ exit
$!
$ controlY:
$ if f$trnlnm("HFILE","LNM$PROCESS") .nes. "" then close hfile
$ if f$trnlnm("CSSFILE","LNM$PROCESS") .nes. "" then close cssfile
$ exit 44
$!
$!-----------------------------------------------------------------------------