Skip to content

Commit 251d2b5

Browse files
committed
finished doc of cmdInput1
1 parent 7f66022 commit 251d2b5

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

src/mminou.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,11 @@ vstring cmdInput(FILE *stream, const char *ask);
259259
* copied from the appropriate entry of \ref g_commandFileSilent, unless the
260260
* interactive mode is reached; here output is never suppressed (value 0).
261261
*
262+
* 3. remove all CR (0x0D) characters, not only those in compination with LF.
263+
*
264+
* 4. prompt and command is printed, if not suppressed, then the read line is
265+
* returned.
266+
*
262267
* \return first not interpreted line as \ref vstring, or "EXIT" on error.
263268
* \pre
264269
* The following variables are honored during execution and should be properly
@@ -289,6 +294,9 @@ vstring cmdInput(FILE *stream, const char *ask);
289294
* \ref g_pntrStartTempAlloc.
290295
* - interactive mode: The \ref backBuffer is cleared, then filled with
291296
* prompt (last line only) and input of the user.
297+
* - submit mode: In case of EOF the previous \ref g_commandFileNestingLevel
298+
* is activated, necessary cleanups performed, and
299+
* the \ref g_commandFileSilentFlag is updated appropriately.
292300
* \warning the calling program must deallocate the returned string.
293301
*/
294302
vstring cmdInput1(const char *ask);

src/mmvstr.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,31 @@ temp_vstring left(const char *sin, long n);
454454
* \bug a stack overflow of \a tempAllocStack is not handled correctly.
455455
*/
456456
temp_vstring right(const char *sin, long n);
457+
/*!
458+
* \fn temp_vstring edit(const char *sin, long control)
459+
* perform a combination of transformations on \p sin based on the set bits in
460+
* \p control.
461+
* Bit Effect
462+
* 1 Clear parity bits
463+
* 2 Discard all spaces and tabs
464+
* 4 Discard characters: CR, LF, FF, ESC, RUBOUT, and NULL
465+
* 8 Discard leading spaces and tabs
466+
* 16 Reduce spaces and tabs to one space
467+
* 32 Convert lowercase to uppercase
468+
* 64 Convert [ to ( and ] to )
469+
* 128 Discard trailing spaces and tabs
470+
* 256 Do not alter characters inside quotes
471+
* 512 Convert uppercase to lowercase
472+
* 1024 Tab the line (convert spaces to equivalent tabs)
473+
* 2048 Untab the line (convert tabs to equivalent spaces)
474+
* 4096 Convert VT220 screen print frame graphics to -,|,+ characters
475+
* 8192 Discard CR only (to assist DOS-to-Unix conversion)
476+
* 16384 Discard trailing spaces, tabs, and LFs
477+
* \param[in] sin (not null) NUL terminated string to convert
478+
* \param[in] control a combination of set bit requesting the desired
479+
* transformation(s)
480+
* \return the transformed \p sin ready for pushing on \ref tempAllocStack.
481+
*/
457482
temp_vstring edit(const char *sin, long control);
458483
/*!
459484
* \fn temp_vstring space(long n)

0 commit comments

Comments
 (0)