@@ -65,6 +65,12 @@ extern long g_commandFileNestingLevel;
65
65
* valid, and point to opened files.
66
66
*/
67
67
extern FILE * g_commandFilePtr [MAX_COMMAND_FILE_NESTING + 1 ];
68
+ /*!
69
+ * \var vstring g_commandFileName[]
70
+ * list of command file names in nested SUBMIT commands. This name need not be
71
+ * fully qualified (with all directories down from the root directory). The
72
+ * first element is reserved for stdin and never set.
73
+ */
68
74
extern vstring g_commandFileName [MAX_COMMAND_FILE_NESTING + 1 ];
69
75
extern flag g_commandFileSilent [MAX_COMMAND_FILE_NESTING + 1 ];
70
76
/*!
@@ -210,9 +216,9 @@ vstring cmdInput(FILE *stream, const char *ask);
210
216
* After some explanatory text is printed, gets a line from either stdin or the
211
217
* command file stream in \ref g_commandFilePt, depending on the value of
212
218
* \ref g_commandFileNestingLevel. If this value is 0, interactive input via
213
- * stdin is assumed, else non interpreted lines are read from a file. The line returned
214
- * to the caller is more or less what \ref cmdInput() yields, but some fine
215
- * tuning is applied.
219
+ * stdin is assumed, else non interpreted lines are read from a file in submit
220
+ * mode. The line returned to the caller is more or less what \ref cmdInput()
221
+ * yields, but some fine tuning is applied.
216
222
*
217
223
* \par Displaying the prompt text
218
224
*
@@ -239,6 +245,19 @@ vstring cmdInput(FILE *stream, const char *ask);
239
245
* immediate stop on the caller's side.
240
246
*
241
247
* 4. If logging is enabled, prompt and returned input is logged.
248
+ *
249
+ * \par Submit Mode
250
+ *
251
+ * 1. a non-interpreted line is read from the appropriate entry in
252
+ * \ref g_commandFilePtr by \ref cmdInput.
253
+ *
254
+ * 2. If NULL is returned, reaching EOF is assumed, the file is closed, its
255
+ * name in \ref g_commandFileName deallocated and the previous
256
+ * \ref g_commandFileLevel is activated. In this particular case the read line
257
+ * is the empty string. A message indicating the end of the command file is
258
+ * printed. The \ref g_commandFileSilentFlag controlling console output is
259
+ * copied from the appropriate entry of \ref g_commandFileSilent, unless the
260
+ * interactive mode is reached; here output is never suppressed (value 0).
242
261
*
243
262
* \return first not interpreted line as \ref vstring, or "EXIT" on error.
244
263
* \pre
@@ -261,7 +280,15 @@ vstring cmdInput(FILE *stream, const char *ask);
261
280
* - \ref g_logFileOpenFlag if set to 1, a not interpreted returned line is
262
281
* logged before it is passed on to the caller.
263
282
* \post
264
- * \ref localScrollMode is set to 1
283
+ * - \ref localScrollMode is set to 1
284
+ * - \ref printedLines is reset to 0
285
+ * - \ref g_quitPrint is reset to 0
286
+ * - interactive mode: \ref tempAllocStack frees top elements down to
287
+ * \ref g_startTempAlloc.
288
+ * - interactive mode: \ref pntrTempAllocStack frees top elements down to
289
+ * \ref g_pntrStartTempAlloc.
290
+ * - interactive mode: The \ref backBuffer is cleared, then filled with
291
+ * prompt (last line only) and input of the user.
265
292
* \warning the calling program must deallocate the returned string.
266
293
*/
267
294
vstring cmdInput1 (const char * ask );
0 commit comments