1
/* Output from p2c 1.21alpha-07.Dec.93, the Pascal-to-C translator */
2
/* From input file "uptext.pas" */
29
typedef struct uptext_info {
30
short uptext, uptext_adjust, uptext_lcz;
31
Char uptext_font[256];
35
Static uptext_info U[maxvoices];
38
short uptextLineNo(voice)
41
return (U[voice-1].uptext);
45
Void setUptextLineNo(voice, lno)
48
U[voice-1].uptext = lno;
54
voice_index voice, FORLIM;
57
for (voice = 0; voice <= FORLIM - 1; voice++)
64
voice_index voice, FORLIM;
68
for (voice = 0; voice <= FORLIM - 1; voice++) {
70
WITH->uptext_adjust = 0;
72
*WITH->uptext_font = '\0';
77
Static Void textTranslate(uptext, font)
81
Char STR1[256], STR2[256], STR3[256], STR4[256];
87
k = pos1('%', uptext);
89
sprintf(STR4, "%s{\\mtxFlat}%s",
90
substr_(STR1, uptext, 1, k - 1),
91
substr_(STR3, uptext, k + 1, strlen(uptext) - k));
96
k = pos1('#', uptext);
98
sprintf(STR2, "%s{\\mtxSharp}%s",
99
substr_(STR1, uptext, 1, k - 1),
100
substr_(STR4, uptext, k + 1, strlen(uptext) - k));
101
strcpy(uptext, STR2);
107
if (!strcmp(uptext, "<"))
108
strcpy(uptext, "\\mtxIcresc");
109
else if (!strcmp(uptext, "<."))
110
strcpy(uptext, "\\mtxTcresc");
112
predelete(uptext, 1);
113
sprintf(uptext, "\\mtxCresc{%s}", strcpy(STR4, uptext));
118
if (!strcmp(uptext, ">"))
119
strcpy(uptext, "\\mtxIdecresc");
120
else if (!strcmp(uptext, ">."))
121
strcpy(uptext, "\\mtxTdecresc");
123
predelete(uptext, 1);
124
sprintf(uptext, "\\mtxDecresc{%s}", strcpy(STR1, uptext));
129
FORLIM = strlen(uptext);
130
for (k = 0; k <= FORLIM - 1; k++) {
131
if (pos1(uptext[k], "mpfzrs~") == 0)
136
strcpy(font, "\\mtxPF");
144
/* Local variables for addUptext: */
145
struct LOC_addUptext {
151
Local Void adjustUptext(LINK)
152
struct LOC_addUptext *LINK;
155
boolean force = false;
159
while (*LINK->w != '\0') {
160
/* p2c: uptext.pas: Note: Eliminated unused assignment statement [338] */
163
WITH1 = &U[LINK->voice-1];
167
if (WITH1->uptext_lcz > 1)
172
if (WITH1->uptext_lcz < 3)
177
WITH1->uptext_adjust = 0;
181
WITH1->uptext_adjust = under;
190
if (*LINK->w != '\0')
191
getNum(LINK->w, &LINK->adj);
195
LINK->adj = -LINK->adj;
197
WITH1->uptext_adjust = LINK->adj;
199
WITH1->uptext_adjust += LINK->adj;
204
error3(LINK->voice, "Unknown uptext adjustment");
208
strcpy(LINK->w, "!");
212
Void addUptext(voice_, no_uptext, pretex)
217
struct LOC_addUptext V;
219
static Char lcz[4] = "lcz";
221
Char STR1[256], STR2[256], STR3[256];
224
WITH = &U[V.voice-1];
225
if (WITH->uptext == 0)
230
GetNextWord(V.w, P[WITH->uptext - 1], blank, dummy);
231
sprintf(STR1, "%c", barsym);
232
if (!strcmp(V.w, STR1) || *V.w == '\0')
234
sprintf(STR1, "%c", tilde);
235
if (!strcmp(V.w, STR1) || *no_uptext)
238
strcpy(WITH->uptext_font, V.w);
239
WITH->uptext_font[0] = '\\';
243
} while (V.w[0] == '!'); /* ! is a kludge, will get me in trouble later */
244
strcpy(font, WITH->uptext_font);
245
textTranslate(V.w, font);
247
sprintf(V.w, "%s{%s}", font, strcpy(STR1, V.w));
248
switch (lcz[WITH->uptext_lcz - 1]) {
251
sprintf(V.w, "\\mtxLchar{%s}{%s}",
252
toString(STR1, default_ + WITH->uptext_adjust),
257
sprintf(V.w, "\\mtxCchar{%s}{%s}",
258
toString(STR1, default_ + WITH->uptext_adjust),
263
sprintf(V.w, "\\mtxZchar{%s}{%s}",
264
toString(STR1, default_ + WITH->uptext_adjust),