
| Current Path : /proc/thread-self/root/usr/local/lib/python3.8/dist-packages/iftlib/abc/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : //proc/thread-self/root/usr/local/lib/python3.8/dist-packages/iftlib/abc/make_changes.py |
import sys
import re
text = open("syms.c").read()
open("syms_orig.c","w").write(text)
if not re.search(r"stichnote.*sHdd",text):
m = re.search(r"^(.*\/longa.*?\!.*?\n)(.*)$",text,flags=re.DOTALL)
text = m.group(1) + '''
/* added - stichnote shd */
"/shd { xymove\\n"
" 3 1.3 RM \\n"
" -1 2.5 -6.5 0 -5.5 -2.5 RC\\n"
" 1 -2.5 6.5 0 5.5 2.5 RC fill}!\\n"
/* added - stichnote sHd */
"\\n/sHd{\\n"
" xymove\\n"
" 3 1.3 RM\\n"
" -1 1.5 -5 -1.0 -4 -2.4 RC\\n"
" 1 -1.8 7 1.4 6 3.2 RC\\n"
" 0.5 0.3 RM\\n"
" 2 -3.8 -5 -7.6 -7 -3.8 RC\\n"
" -2 3.8 5 7.6 7 3.8 RC\\n"
" fill}!\\n"
/* added - stichnote sHD */
"\\n/sHD{\\n"
" xymove\\n"
" -1.2 1.8 RM\\n"
" 2.1 1.2 4.5 -2.4 2.4 -3.6 RC\\n"
" -2.1 -1.2 -4.5 2.4 -2.4 3.6 RC\\n"
" 5.4 -1.8 RM\\n"
" 0 1.4 -1.7 2.4 -4.2 2.4 RC\\n"
" -2.6 0 -4.2 -1.1 -4.2 -2.4 RC\\n"
" 0 -1.4 1.7 -2.4 4.2 -2.4 RC\\n"
" 2.6 0 4.2 1.1 4.2 2.4 RC\\n"
" fill}!\\n"
/* added - stichnote sHdd */
"\\n /sHdd{ % usage: x y opchnot\\n"
" xymove\\n"
" -2.5 -2.3 RM\\n"
" /Times-Roman 12 selectfont (o) show}!\\n"
''' + m.group(2)
open("syms.c","w").write(text)
text = open("draw.c").read()
if not re.search(r"sHdd",text):
open("draw_orig.c","w").write(text)
while (0 == 0):
m = re.search(r"^(.*)(p *\= \")(HD|Hd|hd)(\"\;)(.*)$",text,flags=re.DOTALL)
if not m:
break
text = ( m.group(1) + 'if (s->as.u.note.smal[m] == 0) { p = "' +
m.group(3) + '" ; } else { p = "s' + m.group(3) +
'" ; } ' + m.group(5) )
open("draw.c","w").write(re.sub(r"\"sHd\"","\"sHdd\"",text))
text = open("abcparse.c").read()
if not re.search(r"smal1",text):
open("abcparse_orig.c","w").write(text)
text = re.sub(r"(int *\*stemless)","int *small, \\1",text,100,flags=re.DOTALL)
text = re.sub(r"^(.*)(\n[^\n]*?while *\(\*p *== *\'\\\'\'.*?pit.*?\}.*?\{.*?pit.*?\})","\\1\\2\\2",text,flags=re.DOTALL)
text = re.sub(r"acc, *nostem(.*?\;)","acc, smal1, smal2, smal, nostem\\1",text)
text = re.sub(r"(s-\>u\.note\.accs\[m\] *\= *acc\;)","\\1 s->u.note.smal[m] = smal;",text)
text = re.sub(r"(\&acc, )","\\1 &smal, ",text,100)
text = re.sub(r"(pit *\+\= *)","smal1 = 1; \\1",text,100)
text = re.sub(r"(pit *\-\= *)","smal2 = 1; \\1",text,100)
text = re.sub(r"(\*stemless *\= *nostem;)","\\1 smal1 = smal1 * smal2; *small = smal1;",text,100)
open("abcparse.c","w").write(text)
text = open("abcparse.h").read()
if not re.search(r"short smal",text):
open("abcparse_orig.h","w").write(text)
text = re.sub(r"(struct *note .*?\{.*?)(\})","\\1 short smal[MAXHD];\n\\2",text,flags=re.DOTALL)
text = re.sub(r"(int *\*stemless)","int *small, \\1",text,100,flags=re.DOTALL)
open("abcparse.h","w").write(text)
text = open("abc2ps.h").read()
if not re.search(r"MAXSTAFF *16",text):
open("abc2ps_orig.h","w").write(text)
text = re.sub(r"(MAXSTAFF *) 16","\\1 80",text)
open("abc2ps.h","w").write(text)
text = open("parse.c").read()
if not re.search(r"MAXSTAFF *16",text):
open("parse_orig.c","w").write(text)
text = re.sub(r"(\&acc, )","\\1 &smal, ",text,100)
text = re.sub(r"acc, *nostem(.*?\;)","acc, smal1, smal2, smal, nostem\\1",text)
open("parse.c","w").write(text)