rename E__COUNT to ECOUNT

Rename the #define E__COUNT to ECOUNT to avoid confusion
with "E_STRING" error symbols.

Improve formatting of help/error, help/errno, and help/strerror.

Update .gitignore.
This commit is contained in:
Landon Curt Noll
2023-09-13 20:20:46 -07:00
parent d943fda3eb
commit 40c8f875c1
7 changed files with 73 additions and 56 deletions

View File

@@ -32,15 +32,19 @@ DESCRIPTION
If the global calc error count exceeds the maximum count
(see help errmax), any ongoing calc execution is aborted.
All other values of errnum are reserved for future use and currently
will generate an error.
With error("E_STRING") string argument:
NOTE:
XXX - fill in - XXX
For no errnum arg:
Calling error() without an argument will return the current
"global calc_errno value" AND will also increment the
global calc error count.
All other values of errnum are reserved for future use and currently
will generate an error.
Use errno() instead of error() to return the "global calc_errno
value" without incrementing the global calc error count.
@@ -57,31 +61,22 @@ DESCRIPTION
By convention, the "global calc_errno value" has the following ranges:
errnum < 0 Reserved for future use
errnum == 0 calc_errno cleared: libc errno codes above here
1 <= errnum <= 9999 system error and libc errno codes
errnum == 10000 Reserved for "No error" calc internal state
10001 <= errnum <= E__HIGHEST calc computation error codes
E__HIGHEST < errnum < 20000 Reserved for future calc error codes
20000 < errnum <= 32767 User defined error codes start here
errnum >= 32768 Reserved for future use
The following constants are part of the calc error code mechanism:
E__BASE == 10000 # 1 less than the 1st calc computation error code
E__COUNT # number of calc computation error codes (not including E__BASE)
E__HIGHEST # highest assigned calc computation error code
E__USERDEF == 20000 # user defined error codes start here
E__USERMAX == 32767 # maximum user defined error code
E__BASE == 10000 1 less than the 1st calc computation error code
E__HIGHEST highest assigned calc computation error code
E__USERDEF == 20000 user defined error codes start here
E__USERMAX == 32767 maximum user defined error code
ECOUNT number of calc computation error codes (not including E__BASE)
See help errorcodes for the actual values of the above constants.
@@ -115,10 +110,12 @@ EXAMPLE
LIMITS
0 <= errnum <= 32767
E_STRING is C string matching the regular expression: "^E_[A-Z0-9_]+$"
E_STRING is string matching the regular expression: "^E_[A-Z0-9_]+$"
LINK LIBRARY
int calc_errno; /* global calc_errno value */
int calc_errno; /* global calc_errno value */
CONST struct errtbl error_table[ECOUNT+2]; /* calc error codes, error symbols and error messages */
SEE ALSO
errcount, errmax, errorcodes, iserror, errno, strerror, newerror,