mirror of
https://github.com/lcn2/calc.git
synced 2025-08-16 01:03:29 +03:00
improved calc computation error codes message array
Changed calc_errno a global int variable so that is may be directly accessed by libcalc users. Further improve help files for help/errno, help/error, help/newerror, help/stoponerror and help/strerror by adding to documentation of the calc error code system as well as libcalc interface where applicable. Changed #define E_USERDEF to #define E__USERDEF. Removed use of E_USERDEF, E__BASE, E__COUNT, and E__HIGHEST from custom/c_sysinfo because the c_sysinfo is just a demo and this will simplify the custom/Makefile. The include file calcerr.h is now the errsym.h include file. The calcerr.tbl has been replaced by errtbl.c and errtbl.h. The calcerr_c.awk, calcerr_c.sed, calcerr_h.awk, and calcerr_h.sed files are now obsolete and have been removed. The calcerr.c and calcerr.h now obsolete and are no longer built. The calc computation error codes, symbols and messages are now in a error_table[] array of struct errtbl. An E_STRING is a string corresponds to an error code #define. For example, the E_STRING for the calc error E_STRCAT, is the string "E_STRING". An E_STRING must now match the regular expression: "^E_[A-Z0-9_]+$". The old array error_table[] of error message strings has been replaced by a new error_table[] array of struct errtbl. The struct errtbl array holds calc errnum error codes, the related E_STRING symbol as a string, and the original related error message. To add new computation error codes, add them near the bottom of the error_table[] array, just before the NULL entry. The ./errcode utility, when run, will verify the consistency of the error_table[] array. The Makefile uses ./errcode -e to generate the contents of help/errorcodes file. The help errorcodes now prints information from the new cstruct errtbl error_table[] array. The help/errorcodes.hdr and help/errorcodes.sed files are now obsolete and have been removed. The Makefile uses ./errcode -d to generate the contents of the errsym.h include file. Updated .gitignore and trailblank to support the above changes.
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -33,8 +33,6 @@ calc-static
|
||||
calc.1
|
||||
calc.spec
|
||||
calc.usage
|
||||
calcerr.c
|
||||
calcerr.h
|
||||
charbit.h
|
||||
chatbit
|
||||
chk_c
|
||||
@@ -55,6 +53,8 @@ custom/libcustcalc*
|
||||
debug.out
|
||||
endian
|
||||
endian_calc.h
|
||||
errcode
|
||||
errsym.h
|
||||
fposval
|
||||
fposval.h
|
||||
func.show
|
||||
|
Reference in New Issue
Block a user