Skip to content

Commit 8badce8

Browse files
authored
doc cmdInput1 and dependent(1) (#75)
* doc cmdInput (1) * copy preconditions of cmdInput to cmdInput1 * fix description of return in cmdInput * document the role of CTRL-D in cmdInput * clarify some points * better understand hyperlinking in doxygen * explain cmdIput1, next version * explain cmdIput1, next version * explain cmdIput1, next version * doc log file * point out copy problems of pointers * doc addToUsedPool * fix incorrect usage of memUsedPool in case of full blocks * clarify post cond. of addToUsedPool * fix description of memUsedPool * doc poolFree * add pre post conditions * doc poolMalloc and others * fix doc of getPoolStats * doc pntrTempAlloc * fine tuning * be more precise with temp_pntrString * improve doc of poolMalloc * do the best to ref to bug() * better doc early phase of pntrString allocation * describe temporary stacks in more detail * extend description of pntrTempAllocStack * improve doc of pntrLet * improve doc of pntrLet * fix doc of let * fix spelling errors * doc pntrAddElement * doc submit mode in cmdInput1 * finished doc of cmdInput1 * the final edits were not saved, so here they are * fix review issues * rm a LF * add pre to pntrAddElement * rm more unnecessary LF * fix dangling conflict marker * fix indentation * css for customizing p tags Co-authored-by: Wolf Lammen <[email protected]>
1 parent c1d7148 commit 8badce8

File tree

8 files changed

+749
-327
lines changed

8 files changed

+749
-327
lines changed

src/metamath.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -723,16 +723,16 @@ void command(int argc, char *argv[]);
723723
/*! \fn int main(int argc, char *argv[])
724724
* \brief entry point of the metamath program
725725
* \param argc int number of command line parameters
726-
* \param argv (char*)[] array of \a argc command line parameters, followed by NULL
726+
* \param argv (char*)[] array of \p argc command line parameters, followed by NULL
727727
* \return success 0 else failure
728728
*
729729
* Running metamath
730730
* ./metamath 'read set.mm' 'verify proof *'
731-
* will start main with \a argc set to 2, argv[0] to "read set.mm", argv[1]
731+
* will start main with \p argc set to 2, argv[0] to "read set.mm", argv[1]
732732
* to "verify proof *" (both without quotes) and argv[2] to NULL.
733733
* Returning 0 indicates successful completion, anything else some kind of
734-
failure.
735-
* For details see \ref https://en.cppreference.com/w/cpp/language/main_function.
734+
* failure.
735+
* For details see https://en.cppreference.com/w/cpp/language/main_function.
736736
*/
737737
int main(int argc, char *argv[]) {
738738

src/mmcmdl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ extern flag g_commandEcho; /*!< Echo full command */
4747
* \brief `MEMORY_STATUS` option: Always show memory
4848
*
4949
* Indicates whether the user has turned MEMORY_STATUS on.
50+
*
5051
* If the user issues SET MEMORY_STATUS ON this \ref flag is set to 1. It is
5152
* reset to 0 again on a SET MEMORY_STATUS OFF command. When 1, certain
52-
* memory de/allocations are monitored - see \a db3.
53+
* memory de/allocations are monitored - see \ref db3.
5354
*/
5455
extern flag g_memoryStatus;
5556

src/mmdata.c

Lines changed: 141 additions & 43 deletions
Large diffs are not rendered by default.

src/mmdata.h

Lines changed: 231 additions & 44 deletions
Large diffs are not rendered by default.

src/mminou.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ vstring_def(g_printString);
4646
long g_commandFileNestingLevel = 0;
4747
FILE *g_commandFilePtr[MAX_COMMAND_FILE_NESTING + 1];
4848
vstring g_commandFileName[MAX_COMMAND_FILE_NESTING + 1];
49+
/*!
50+
* \var flag g_commandFileSilent[]
51+
* a 1 for a particular \ref g_commandFileNestingLevel suppresses output for
52+
* that submit nesting level. The value for the interactive level
53+
* (\ref g_commandFileNestingLevel == 0) is ignored.
54+
*/
4955
flag g_commandFileSilent[MAX_COMMAND_FILE_NESTING + 1];
5056
flag g_commandFileSilentFlag = 0; /* For SUBMIT ... /SILENT */
5157

@@ -67,14 +73,16 @@ flag g_quitPrint = 0; /* Flag that user quit the output */
6773
/*!
6874
* \var flag localScrollMode
6975
*
70-
* temporarily disables prompted scroll (see \a g_scrollMode) until next user
76+
* temporarily disables prompted scroll (see \ref g_scrollMode) until next user
7177
* prompt
7278
*/
7379
flag localScrollMode = 1; /* 0 = Scroll continuously only till next prompt */
7480

7581
/* Buffer for B (back) command at end-of-page prompt - for future use */
7682
/*! \var pntrString* backBuffer
77-
* Buffer for B (back) command at end-of-page prompt.
83+
* Buffer for B (back) command at end-of-page prompt. Although formally a
84+
* \ref pntrString is an array of void*, this buffer contains always pointer to
85+
* \ref vstring.
7886
*
7987
* Some longer text (like help texts for example) provide a page wise display
8088
* with a scroll option, so the user can move freely back and forth in the
@@ -85,9 +93,10 @@ pntrString_def(backBuffer);
8593
/*!
8694
* \var backBufferPos
8795
*
88-
* A position within the \a backBuffer.
96+
* Number of entries in the \ref backBuffer that are available for repeatedly
97+
* scrolling back. Initialized to 0.
8998
*
90-
* \invariant The value 0 requires an empty \a backBuffer.
99+
* \invariant The value 0 requires an empty \ref backBuffer.
91100
*/
92101
long backBufferPos = 0;
93102
flag backFromCmdInput = 0; /* User typed "B" at main prompt */
@@ -651,7 +660,6 @@ vstring cmdInput(FILE *stream, const char *ask) {
651660
long i;
652661

653662
while (1) { /* For "B" backup loop */
654-
// drucke prompt
655663
if (ask != NULL && !g_commandFileSilentFlag) {
656664
printf("%s", ask);
657665
#if __STDC__

src/mminou.h

Lines changed: 169 additions & 68 deletions
Large diffs are not rendered by default.

src/mmvstr.c

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ This is an emulation of the string functions available in VMS BASIC.
3232
/*E*/long db1=0;
3333
/*!
3434
* \def INCDB1
35-
* updates \a db1 if NDEBUG is not defined, is a no operation else.
35+
* updates \ref db1 if NDEBUG is not defined, is a no operation else.
3636
*
3737
* NDEBUG switches C assert instructions off or on. So the handling of db1 is
3838
* aligned with assert().
@@ -46,9 +46,9 @@ This is an emulation of the string functions available in VMS BASIC.
4646
/*!
4747
* \def MAX_ALLOC_STACK
4848
*
49-
* The number of \a vstring pointers set aside for temporary string evaluation.
50-
* This number covers the needs of ordinary nested functions but it puts a
51-
* limit to recurrent calls.
49+
* The number of \ref vstring pointers set aside for temporary string
50+
* evaluation. This number covers the needs of ordinary nested functions but
51+
* it puts a limit to recurrent calls.
5252
*
5353
* The number given here is one greater than actually available. One entry is
5454
* reserved for the terminal null pointer marking the top of stack.
@@ -61,20 +61,20 @@ long g_startTempAllocStack = 0; /* Where to start freeing temporary allocatio
6161
/*!
6262
* \brief stack for temporary text.
6363
*
64-
* This \ref stack "stack" contains \a vstring pointers holding temporary text
65-
* like fragments, boilerplate and so on. The current top of the stack is
66-
* \a g_tempAllocStackTop. Nested functions share this stack, each setting
64+
* This \ref stack "stack" contains \ref vstring pointers holding temporary
65+
* text like fragments, boilerplate and so on. The current top of the stack is
66+
* \ref g_tempAllocStackTop. Nested functions share this stack, each setting
6767
* aside its own scope. The scope of the most nested function begins at index
68-
* \a g_startTempAllocStack.
68+
* \ref g_startTempAllocStack.
6969
*
70-
* When a nested function starts execution, it saves \a g_startTempAllocStack
71-
* and copies the \a g_tempAllocStackTop into it, marking the begin of its own
70+
* When a nested function starts execution, it saves \ref g_startTempAllocStack
71+
* and copies the \ref g_tempAllocStackTop into it, marking the begin of its own
7272
* scope of temporaries. Before returning, both values are restored again.
7373
*
7474
* The scope of top level functions begins at index 0
7575
*.
7676
* \invariant
77-
* - The entry at \a g_tempAllocStackTop is NULL.
77+
* - The entry at \ref g_tempAllocStackTop is NULL.
7878
*/
7979
void *tempAllocStack[MAX_ALLOC_STACK];
8080

@@ -93,21 +93,21 @@ void freeTempAlloc(void) {
9393

9494
/*!
9595
* \fn pushTempAlloc(void *mem)
96-
* \brief pushes a pointer onto the \a tempAllocStack.
96+
* \brief pushes a pointer onto the \ref tempAllocStack.
9797
*
98-
* In case of a stack overflow \a bug is called. This function is low level
99-
* that does not ensure that invariants of \a tempAllocStack are kept.
98+
* In case of a stack overflow \ref bugfn "bug" is called. This function is low level
99+
* that does not ensure that invariants of \ref tempAllocStack are kept.
100100
*
101101
* \param mem (not null) points to either a non-mutable empty string, or
102102
* to allocated memory. Its contents need not be valid yet, although it is
103103
* recommended to point to a non-NUL character.
104104
* \pre
105105
* The stack must not be full.
106106
* \post
107-
* If not full, \a mem is added on top of \a tempAllocStack, and
108-
* \a g_tempAllocStackTop is increased. This function
107+
* If not full, \p mem is added on top of \ref tempAllocStack, and
108+
* \ref g_tempAllocStackTop is increased. This function
109109
* does not ensure a NULL pointer follows the pushed pointer. Statistics in
110-
* \a db1 is not updated.
110+
* \ref db1 is not updated.
111111
* \warning
112112
* In case of stack overflow, the caller is not notified and a memory leak
113113
* is likely.
@@ -127,19 +127,20 @@ static void pushTempAlloc(void *mem)
127127
/*!
128128
* \fn tempAlloc(long size)
129129
*
130-
* \brief allocates memory for size bytes and pushes it onto the \a tempAllocStack
130+
* \brief allocates memory for size bytes and pushes it onto the
131+
* \ref tempAllocStack
131132
*
132133
* This low level function does NOT initialize the allocated memory. If the
133-
* allocation on the heap fails, \a bug is called. The statistic value \a db1
134-
* is updated.
134+
* allocation on the heap fails, \ref bugfn "bug" is called. The statistic
135+
* value \ref db1 is updated.
135136
*
136137
* \param size (> 0) number of bytes to allocate on the heap. If the memory is
137138
* intended to hold NUL terminated text, then size must account for the final
138139
* NUL character, too.
139140
* \pre
140-
* The \a tempAllocStack must not be full.
141+
* The \ref tempAllocStack must not be full.
141142
* \post
142-
* The top of \a tempAllocStack addresses memory at least the size of the
143+
* The top of \ref tempAllocStack addresses memory at least the size of the
143144
* submitted parameter.
144145
* \warning
145146
* In case of stack overflow, the caller is not notified and a memory leak

0 commit comments

Comments
 (0)