w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

control.c
Go to the documentation of this file.
1 /* Output from p2c 1.21alpha-07.Dec.93, the Pascal-to-C translator */
2 /* From input file "control.pas" */
3 
4 
5 #include "p2c.h"
6 
7 
8 #define CONTROL_G
9 #include "control.h"
10 
11 
12 #ifndef UTILITY_H
13 #include "utility.h"
14 #endif
15 
16 
17 /* enables Include: directive */
18 /* one-word shortcut is treated by simply inserting a blank */
19 /* detached form of shortcut allowed */
20 /* C: lines are taken into account */
21 /* U: lines are taken into account */
22 /* L: lines are taken into account */
23 /* non-melismatic eighth and shorter notes in vocal lines are unbeamed */
24 /* blind slurs are hidden */
25 /* U: lines synchronize with words and rests */
26 /* always insert duration into notes */
27 /* include macros in the count */
28 /* literally expand macros */
29 /* keep track of pitch and warn if unreal */
30 /* transform note words to canical form */
31 /* use solfa note names */
32 /* issue warnings even when default action is likely to be correct */
33 /* ignore all errors except fatal errors */
34 /* set instrument names */
35 /* report what is being done */
36 /* write all possible infomative messages */
37 typedef enum {
44 
45 typedef struct Tfeature {
46  Char tag[31];
47  boolean active, changed;
49 
50 
51 #define firstFeature FmultiFile
52 #define lastFeature FdebugMode
53 
54 
56  { "", false, false },
57  { "multiFile", true, false },
58  { "splitShortcut", true, false },
59  { "newWordShortcut", true, false },
60  { "doChords", true, false },
61  { "doUptext", true, false },
62  { "doLyrics", true, false },
63  { "unbeamVocal", true, false },
64  { "hideBlindSlurs", true, false },
65  { "uptextOnRests", true, false },
66  { "insertDuration", true, false },
67  { "countMacro", false, false },
68  { "expandMacro", false, false },
69  { "checkPitch", true, false },
70  { "rearrangeNote", true, false },
71  { "solfaNoteNames", false, false },
72  { "pedanticWarnings", false, false },
73  { "ignoreErrors", false, false },
74  { "instrumentNames", false, false },
75  { "beVerbose", false, false },
76  { "debugMode", false, false }
77 };
78 
79 
80 void printFeatures(boolean anyway)
81 {
82  feature i;
83  Tfeature *WITH;
84 
85  for (i = firstFeature; i <= lastFeature; i = (feature)((long)i + 1)) {
86  WITH = &feat[(long)i];
87  if (WITH->changed || anyway)
88  printf("%s = %s\n", WITH->tag, WITH->active ? " TRUE" : "FALSE");
89  }
90 }
91 
92 
94 {
95  feature i;
96 
97  for (i = firstFeature; i <= lastFeature; i = (feature)((long)i + 1)) {
98  if (equalsIgnoreCase(s, feat[(long)i].tag))
99  return i;
100  }
101  return noSuchFeature;
102 }
103 
104 
105 boolean setFeature(Char *which, boolean val)
106 {
107  boolean Result = false;
108  feature f;
109  Tfeature *WITH;
110 
111  f = featureNamed(which);
112  if (f != noSuchFeature) {
113  WITH = &feat[(long)f];
114  WITH->active = val;
115  WITH->changed = true;
116  Result = true;
117  }
118  if (f == FdebugMode && val)
119  feat[(long)FbeVerbose].active = true;
120  if (f == FbeVerbose && !val)
121  feat[(long)FdebugMode].active = false;
122  return Result;
123 }
124 
125 
127 {
128  if (strcmp(level, "0.57") < 0) {
129  setFeature("splitShortcut", false);
130  setFeature("newWordShortcut", false);
131  }
132 }
133 
134 
135 /* Feature functions. To add a new feature "newFeature":
136  1. Insert a new value "FnewFeature" in the declaration of type "feature".
137  2. Insert an entry for it in array "feat".
138  3. Copy the template below and change "FEATURE" into "newFeature".
139  4. Copy the function header to the interface section.
140  5. (Optional) Insert code into "mtxLevel" to enable/disable the feature.
141 
142 function FEATURE: boolean;
143 begin FEATURE := feat[FFEATURE].active end;
144 */
145 
146 boolean checkPitch(void)
147 {
148  return (feat[(long)FcheckPitch].active);
149 }
150 
151 
152 boolean countMacro(void)
153 {
154  return (feat[(long)FcountMacro].active);
155 }
156 
157 
158 boolean expandMacro(void)
159 {
160  return (feat[(long)FexpandMacro].active);
161 }
162 
163 
164 boolean insertDuration(void)
165 {
166  return (feat[(long)FinsertDuration].active);
167 }
168 
169 
170 boolean rearrangeNote(void)
171 {
172  return (feat[(long)FrearrangeNote].active);
173 }
174 
175 
176 boolean beVerbose(void)
177 {
178  return (feat[(long)FbeVerbose].active);
179 }
180 
181 
182 boolean debugMode(void)
183 {
184  return (feat[(long)FdebugMode].active);
185 }
186 
187 
188 boolean instrumentNames(void)
189 {
190  return (feat[(long)FinstrumentNames].active);
191 }
192 
193 
194 boolean hideBlindSlurs(void)
195 {
196  return (feat[(long)FhideBlindSlurs].active);
197 }
198 
199 
200 boolean doLyrics(void)
201 {
202  return (feat[(long)FdoLyrics].active);
203 }
204 
205 
206 boolean ignoreErrors(void)
207 {
208  return (feat[(long)FignoreErrors].active);
209 }
210 
211 
212 boolean pedanticWarnings(void)
213 {
214  return (feat[(long)FpedanticWarnings].active);
215 }
216 
217 
218 boolean solfaNoteNames(void)
219 {
220  return (feat[(long)FsolfaNoteNames].active);
221 }
222 
223 
224 boolean uptextOnRests(void)
225 {
226  return (feat[(long)FuptextOnRests].active);
227 }
228 
229 
230 boolean unbeamVocal(void)
231 {
232  return (feat[(long)FunbeamVocal].active);
233 }
234 
235 
236 boolean doChords(void)
237 {
238  return (feat[(long)FdoChords].active);
239 }
240 
241 
242 boolean doUptext(void)
243 {
244  return (feat[(long)FdoUptext].active);
245 }
246 
247 
248 boolean newWordShortcut(void)
249 {
250  return (feat[(long)FnewWordShortcut].active);
251 }
252 
253 
254 boolean splitShortcut(void)
255 {
256  return (feat[(long)FsplitShortcut].active);
257 }
258 
259 
260 boolean multiFile(void)
261 {
262  return (feat[(long)FmultiFile].active);
263 }
264 
265 
266 
267 
268 
269 /* End. */
int level
Definition: afm2pl.c:1694
#define active
Definition: aptex-macros.h:325
#define Static
Definition: cfuncs.h:9
#define firstFeature
Definition: control.c:51
boolean setFeature(char *which, boolean val)
Definition: control.c:105
boolean ignoreErrors(void)
Definition: control.c:206
boolean debugMode(void)
Definition: control.c:182
#define lastFeature
Definition: control.c:52
boolean doLyrics(void)
Definition: control.c:200
boolean newWordShortcut(void)
Definition: control.c:248
boolean rearrangeNote(void)
Definition: control.c:170
boolean splitShortcut(void)
Definition: control.c:254
boolean doChords(void)
Definition: control.c:236
boolean checkPitch(void)
Definition: control.c:146
static feature featureNamed(char *s)
Definition: control.c:93
boolean doUptext(void)
Definition: control.c:242
feature
Definition: control.c:37
@ FcountMacro
Definition: control.c:40
@ FignoreErrors
Definition: control.c:41
@ FdoChords
Definition: control.c:38
@ FmultiFile
Definition: control.c:38
@ FbeVerbose
Definition: control.c:42
@ FnewWordShortcut
Definition: control.c:38
@ FuptextOnRests
Definition: control.c:39
@ FsplitShortcut
Definition: control.c:38
@ FunbeamVocal
Definition: control.c:39
@ FdoLyrics
Definition: control.c:39
@ FrearrangeNote
Definition: control.c:40
@ FhideBlindSlurs
Definition: control.c:39
@ FdebugMode
Definition: control.c:42
@ FsolfaNoteNames
Definition: control.c:41
@ FcheckPitch
Definition: control.c:40
@ noSuchFeature
Definition: control.c:38
@ FinsertDuration
Definition: control.c:40
@ FpedanticWarnings
Definition: control.c:41
@ FdoUptext
Definition: control.c:39
@ FexpandMacro
Definition: control.c:40
@ FinstrumentNames
Definition: control.c:41
boolean solfaNoteNames(void)
Definition: control.c:218
boolean instrumentNames(void)
Definition: control.c:188
boolean insertDuration(void)
Definition: control.c:164
static Tfeature feat[21]
Definition: control.c:55
boolean unbeamVocal(void)
Definition: control.c:230
boolean multiFile(void)
Definition: control.c:260
boolean pedanticWarnings(void)
Definition: control.c:212
void mtxLevel(char *level)
Definition: control.c:126
boolean countMacro(void)
Definition: control.c:152
boolean hideBlindSlurs(void)
Definition: control.c:194
boolean uptextOnRests(void)
Definition: control.c:224
boolean expandMacro(void)
Definition: control.c:158
struct Tfeature Tfeature
boolean beVerbose(void)
Definition: control.c:176
void printFeatures(boolean anyway)
Definition: control.c:80
int strcmp()
Definition: coll.cpp:143
int printf()
mpz_t * f
Definition: gen-fib.c:34
#define s
Definition: afcover.h:80
small capitals from c petite p scientific i
Definition: afcover.h:80
Definition: t1part.c:39
char tag[31]
Definition: control.c:46
boolean changed
Definition: control.c:47
boolean active
Definition: control.c:47
Definition: xmlparse.c:179
Definition: strexpr.c:21
val
Definition: tex4ht.c:3227
boolean equalsIgnoreCase(char *s1_, char *s2_)
Definition: utility.c:111