prep for calc version 2.14.1.4

Updated COPYING file to indicate that these files are now
covered under "The Unlicense" (see https://unlicense.org):

	sha1.c
	sha1.h
	cal/dotest.cal
	cal/screen.cal

Updated help/credit to match the above changes to COPYING.

Updated CONTRIB-CODE and calc.man to refer to using GitHub pull requests
for contributing to calc (instead of using Email).

Updated BUGS and calc.man to refer to using GitHub issues
for reporting calc bugs (instead of using Email).

Updated QUESTIONS and calc.man to refer to using GitHub issues
for asking calc questions (instead of using Email).

Fixed Makefile.local command example to refer to overriding the
Makefile variable DEBUG (instead of CDEBUG).

Fixed all make chk ASAN warnings under macOS 13.2.1 when calc is compiled
with the following uncommented lines in Makefile.local:

    DEBUG:= -O0 -g
    CFLAGS+= -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined
    LDFLAGS+= -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined
    CALC_ENV+= ASAN_OPTIONS=detect_stack_use_after_return=1

Improved how pointers to functions are declared for the builtins
array in func.c to avoid function declarations without a prototype
that is now deprecated in C.

Improved how pointers to functions are declared for the opcodes
array in opcodes.c to avoid function declarations without a prototype

Replaced use of egrep with grep -E in Makefiles.

Fixed cases where variables were set but not used in symbol.c, calc.c,
and the main function in func.c as used by funclist.c.

Added rule name to "DO NOT EDIT -- generated by the Makefile" lines
in constructed files.

Test if <sys/vfs.h> exists and set HAVE_SYS_VFS_H accordingly
in have_sys_vfs.h.  Added HAVE_SYS_VFS_H to allow one to force
this value.

Test if <sys/param.h> exists and set HAVE_SYS_PARAM_H accordingly
in have_sys_param.h.  Added HAVE_SYS_PARAM_H to allow one to force
this value.

Test if <sys/mount.h> exists and set HAVE_SYS_MOUNT_H accordingly
in have_sys_mount.h.  Added HAVE_SYS_MOUNT_H to allow one to force
this value.

Test if the system as the statfs() system call and set HAVE_STATFS
accordingly in have_statfs.h.  Added HAVE_STATFS to allow one
to force this value.

The pseudo_seed() function will also try to call statfs() if
possible and permitted by the HAVE_STATFS value.
This commit is contained in:
Landon Curt Noll
2023-03-06 02:17:40 -08:00
parent 644b348bcb
commit d89ea78104
33 changed files with 1999 additions and 1198 deletions

6
.gitignore vendored
View File

@@ -6,6 +6,7 @@
# #
.dynamic .dynamic
.hsrc .hsrc
Makefile.our
NOTES NOTES
align32.h align32.h
args.h args.h
@@ -49,12 +50,16 @@ have_newstr.h
have_offscl.h have_offscl.h
have_posscl.h have_posscl.h
have_rusage.h have_rusage.h
have_statfs.h
have_stdlib.h have_stdlib.h
have_stdvs have_stdvs
have_strdup.h have_strdup.h
have_string.h have_string.h
have_strlcat.h have_strlcat.h
have_strlcpy.h have_strlcpy.h
have_sys_mount.h
have_sys_param.h
have_sys_vfs.h
have_times.h have_times.h
have_uid_t.h have_uid_t.h
have_unistd.h have_unistd.h
@@ -93,7 +98,6 @@ libcalc*
libcustcalc* libcustcalc*
longbits longbits
longbits.h longbits.h
Makefile.our
sample_many sample_many
sample_rand sample_rand
tags tags

61
BUGS
View File

@@ -28,7 +28,7 @@ Click in the triangle to open up the Assets then click on
the approptiate package to download. the approptiate package to download.
If you made and modifications to calc beyond the simple Makefile If you made and modifications to calc beyond the simple Makefile
configuration, try backing those changges out and see if things get configuration, try backing those changes out and see if things get
better. better.
If you have tried all of the above and things still are not right, If you have tried all of the above and things still are not right,
@@ -60,44 +60,7 @@ GitHub web page, click on this button:
((New Issue)) ((New Issue))
=-= Please include the following information in the new issue:
If you prefer to not use GitHub, then you
may send bug and bug fixes reports to:
calc-bugrept-mail at asthe dot com
NOTE: Remove spaces and replace 'at' with @, 'dot' with .
NOTE: This replaces the old calc-bugs at asthe dot com address.
PLEASE put following the SPECIAL PHRASE somewhere in your Email Subject line:
calc bug report
You may add additional words to your subject line.
Suggestion:
From time to time, the Email address and Subject SPECIAL PHRASE
may change so verify you have the current info by visiting:
http://www.isthe.com/chongo/tech/comp/calc/calc-bugrept.html
IMPORTANT:
PLEASE use the above SPECIAL PHRASE somewhere in the Subject line or
the mail system won't deliver your Email message.
Keep in mind that the best way to report on a calc bug is
via the above mentioned calc GitHub issue URL.
Please be patient as we cannot always respond to Email messages quickly.
=-=
When you send your report, via the calc GitHub issue URL or Email,
please include the following information:
* A description of the problem * A description of the problem
@@ -123,12 +86,13 @@ please include the following information:
* If calc dumped core, try to send us a core dump stack trace * If calc dumped core, try to send us a core dump stack trace
* cd to the calc source directory, and send the contents * cd to the calc source directory, and send the contents
of debug.out produced by this command: of debug.out.txt produced by this command:
make debug > debug.out 2>&1 make debug > debug.out.txt 2>&1
Fell free to use the above address to send in bug fixes (in the form PLEASE attach the debug.out.txt file to your GitHub issue (bug report)!!
of a context diff patch).
Please be patient as we cannot always respond to pull requests quickly.
=-= =-=
@@ -192,9 +156,18 @@ mis-features in calc:
will not. will not.
* The numerator is assumed
The numerator value of 1 appears to be assumed. In calc:
/ 2
will produce a value of 0.5 as if the numerator 1 was given.
=-= =-=
## Copyright (C) 1999-2014,2021 Landon Curt Noll ## Copyright (C) 1999-2014,2021,2023 Landon Curt Noll
## ##
## Calc is open software; you can redistribute it and/or modify it under ## Calc is open software; you can redistribute it and/or modify it under
## the terms of the version 2.1 of the GNU Lesser General Public License ## the terms of the version 2.1 of the GNU Lesser General Public License

64
CHANGES
View File

@@ -10,6 +10,70 @@ The following are the changes from calc version 2.14.2.3 to date:
Set SHELL in Makefiles to the basename of the shell. Set SHELL in Makefiles to the basename of the shell.
Updated COPYING file to indicate that these files are now
covered under "The Unlicense" (see https://unlicense.org):
sha1.c
sha1.h
cal/dotest.cal
cal/screen.cal
Updated help/credit to match the above changes to COPYING.
Updated CONTRIB-CODE and calc.man to refer to using GitHub pull requests
for contributing to calc (instead of using Email).
Updated BUGS and calc.man to refer to using GitHub issues
for reporting calc bugs (instead of using Email).
Updated QUESTIONS and calc.man to refer to using GitHub issues
for asking calc questions (instead of using Email).
Fixed Makefile.local command example to refer to overriding the
Makefile variable DEBUG (instead of CDEBUG).
Fixed all make chk ASAN warnings under macOS 13.2.1 when calc is compiled
with the following uncommented lines in Makefile.local:
DEBUG:= -O0 -g
CFLAGS+= -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined
LDFLAGS+= -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined
CALC_ENV+= ASAN_OPTIONS=detect_stack_use_after_return=1
Improved how pointers to functions are declared for the builtins
array in func.c to avoid function declarations without a prototype
that is now deprecated in C.
Improved how pointers to functions are declared for the opcodes
array in opcodes.c to avoid function declarations without a prototype
Replaced use of egrep with grep -E in Makefiles.
Fixed cases where variables were set but not used in symbol.c, calc.c,
and the main function in func.c as used by funclist.c.
Added rule name to "DO NOT EDIT -- generated by the Makefile" lines
in constructed files.
Test if <sys/vfs.h> exists and set HAVE_SYS_VFS_H accordingly
in have_sys_vfs.h. Added HAVE_SYS_VFS_H to allow one to force
this value.
Test if <sys/param.h> exists and set HAVE_SYS_PARAM_H accordingly
in have_sys_param.h. Added HAVE_SYS_PARAM_H to allow one to force
this value.
Test if <sys/mount.h> exists and set HAVE_SYS_MOUNT_H accordingly
in have_sys_mount.h. Added HAVE_SYS_MOUNT_H to allow one to force
this value.
Test if the system as the statfs() system call and set HAVE_STATFS
accordingly in have_statfs.h. Added HAVE_STATFS to allow one
to force this value.
The pseudo_seed() function will also try to call statfs() if
possible and permitted by the HAVE_STATFS value.
The following are the changes from calc version 2.14.2.0 to 2.14.1.2: The following are the changes from calc version 2.14.2.0 to 2.14.1.2:

View File

@@ -1,73 +1,37 @@
Calc is open source. Contributions of code are welcome. Calc is open source. Contributions of code are welcome.
We welcome and encourage you to send us: In order to consider integrating your contributions, we need:
* calc resource files (cal/*.cal files) * your changes applied agsinst the top of the calc master branch:
* calc shell scripts (cscript/*.calc files)
* builtin functions that you have modified or written, i.e.:
assocfunc.c comfunc.c func.c func.h
listfunc.c matfunc.c qfunc.c zfunc.c
* custom functions that you have modified or written
* help files modified or written (help/*)
* Makefile improvements (Makefile, */Makefile)
* other source code modifications (*.c, *.h)
* etc. (* */* :) )
In order to consider integrating your code, we need: https://github.com/lcn2/calc/
* calc version you are working with (please try use the latest version)
* new help files or help file patches, if applicable (documentation) * new help files or help file patches, if applicable (documentation)
* proposed text for the CHANGES file (brief description of what it does)
* regress.cal test patch as needed
* your source code and/or source code changes (:-))
If you add functionality to calc, please be sure to modify/patch/add * Update CHANGES file (brief description of what it does)
* regress.cal test patch as needed
If you add functionality to calc, please be sure to modify
Makefiles, help files, cal/regress.cal test code as well. Makefiles, help files, cal/regress.cal test code as well.
Regression test cases are vital to maintaining calc's level Regression test cases are vital to maintaining calc's level
of correctness and helps us avoid code bug regression. of correctness and helps us avoid code bug regression.
Please try to generate a patch against the most recent
version of calc, and if you use GitHub, the top of the
master branch:
https://github.com/lcn2/calc
The best way contribute to calc bug is to generate calc The best way contribute to calc bug is to generate calc
GitHub pull request: GitHub pull request against the calc GitHub repo:
https://github.com/lcn2/calc/pulls https://github.com/lcn2/calc/pulls
Please be patient as we cannot always respond pull requests quickly.
=-=
IMPORTANT:
Your code needs to be contributed under either the 2.1 of the GNU Your code needs to be contributed under either the 2.1 of the GNU
Lesser General Public License (LGPL 2.1) or in the public domain. Lesser General Public License (LGPL 2.1) or under "The Unlicense":
If you do not want to use calc GitHub, then send Email to: https://unlicense.org
calc-contrib-mail at asthe dot com
NOTE: Remove spaces and replace 'at' with @, 'dot' with .
You MUST use following SPECIAL PHRASE in your Email Subject line:
calc contribution
You may add additional words to your subject line.
Suggestion:
From time to time, the Email address and Subject SPECIAL PHRASE
may change so verify you have the current info by visiting:
http://www.isthe.com/chongo/tech/comp/calc/calc-contrib.html
IMPORTANT: If your Email doesn't contain the above phrase,
then we WILL NOT SEE your Email.
PLEASE BE SURE you have that SPECIAL PHRASE somewhere in the subject line!
Keep in mind that the best way to report on a calc bug is to use
the above mentioned calc GitHub procedure.
Please be patient as we cannot always respond to Email messages quickly.
=-= =-=
@@ -77,7 +41,7 @@ See also the calc wishlist by running the calc command:
=-= =-=
## Copyright (C) 1999,2014,2021 Landon Curt Noll ## Copyright (C) 1999,2014,2021,2023 Landon Curt Noll
## ##
## Calc is open software; you can redistribute it and/or modify it under ## Calc is open software; you can redistribute it and/or modify it under
## the terms of the version 2.1 of the GNU Lesser General Public License ## the terms of the version 2.1 of the GNU Lesser General Public License

18
COPYING
View File

@@ -4,9 +4,10 @@
This file is Copyrighted This file is Copyrighted
------------------------ ------------------------
This file is not covered under version 2.1 of the GNU LGPL.
This file is covered under the following Copyright: This file is covered under the following Copyright:
Copyright (C) 1999-2022 Landon Curt Noll Copyright (C) 1999-2023 Landon Curt Noll
All rights reserved. All rights reserved.
Everyone is permitted to copy and distribute verbatim copies Everyone is permitted to copy and distribute verbatim copies
@@ -121,11 +122,12 @@ Calc copyrights and exception files
Copyright (C) year Petteri Kettunen and Landon Curt Noll Copyright (C) year Petteri Kettunen and Landon Curt Noll
Copyright (C) year Christoph Zurnieden Copyright (C) year Christoph Zurnieden
Copyright (C) year Landon Curt Noll and Thomas Jones-Low Copyright (C) year Landon Curt Noll and Thomas Jones-Low
Copyright (C) year Klaus Alexander Seistrup and Landon Curt Noll
These files are not covered under one of the Copyrights listed above: These files are not covered under one of the Copyrights listed above:
sha1.c sha1.h COPYING sha1.c sha1.h COPYING
COPYING-LGPL cal/qtime.cal cal/screen.cal COPYING-LGPL cal/screen.cal
The file COPYING-LGPL, which contains a copy of the version 2.1 The file COPYING-LGPL, which contains a copy of the version 2.1
GNU Lesser General Public License, is itself Copyrighted by the GNU Lesser General Public License, is itself Copyrighted by the
@@ -137,8 +139,16 @@ Calc copyrights and exception files
top of this file. It is important to note that you may distribute top of this file. It is important to note that you may distribute
verbatim copies of this file but you may not modify this file. verbatim copies of this file but you may not modify this file.
Some of these exception files are in the public domain. Other files These files are covered under "The Unlicense":
are under the LGPL but have different authors that those listed above.
sha1.c
sha1.h
cal/dotest.cal
cal/screen.cal
For more information on this license, see:
https://unlicense.org
In all cases one may use and distribute these exception files freely. In all cases one may use and distribute these exception files freely.
And because one may freely distribute the LGPL covered files, the And because one may freely distribute the LGPL covered files, the

310
Makefile
View File

@@ -490,6 +490,62 @@ HAVE_MEMMOVE=
HAVE_USTAT= HAVE_USTAT=
#HAVE_USTAT= -DHAVE_NO_USTAT #HAVE_USTAT= -DHAVE_NO_USTAT
# Determine if we have statfs()
#
# If HAVE_STATFS is empty, this Makefile will run the have_statfs program
# to determine if statfs() is supported. If HAVE_STATFS is set to
# -DHAVE_NO_STATFS, then calc will use internal functions to simulate
# the statfs() function that gets file system statistics.
#
# Select HAVE_STATFS= -DHAVE_NO_STATFS for DJGPP.
#
# If in doubt, leave HAVE_STATFS empty and this Makefile will figure it out.
#
HAVE_STATFS=
#HAVE_STATFS= -DHAVE_NO_STATFS
# Determine if we have the <sys/vfs.h> include file.
#
# HAVE_SYS_VFS_H= let the Makefile look for the include file
# HAVE_SYS_VFS_H= YES assume that the include file exists
# HAVE_SYS_VFS_H= NO assume that the include file does not exist
#
# Select HAVE_SYS_VFS_H= NO for DJGPP.
#
# When in doubt, leave HAVE_SYS_VFS_H empty.
#
HAVE_SYS_VFS_H=
#HAVE_SYS_VFS_H= YES
#HAVE_SYS_VFS_H= NO
# Determine if we have the <sys/param.h> include file.
#
# HAVE_SYS_PARAM_H= let the Makefile look for the include file
# HAVE_SYS_PARAM_H= YES assume that the include file exists
# HAVE_SYS_PARAM_H= NO assume that the include file does not exist
#
# Select HAVE_SYS_PARAM_H= NO for DJGPP.
#
# When in doubt, leave HAVE_SYS_PARAM_H empty.
#
HAVE_SYS_PARAM_H=
#HAVE_SYS_PARAM_H= YES
#HAVE_SYS_PARAM_H= NO
# Determine if we have the <sys/mount.h> include file.
#
# HAVE_SYS_MOUNT_H= let the Makefile look for the include file
# HAVE_SYS_MOUNT_H= YES assume that the include file exists
# HAVE_SYS_MOUNT_H= NO assume that the include file does not exist
#
# Select HAVE_SYS_MOUNT_H= NO for DJGPP.
#
# When in doubt, leave HAVE_SYS_MOUNT_H empty.
#
HAVE_SYS_MOUNT_H=
#HAVE_SYS_MOUNT_H= YES
#HAVE_SYS_MOUNT_H= NO
# Determine if we have getsid() # Determine if we have getsid()
# #
# If HAVE_GETSID is empty, this Makefile will run the have_getsid program # If HAVE_GETSID is empty, this Makefile will run the have_getsid program
@@ -1332,7 +1388,7 @@ CTAGS= ctags
DATE= date DATE= date
DIFF= diff DIFF= diff
FMT= fmt FMT= fmt
GREP= egrep GREP= grep
HOSTNAME= hostname HOSTNAME= hostname
LANG= C LANG= C
LDCONFIG= ldconfig LDCONFIG= ldconfig
@@ -2086,7 +2142,8 @@ BUILD_H_SRC= align32.h args.h calcerr.h conf.h endian_calc.h \
have_string.h have_strlcat.h have_strlcpy.h have_times.h \ have_string.h have_strlcat.h have_strlcpy.h have_times.h \
have_uid_t.h have_unistd.h have_unused.h have_urandom.h \ have_uid_t.h have_unistd.h have_unused.h have_urandom.h \
have_ustat.h longbits.h terminal.h have_environ.h \ have_ustat.h longbits.h terminal.h have_environ.h \
have_arc4random.h have_limits.h charbit.h have_arc4random.h have_limits.h charbit.h have_sys_vfs.h \
have_sys_param.h have_sys_mount.h have_statfs.h
# we build these .c files during the make # we build these .c files during the make
# #
@@ -2102,7 +2159,7 @@ UTIL_C_SRC= align32.c endian.c longbits.c have_newstr.c have_uid_t.c \
have_ustat.c have_getsid.c have_getpgid.c have_environ.c \ have_ustat.c have_getsid.c have_getpgid.c have_environ.c \
have_gettime.c have_getprid.c have_rusage.c have_strdup.c \ have_gettime.c have_getprid.c have_rusage.c have_strdup.c \
have_unused.c have_ban_pragma.c have_strlcpy.c have_strlcat.c \ have_unused.c have_ban_pragma.c have_strlcpy.c have_strlcat.c \
have_arc4random.c charbit.c have_arc4random.c charbit.c have_statfs.c
# these awk and sed tools are used in the process of building BUILD_H_SRC # these awk and sed tools are used in the process of building BUILD_H_SRC
# and BUILD_C_SRC # and BUILD_C_SRC
@@ -2120,7 +2177,7 @@ UTIL_OBJS= endian.o longbits.o have_newstr.o have_uid_t.o \
have_ustat.o have_getsid.o have_getpgid.o have_environ.o \ have_ustat.o have_getsid.o have_getpgid.o have_environ.o \
have_gettime.o have_getprid.o ver_calc.o have_rusage.o have_strdup.o \ have_gettime.o have_getprid.o ver_calc.o have_rusage.o have_strdup.o \
have_unused.o have_ban_pragma.o have_strlcpy.o have_strlcat.o \ have_unused.o have_ban_pragma.o have_strlcpy.o have_strlcat.o \
have_arc4random.o charbit.o have_arc4random.o charbit.o have_statfs.o
# these temp files may be created (and removed) during the build of BUILD_C_SRC # these temp files may be created (and removed) during the build of BUILD_C_SRC
# #
@@ -2139,7 +2196,7 @@ UTIL_PROGS= align32${EXT} fposval${EXT} have_uid_t${EXT} have_const${EXT} \
have_unused${EXT} have_fpos${EXT} have_fpos_pos${EXT} \ have_unused${EXT} have_fpos${EXT} have_fpos_pos${EXT} \
have_offscl${EXT} have_rusage${EXT} have_ban_pragma${EXT} \ have_offscl${EXT} have_rusage${EXT} have_ban_pragma${EXT} \
have_strlcpy${EXT} have_strlcat${EXT} have_arc4random${EXT} \ have_strlcpy${EXT} have_strlcat${EXT} have_arc4random${EXT} \
charbit${EXT} charbit${EXT} have_statfs${ENT}
# these utility files and scripts may be created in the process of building # these utility files and scripts may be created in the process of building
# the BUILD_H_SRC file set # the BUILD_H_SRC file set
@@ -2660,7 +2717,7 @@ calc.usage: calc.1 ${MAKE_FILE} ${LOC_MKF}
LESSCHARSET=iso8859 ${CALCPAGER} calc.1; \ LESSCHARSET=iso8859 ${CALCPAGER} calc.1; \
else \ else \
${NROFF} -man calc.1; \ ${NROFF} -man calc.1; \
fi 2>&1 | ${GREP} -v 'cannot adjust line' | ${COL} -b > $@ fi 2>&1 | ${GREP} -E -v 'cannot adjust line' | ${COL} -b > $@
${Q} echo calc.usage formed ${Q} echo calc.usage formed
@@ -2723,7 +2780,7 @@ conf.h: ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f $@ ${Q} ${RM} -f $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2808,7 +2865,7 @@ endian_calc.h: endian.c have_stdlib.h have_unistd.h \
${Q} ${RM} -f endian.o endian${EXT} $@ ${Q} ${RM} -f endian.o endian${EXT} $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2860,7 +2917,7 @@ charbit.h: charbit.c have_limits.h \
${Q} ${RM} -f charbit.o charbit${EXT} $@ ${Q} ${RM} -f charbit.o charbit${EXT} $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2896,7 +2953,7 @@ longbits.h: longbits.c charbit.h have_unistd.h have_stdlib.h \
${Q} ${RM} -f longbits.o longbits${EXT} $@ ${Q} ${RM} -f longbits.o longbits${EXT} $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2926,7 +2983,7 @@ have_times.h: ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f $@ ${Q} ${RM} -f $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2992,7 +3049,7 @@ have_stdlib.h: ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f $@ ${Q} ${RM} -f $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3028,7 +3085,7 @@ have_unistd.h: ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f $@ ${Q} ${RM} -f $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3064,7 +3121,7 @@ have_limits.h: ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f $@ ${Q} ${RM} -f $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3100,7 +3157,7 @@ have_string.h: ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f $@ ${Q} ${RM} -f $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3136,7 +3193,7 @@ terminal.h: ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f $@ ${Q} ${RM} -f $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3190,7 +3247,7 @@ have_fgetsetpos.h: have_fgetsetpos.c banned.h have_ban_pragma.h ${MAKE_FILE} ${L
${Q} ${RM} -f fpos_tmp $@ ${Q} ${RM} -f fpos_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3233,7 +3290,7 @@ have_fpos_pos.h: have_fpos_pos.c have_fgetsetpos.h have_posscl.h have_string.h \
${Q} ${RM} -f fpos_tmp $@ ${Q} ${RM} -f fpos_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3279,7 +3336,7 @@ fposval.h: fposval.c have_fgetsetpos.h have_fpos_pos.h have_offscl.h have_posscl
${Q} ${RM} -f fposval_tmp $@ ${Q} ${RM} -f fposval_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3321,7 +3378,7 @@ have_const.h: have_const.c banned.h have_ban_pragma.h ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f have_const const_tmp $@ ${Q} ${RM} -f have_const const_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3364,7 +3421,7 @@ have_offscl.h: have_offscl.c have_unistd.h \
${Q} ${RM} -f offscl_tmp $@ ${Q} ${RM} -f offscl_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3405,7 +3462,7 @@ have_posscl.h: have_posscl.c have_fgetsetpos.h have_unistd.h \
${Q} ${RM} -f have_posscl have_posscl.o posscl_tmp $@ ${Q} ${RM} -f have_posscl have_posscl.o posscl_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3446,7 +3503,7 @@ align32.h: align32.c longbits.h have_unistd.h \
${Q} ${RM} -f align32 align32_tmp $@ ${Q} ${RM} -f align32 align32_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3501,7 +3558,7 @@ have_uid_t.h: have_uid_t.c have_unistd.h \
${Q} ${RM} -f have_uid_t uid_tmp $@ ${Q} ${RM} -f have_uid_t uid_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3542,7 +3599,7 @@ have_environ.h: have_environ.c \
${Q} ${RM} -f have_environ environ_tmp $@ ${Q} ${RM} -f have_environ environ_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3583,7 +3640,7 @@ have_arc4random.h: have_arc4random.c have_stdlib.h \
${Q} ${RM} -f have_arc4random arc4random_tmp $@ ${Q} ${RM} -f have_arc4random arc4random_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3624,7 +3681,7 @@ have_newstr.h: have_newstr.c banned.h have_ban_pragma.h have_string.h ${MAKE_FIL
${Q} ${RM} -f newstr_tmp $@ ${Q} ${RM} -f newstr_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3664,7 +3721,7 @@ have_memmv.h: have_memmv.c banned.h have_ban_pragma.h have_string.h ${MAKE_FILE}
${Q} ${RM} -f have_memmv have_memmv.o memmv_tmp $@ ${Q} ${RM} -f have_memmv have_memmv.o memmv_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3704,7 +3761,7 @@ have_ustat.h: have_ustat.c banned.h have_ban_pragma.h ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f ustat_tmp $@ ${Q} ${RM} -f ustat_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3739,12 +3796,161 @@ have_ustat.h: have_ustat.c banned.h have_ban_pragma.h ${MAKE_FILE} ${LOC_MKF}
${TRUE}; \ ${TRUE}; \
fi fi
have_statfs.h: have_statfs.c banned.h have_ban_pragma.h have_sys_vfs.h have_sys_param.h \
have_sys_mount.h ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f statfs_tmp $@
${H} echo 'forming $@'
${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '#if !defined(CALC_HAVE_STATFS_H)' >> $@
${Q} echo '#define CALC_HAVE_STATFS_H' >> $@
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '/* do we have or want statfs()? */' >> $@
${Q} ${RM} -f have_statfs.o have_statfs${EXT}
-${Q} ${LCC} ${ICFLAGS} ${HAVE_STATFS} have_statfs.c -c ${S} \
|| ${TRUE}
-${Q} ${LCC} ${ILDFLAGS} have_statfs.o -o have_statfs ${S} \
|| ${TRUE}
-${Q} ./have_statfs${EXT} > statfs_tmp ${E} \
|| ${TRUE}
-${Q} if [ -s statfs_tmp ]; then \
${CAT} statfs_tmp >> $@; \
else \
echo '#undef HAVE_STATFS /* no */' >> $@; \
fi
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '#endif /* !CALC_HAVE_STATFS_H */' >> $@
${Q} ${RM} -f have_statfs${EXT} have_statfs.o statfs_tmp
${H} echo '$@ formed'
-@if [ -z "${Q}" ]; then \
echo ''; \
echo '=-=-= start of $@ =-=-='; \
${CAT} $@; \
echo '=-=-= end of $@ =-=-='; \
echo ''; \
else \
${TRUE}; \
fi
have_sys_vfs.h: ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f $@
${H} echo 'forming $@'
${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '#if !defined(CALC_HAVE_SYS_VFS_H)' >> $@
${Q} echo '#define CALC_HAVE_SYS_VFS_H' >> $@
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '/* do we have <sys/vfs.h>? */' >> $@
-${Q} if [ X"${HAVE_SYS_VFS_H}" = X"YES" ]; then \
echo '#define HAVE_SYS_VFS_H /* yes */' >> $@; \
elif [ X"${HAVE_SYS_VFS_H}" = X"NO" ]; then \
echo '#undef HAVE_SYS_VFS_H /* no */' >> $@; \
elif echo '#include <sys/vfs.h>' | ${CC} -E - ${S}; then \
echo '#define HAVE_SYS_VFS_H /* yes */' >> $@; \
else \
echo '#undef HAVE_SYS_VFS_H /* no */' >> $@; \
fi
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '#endif /* !CALC_HAVE_SYS_VFS_H */' >> $@
${H} echo '$@ formed'
-@if [ -z "${Q}" ]; then \
echo ''; \
echo '=-=-= start of $@ =-=-='; \
${CAT} $@; \
echo '=-=-= end of $@ =-=-='; \
echo ''; \
else \
${TRUE}; \
fi
have_sys_param.h: ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f $@
${H} echo 'forming $@'
${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '#if !defined(CALC_HAVE_SYS_PARAM_H)' >> $@
${Q} echo '#define CALC_HAVE_SYS_PARAM_H' >> $@
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '/* do we have <sys/param.h>? */' >> $@
-${Q} if [ X"${HAVE_SYS_PARAM_H}" = X"YES" ]; then \
echo '#define HAVE_SYS_PARAM_H /* yes */' >> $@; \
elif [ X"${HAVE_SYS_PARAM_H}" = X"NO" ]; then \
echo '#undef HAVE_SYS_PARAM_H /* no */' >> $@; \
elif echo '#include <sys/param.h>' | ${CC} -E - ${S}; then \
echo '#define HAVE_SYS_PARAM_H /* yes */' >> $@; \
else \
echo '#undef HAVE_SYS_PARAM_H /* no */' >> $@; \
fi
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '#endif /* !CALC_HAVE_SYS_PARAM_H */' >> $@
${H} echo '$@ formed'
-@if [ -z "${Q}" ]; then \
echo ''; \
echo '=-=-= start of $@ =-=-='; \
${CAT} $@; \
echo '=-=-= end of $@ =-=-='; \
echo ''; \
else \
${TRUE}; \
fi
have_sys_mount.h: ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f $@
${H} echo 'forming $@'
${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '#if !defined(CALC_HAVE_SYS_MOUNT_H)' >> $@
${Q} echo '#define CALC_HAVE_SYS_MOUNT_H' >> $@
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '/* do we have <sys/param.h>? */' >> $@
-${Q} if [ X"${HAVE_SYS_MOUNT_H}" = X"YES" ]; then \
echo '#define HAVE_SYS_MOUNT_H /* yes */' >> $@; \
elif [ X"${HAVE_SYS_MOUNT_H}" = X"NO" ]; then \
echo '#undef HAVE_SYS_MOUNT_H /* no */' >> $@; \
elif echo '#include <sys/param.h>' | ${CC} -E - ${S}; then \
echo '#define HAVE_SYS_MOUNT_H /* yes */' >> $@; \
else \
echo '#undef HAVE_SYS_MOUNT_H /* no */' >> $@; \
fi
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '#endif /* !CALC_HAVE_SYS_MOUNT_H */' >> $@
${H} echo '$@ formed'
-@if [ -z "${Q}" ]; then \
echo ''; \
echo '=-=-= start of $@ =-=-='; \
${CAT} $@; \
echo '=-=-= end of $@ =-=-='; \
echo ''; \
else \
${TRUE}; \
fi
have_getsid.h: have_getsid.c have_unistd.h \ have_getsid.h: have_getsid.c have_unistd.h \
banned.h have_ban_pragma.h ${MAKE_FILE} ${LOC_MKF} banned.h have_ban_pragma.h ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f getsid_tmp $@ ${Q} ${RM} -f getsid_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3785,7 +3991,7 @@ have_getpgid.h: have_getpgid.c have_unistd.h \
${Q} ${RM} -f getpgid_tmp $@ ${Q} ${RM} -f getpgid_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3826,7 +4032,7 @@ have_gettime.h: have_gettime.c banned.h have_ban_pragma.h \
${Q} ${RM} -f gettime_tmp $@ ${Q} ${RM} -f gettime_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3867,7 +4073,7 @@ have_getprid.h: have_getprid.c have_unistd.h \
${Q} ${RM} -f getprid_tmp $@ ${Q} ${RM} -f getprid_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3907,7 +4113,7 @@ have_urandom.h: ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f $@ ${Q} ${RM} -f $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3943,7 +4149,7 @@ have_rusage.h: have_rusage.c banned.h have_ban_pragma.h ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f rusage_tmp $@ ${Q} ${RM} -f rusage_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3983,7 +4189,7 @@ have_strdup.h: have_strdup.c banned.h have_ban_pragma.h have_string.h ${MAKE_FIL
${Q} ${RM} -f strdup_tmp $@ ${Q} ${RM} -f strdup_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -4024,7 +4230,7 @@ args.h: have_stdvs.c have_varvs.c have_string.h have_unistd.h \
${Q} ${RM} -f $@ ${Q} ${RM} -f $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -4137,7 +4343,7 @@ have_unused.h: have_unused.c have_stdlib.h have_ban_pragma.h \
${Q} ${RM} -f unused_tmp $@ ${Q} ${RM} -f unused_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -4179,7 +4385,7 @@ have_ban_pragma.h: have_ban_pragma.c banned.h ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f unused_tmp $@ ${Q} ${RM} -f unused_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -4222,7 +4428,7 @@ have_strlcpy.h: have_strlcpy.c banned.h have_ban_pragma.h have_string.h \
${Q} ${RM} -f unused_tmp $@ ${Q} ${RM} -f unused_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -4264,7 +4470,7 @@ have_strlcat.h: have_strlcat.c banned.h have_ban_pragma.h have_string.h \
${Q} ${RM} -f unused_tmp $@ ${Q} ${RM} -f unused_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -4480,7 +4686,7 @@ depend: hsrc custom/Makefile
${Q} ${MKDIR} -p skel ${Q} ${MKDIR} -p skel
-${Q} for i in ${C_SRC} ${BUILD_C_SRC}; do \ -${Q} for i in ${C_SRC} ${BUILD_C_SRC}; do \
${SED} -n '/^#[ ]*include[ ]*"/p' "$$i" | \ ${SED} -n '/^#[ ]*include[ ]*"/p' "$$i" | \
${GREP} -v '\.\./getopt/getopt\.h' > "skel/$$i"; \ ${GREP} -E -v '\.\./getopt/getopt\.h' > "skel/$$i"; \
done done
${Q} ${MKDIR} -p skel/custom ${Q} ${MKDIR} -p skel/custom
-${Q} for i in ${H_SRC} ${BUILD_H_SRC} custom.h /dev/null; do \ -${Q} for i in ${H_SRC} ${BUILD_H_SRC} custom.h /dev/null; do \
@@ -4524,7 +4730,7 @@ depend: hsrc custom/Makefile
${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak ${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak
${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' \ ${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' \
${MAKE_FILE}.bak > ${MAKE_FILE} ${MAKE_FILE}.bak > ${MAKE_FILE}
${Q} ${GREP} -v '^#' skel/makedep.out >> ${MAKE_FILE} ${Q} ${GREP} -E -v '^#' skel/makedep.out >> ${MAKE_FILE}
${Q} echo removing top level skel ${Q} echo removing top level skel
${Q} ${RM} -rf skel ${Q} ${RM} -rf skel
-${Q} if ${CMP} -s ${MAKE_FILE}.bak ${MAKE_FILE}; then \ -${Q} if ${CMP} -s ${MAKE_FILE}.bak ${MAKE_FILE}; then \
@@ -4848,13 +5054,17 @@ env:
@echo 'HAVE_OFFSCL=${HAVE_OFFSCL}'; echo '' @echo 'HAVE_OFFSCL=${HAVE_OFFSCL}'; echo ''
@echo 'HAVE_POSSCL=${HAVE_POSSCL}'; echo '' @echo 'HAVE_POSSCL=${HAVE_POSSCL}'; echo ''
@echo 'HAVE_PRAGMA_GCC_POSION=${HAVE_PRAGMA_GCC_POSION}'; echo '' @echo 'HAVE_PRAGMA_GCC_POSION=${HAVE_PRAGMA_GCC_POSION}'; echo ''
@echo 'HAVE_STATFS=${HAVE_STATFS}'; echo ''
@echo 'HAVE_STDLIB_H=${HAVE_STDLIB_H}'; echo '' @echo 'HAVE_STDLIB_H=${HAVE_STDLIB_H}'; echo ''
@echo 'HAVE_STRDUP=${HAVE_STRDUP}'; echo '' @echo 'HAVE_STRDUP=${HAVE_STRDUP}'; echo ''
@echo 'HAVE_STRING_H=${HAVE_STRING_H}'; echo '' @echo 'HAVE_STRING_H=${HAVE_STRING_H}'; echo ''
@echo 'HAVE_STRLCAT=${HAVE_STRLCAT}'; echo '' @echo 'HAVE_STRLCAT=${HAVE_STRLCAT}'; echo ''
@echo 'HAVE_STRLCPY=${HAVE_STRLCPY}'; echo '' @echo 'HAVE_STRLCPY=${HAVE_STRLCPY}'; echo ''
@echo 'HAVE_SYS_MOUNT_H=${HAVE_SYS_MOUNT_H}'; echo ''
@echo 'HAVE_SYS_PARAM_H=${HAVE_SYS_PARAM_H}'; echo ''
@echo 'HAVE_SYS_TIMES_H=${HAVE_SYS_TIMES_H}'; echo '' @echo 'HAVE_SYS_TIMES_H=${HAVE_SYS_TIMES_H}'; echo ''
@echo 'HAVE_SYS_TIME_H=${HAVE_SYS_TIME_H}'; echo '' @echo 'HAVE_SYS_TIME_H=${HAVE_SYS_TIME_H}'; echo ''
@echo 'HAVE_SYS_VFS_H=${HAVE_SYS_VFS_H}'; echo ''
@echo 'HAVE_TIMES_H=${HAVE_TIMES_H}'; echo '' @echo 'HAVE_TIMES_H=${HAVE_TIMES_H}'; echo ''
@echo 'HAVE_TIME_H=${HAVE_TIME_H}'; echo '' @echo 'HAVE_TIME_H=${HAVE_TIME_H}'; echo ''
@echo 'HAVE_UID_T=${HAVE_UID_T}'; echo '' @echo 'HAVE_UID_T=${HAVE_UID_T}'; echo ''
@@ -4894,18 +5104,18 @@ env:
@echo 'MANEXT=${MANEXT}'; echo '' @echo 'MANEXT=${MANEXT}'; echo ''
@echo 'MANMAKE=${MANMAKE}'; echo '' @echo 'MANMAKE=${MANMAKE}'; echo ''
@echo 'MANMODE=${MANMODE}'; echo '' @echo 'MANMODE=${MANMODE}'; echo ''
@echo 'MKDIR=${MKDIR}'; echo ''
@echo 'MINGW=${MINGW}'; echo '' @echo 'MINGW=${MINGW}'; echo ''
@echo 'MKDIR=${MKDIR}'; echo ''
@echo 'MV=${MV}'; echo '' @echo 'MV=${MV}'; echo ''
@echo 'NROFF=${NROFF}'; echo '' @echo 'NROFF=${NROFF}'; echo ''
@echo 'NROFF_ARG=${NROFF_ARG}'; echo '' @echo 'NROFF_ARG=${NROFF_ARG}'; echo ''
@echo 'OBJS=${OBJS}'; echo '' @echo 'OBJS=${OBJS}'; echo ''
@echo 'OFF_T_BITS=${OFF_T_BITS}'; echo '' @echo 'OFF_T_BITS=${OFF_T_BITS}'; echo ''
@echo 'PREFIX=${PREFIX}'; echo ''
@echo 'PURIFY=${PURIFY}'; echo '' @echo 'PURIFY=${PURIFY}'; echo ''
@echo 'PWD=${PWD}'; echo '' @echo 'PWD=${PWD}'; echo ''
@echo 'PWDCMD=${PWDCMD}'; echo '' @echo 'PWDCMD=${PWDCMD}'; echo ''
@echo 'Q=${Q}'; echo '' @echo 'Q=${Q}'; echo ''
@echo 'PREFIX=${PREFIX}'; echo ''
@echo 'RANLIB=${RANLIB}'; echo '' @echo 'RANLIB=${RANLIB}'; echo ''
@echo 'READLINE_EXTRAS=${READLINE_EXTRAS}'; echo '' @echo 'READLINE_EXTRAS=${READLINE_EXTRAS}'; echo ''
@echo 'READLINE_INCLUDE=${READLINE_INCLUDE}'; echo '' @echo 'READLINE_INCLUDE=${READLINE_INCLUDE}'; echo ''
@@ -5096,16 +5306,16 @@ inst_files: ${MAKE_FILE} ${LOC_MKF} help/Makefile cal/Makefile \
${Q} echo ${BINDIR}/calc${EXT} > inst_files ${Q} echo ${BINDIR}/calc${EXT} > inst_files
${Q} cd help; LANG=C \ ${Q} cd help; LANG=C \
${MAKE} -f Makefile ${HELP_PASSDOWN} echo_inst_files | \ ${MAKE} -f Makefile ${HELP_PASSDOWN} echo_inst_files | \
${GREP} '__file__..' | ${SED} -e s'/.*__file__ //' >> ../inst_files ${GREP} -E '__file__..' | ${SED} -e s'/.*__file__ //' >> ../inst_files
${Q} cd cal; LANG=C \ ${Q} cd cal; LANG=C \
${MAKE} -f Makefile ${CAL_PASSDOWN} echo_inst_files | \ ${MAKE} -f Makefile ${CAL_PASSDOWN} echo_inst_files | \
${GREP} '__file__..' | ${SED} -e s'/.*__file__ //' >> ../inst_files ${GREP} -E '__file__..' | ${SED} -e s'/.*__file__ //' >> ../inst_files
${Q} cd custom; LANG=C \ ${Q} cd custom; LANG=C \
${MAKE} -f Makefile ${CUSTOM_PASSDOWN} echo_inst_files | \ ${MAKE} -f Makefile ${CUSTOM_PASSDOWN} echo_inst_files | \
${GREP} '__file__..' | ${SED} -e s'/.*__file__ //' >> ../inst_files ${GREP} -E '__file__..' | ${SED} -e s'/.*__file__ //' >> ../inst_files
${Q} cd cscript; LANG=C \ ${Q} cd cscript; LANG=C \
${MAKE} -f Makefile ${CSCRIPT_PASSDOWN} echo_inst_files | \ ${MAKE} -f Makefile ${CSCRIPT_PASSDOWN} echo_inst_files | \
${GREP} '__file__..' | ${SED} -e s'/.*__file__ //' >> ../inst_files ${GREP} -E '__file__..' | ${SED} -e s'/.*__file__ //' >> ../inst_files
${Q} echo ${LIBDIR}/libcalc.a >> inst_files ${Q} echo ${LIBDIR}/libcalc.a >> inst_files
${Q} for i in ${LIB_H_SRC} ${BUILD_H_SRC} /dev/null; do \ ${Q} for i in ${LIB_H_SRC} ${BUILD_H_SRC} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \ if [ X"$$i" != X"/dev/null" ]; then \
@@ -5157,7 +5367,7 @@ olduninstall:
tags: ${CALCSRC} ${LIBSRC} ${H_SRC} ${BUILD_H_SRC} ${MAKE_FILE} tags: ${CALCSRC} ${LIBSRC} ${H_SRC} ${BUILD_H_SRC} ${MAKE_FILE}
-${CTAGS} ${CALCSRC} ${LIBSRC} ${H_SRC} ${BUILD_H_SRC} 2>&1 | \ -${CTAGS} ${CALCSRC} ${LIBSRC} ${H_SRC} ${BUILD_H_SRC} 2>&1 | \
${GREP} -v 'Duplicate entry|Second entry ignored' ${GREP} -E -v 'Duplicate entry|Second entry ignored'
clean: clean:
${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='

View File

@@ -25,16 +25,16 @@
# For example, a AddressSanitizer. You do NOT want to do this by # For example, a AddressSanitizer. You do NOT want to do this by
# by default! Do this only if you are debugging with libasan: # by default! Do this only if you are debugging with libasan:
# #
# For Linux gcc version 4.8.5 with libasan-4.8.5-4 you might try: # For Linux gcc version 11.3.1 with libasan-11.3.1-2.1 you might try:
# #
# CDEBUG:= -O0 -g # DEBUG:= -O0 -g
# CFLAGS+= -fsanitize=address -fno-omit-frame-pointer # CFLAGS+= -fsanitize=address -fno-omit-frame-pointer
# LDFLAGS+= -fsanitize=address -fno-omit-frame-pointer # LDFLAGS+= -fsanitize=address -fno-omit-frame-pointer
# CALC_ENV+= ASAN_OPTIONS=detect_stack_use_after_return=1 # CALC_ENV+= ASAN_OPTIONS=detect_stack_use_after_return=1
# #
# For macOS 12.1 with clang version 13.0.0 (clang-1300.0.29.30) you might try: # For macOS 13.2.1 with clang version 14.0.0 (clang-1400.0.29.202) you might try:
# #
# CDEBUG:= -O0 -g # DEBUG:= -O0 -g
# CFLAGS+= -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined # CFLAGS+= -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined
# LDFLAGS+= -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined # LDFLAGS+= -fsanitize=address -fno-omit-frame-pointer -fsanitize=undefined
# CALC_ENV+= ASAN_OPTIONS=detect_stack_use_after_return=1 # CALC_ENV+= ASAN_OPTIONS=detect_stack_use_after_return=1

View File

@@ -446,6 +446,62 @@ HAVE_MEMMOVE=
HAVE_USTAT= HAVE_USTAT=
#HAVE_USTAT= -DHAVE_NO_USTAT #HAVE_USTAT= -DHAVE_NO_USTAT
# Determine if we have statfs()
#
# If HAVE_STATFS is empty, this Makefile will run the have_statfs program
# to determine if statfs() is supported. If HAVE_STATFS is set to
# -DHAVE_NO_STATFS, then calc will use internal functions to simulate
# the statfs() function that gets file system statistics.
#
# Select HAVE_STATFS= -DHAVE_NO_STATFS for DJGPP.
#
# If in doubt, leave HAVE_STATFS empty and this Makefile will figure it out.
#
HAVE_STATFS=
#HAVE_STATFS= -DHAVE_NO_STATFS
# Determine if we have the <sys/vfs.h> include file.
#
# HAVE_SYS_VFS_H= let the Makefile look for the include file
# HAVE_SYS_VFS_H= YES assume that the include file exists
# HAVE_SYS_VFS_H= NO assume that the include file does not exist
#
# Select HAVE_SYS_VFS_H= NO for DJGPP.
#
# When in doubt, leave HAVE_SYS_VFS_H empty.
#
HAVE_SYS_VFS_H=
#HAVE_SYS_VFS_H= YES
#HAVE_SYS_VFS_H= NO
# Determine if we have the <sys/param.h> include file.
#
# HAVE_SYS_PARAM_H= let the Makefile look for the include file
# HAVE_SYS_PARAM_H= YES assume that the include file exists
# HAVE_SYS_PARAM_H= NO assume that the include file does not exist
#
# Select HAVE_SYS_PARAM_H= NO for DJGPP.
#
# When in doubt, leave HAVE_SYS_PARAM_H empty.
#
HAVE_SYS_PARAM_H=
#HAVE_SYS_PARAM_H= YES
#HAVE_SYS_PARAM_H= NO
# Determine if we have the <sys/mount.h> include file.
#
# HAVE_SYS_MOUNT_H= let the Makefile look for the include file
# HAVE_SYS_MOUNT_H= YES assume that the include file exists
# HAVE_SYS_MOUNT_H= NO assume that the include file does not exist
#
# Select HAVE_SYS_MOUNT_H= NO for DJGPP.
#
# When in doubt, leave HAVE_SYS_MOUNT_H empty.
#
HAVE_SYS_MOUNT_H=
#HAVE_SYS_MOUNT_H= YES
#HAVE_SYS_MOUNT_H= NO
# Determine if we have getsid() # Determine if we have getsid()
# #
# If HAVE_GETSID is empty, this Makefile will run the have_getsid program # If HAVE_GETSID is empty, this Makefile will run the have_getsid program
@@ -1190,7 +1246,7 @@ CTAGS= ctags
DATE= date DATE= date
DIFF= diff DIFF= diff
FMT= fmt FMT= fmt
GREP= egrep GREP= grep
HOSTNAME= hostname HOSTNAME= hostname
LANG= C LANG= C
LDCONFIG= ldconfig LDCONFIG= ldconfig
@@ -1509,7 +1565,8 @@ BUILD_H_SRC= align32.h args.h calcerr.h conf.h endian_calc.h \
have_string.h have_strlcat.h have_strlcpy.h have_times.h \ have_string.h have_strlcat.h have_strlcpy.h have_times.h \
have_uid_t.h have_unistd.h have_unused.h have_urandom.h \ have_uid_t.h have_unistd.h have_unused.h have_urandom.h \
have_ustat.h longbits.h terminal.h have_environ.h \ have_ustat.h longbits.h terminal.h have_environ.h \
have_arc4random.h have_limits.h charbit.h have_arc4random.h have_limits.h charbit.h have_sys_vfs.h \
have_sys_param.h have_sys_mount.h have_statfs.h
# we build these .c files during the make # we build these .c files during the make
# #
@@ -1525,7 +1582,7 @@ UTIL_C_SRC= align32.c endian.c longbits.c have_newstr.c have_uid_t.c \
have_ustat.c have_getsid.c have_getpgid.c have_environ.c \ have_ustat.c have_getsid.c have_getpgid.c have_environ.c \
have_gettime.c have_getprid.c have_rusage.c have_strdup.c \ have_gettime.c have_getprid.c have_rusage.c have_strdup.c \
have_unused.c have_ban_pragma.c have_strlcpy.c have_strlcat.c \ have_unused.c have_ban_pragma.c have_strlcpy.c have_strlcat.c \
have_arc4random.c charbit.c have_arc4random.c charbit.c have_statfs.c
# these awk and sed tools are used in the process of building BUILD_H_SRC # these awk and sed tools are used in the process of building BUILD_H_SRC
# and BUILD_C_SRC # and BUILD_C_SRC
@@ -1543,7 +1600,7 @@ UTIL_OBJS= endian.o longbits.o have_newstr.o have_uid_t.o \
have_ustat.o have_getsid.o have_getpgid.o have_environ.o \ have_ustat.o have_getsid.o have_getpgid.o have_environ.o \
have_gettime.o have_getprid.o ver_calc.o have_rusage.o have_strdup.o \ have_gettime.o have_getprid.o ver_calc.o have_rusage.o have_strdup.o \
have_unused.o have_ban_pragma.o have_strlcpy.o have_strlcat.o \ have_unused.o have_ban_pragma.o have_strlcpy.o have_strlcat.o \
have_arc4random.o charbit.o have_arc4random.o charbit.o have_statfs.o
# these temp files may be created (and removed) during the build of BUILD_C_SRC # these temp files may be created (and removed) during the build of BUILD_C_SRC
# #
@@ -1562,7 +1619,7 @@ UTIL_PROGS= align32${EXT} fposval${EXT} have_uid_t${EXT} have_const${EXT} \
have_unused${EXT} have_fpos${EXT} have_fpos_pos${EXT} \ have_unused${EXT} have_fpos${EXT} have_fpos_pos${EXT} \
have_offscl${EXT} have_rusage${EXT} have_ban_pragma${EXT} \ have_offscl${EXT} have_rusage${EXT} have_ban_pragma${EXT} \
have_strlcpy${EXT} have_strlcat${EXT} have_arc4random${EXT} \ have_strlcpy${EXT} have_strlcat${EXT} have_arc4random${EXT} \
charbit${EXT} charbit${EXT} have_statfs${ENT}
# these utility files and scripts may be created in the process of building # these utility files and scripts may be created in the process of building
# the BUILD_H_SRC file set # the BUILD_H_SRC file set
@@ -2024,7 +2081,7 @@ calc.usage: calc.1 ${MAKE_FILE} ${LOC_MKF}
LESSCHARSET=iso8859 ${CALCPAGER} calc.1; \ LESSCHARSET=iso8859 ${CALCPAGER} calc.1; \
else \ else \
${NROFF} -man calc.1; \ ${NROFF} -man calc.1; \
fi 2>&1 | ${GREP} -v 'cannot adjust line' | ${COL} -b > $@ fi 2>&1 | ${GREP} -E -v 'cannot adjust line' | ${COL} -b > $@
${Q} echo calc.usage formed ${Q} echo calc.usage formed
@@ -2087,7 +2144,7 @@ conf.h: ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f $@ ${Q} ${RM} -f $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2138,7 +2195,7 @@ endian_calc.h: endian.c have_stdlib.h have_unistd.h \
${Q} ${RM} -f endian.o endian${EXT} $@ ${Q} ${RM} -f endian.o endian${EXT} $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2190,7 +2247,7 @@ charbit.h: charbit.c have_limits.h \
${Q} ${RM} -f charbit.o charbit${EXT} $@ ${Q} ${RM} -f charbit.o charbit${EXT} $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2226,7 +2283,7 @@ longbits.h: longbits.c charbit.h have_unistd.h have_stdlib.h \
${Q} ${RM} -f longbits.o longbits${EXT} $@ ${Q} ${RM} -f longbits.o longbits${EXT} $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2256,7 +2313,7 @@ have_times.h: ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f $@ ${Q} ${RM} -f $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2322,7 +2379,7 @@ have_stdlib.h: ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f $@ ${Q} ${RM} -f $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2358,7 +2415,7 @@ have_unistd.h: ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f $@ ${Q} ${RM} -f $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2394,7 +2451,7 @@ have_limits.h: ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f $@ ${Q} ${RM} -f $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2430,7 +2487,7 @@ have_string.h: ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f $@ ${Q} ${RM} -f $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2466,7 +2523,7 @@ terminal.h: ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f $@ ${Q} ${RM} -f $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2520,7 +2577,7 @@ have_fgetsetpos.h: have_fgetsetpos.c banned.h have_ban_pragma.h ${MAKE_FILE} ${L
${Q} ${RM} -f fpos_tmp $@ ${Q} ${RM} -f fpos_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2563,7 +2620,7 @@ have_fpos_pos.h: have_fpos_pos.c have_fgetsetpos.h have_posscl.h have_string.h \
${Q} ${RM} -f fpos_tmp $@ ${Q} ${RM} -f fpos_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2609,7 +2666,7 @@ fposval.h: fposval.c have_fgetsetpos.h have_fpos_pos.h have_offscl.h have_posscl
${Q} ${RM} -f fposval_tmp $@ ${Q} ${RM} -f fposval_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2651,7 +2708,7 @@ have_const.h: have_const.c banned.h have_ban_pragma.h ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f have_const const_tmp $@ ${Q} ${RM} -f have_const const_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2694,7 +2751,7 @@ have_offscl.h: have_offscl.c have_unistd.h \
${Q} ${RM} -f offscl_tmp $@ ${Q} ${RM} -f offscl_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2735,7 +2792,7 @@ have_posscl.h: have_posscl.c have_fgetsetpos.h have_unistd.h \
${Q} ${RM} -f have_posscl have_posscl.o posscl_tmp $@ ${Q} ${RM} -f have_posscl have_posscl.o posscl_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2776,7 +2833,7 @@ align32.h: align32.c longbits.h have_unistd.h \
${Q} ${RM} -f align32 align32_tmp $@ ${Q} ${RM} -f align32 align32_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2831,7 +2888,7 @@ have_uid_t.h: have_uid_t.c have_unistd.h \
${Q} ${RM} -f have_uid_t uid_tmp $@ ${Q} ${RM} -f have_uid_t uid_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2872,7 +2929,7 @@ have_environ.h: have_environ.c \
${Q} ${RM} -f have_environ environ_tmp $@ ${Q} ${RM} -f have_environ environ_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2913,7 +2970,7 @@ have_arc4random.h: have_arc4random.c have_stdlib.h \
${Q} ${RM} -f have_arc4random arc4random_tmp $@ ${Q} ${RM} -f have_arc4random arc4random_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2954,7 +3011,7 @@ have_newstr.h: have_newstr.c banned.h have_ban_pragma.h have_string.h ${MAKE_FIL
${Q} ${RM} -f newstr_tmp $@ ${Q} ${RM} -f newstr_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -2994,7 +3051,7 @@ have_memmv.h: have_memmv.c banned.h have_ban_pragma.h have_string.h ${MAKE_FILE}
${Q} ${RM} -f have_memmv have_memmv.o memmv_tmp $@ ${Q} ${RM} -f have_memmv have_memmv.o memmv_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3034,7 +3091,7 @@ have_ustat.h: have_ustat.c banned.h have_ban_pragma.h ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f ustat_tmp $@ ${Q} ${RM} -f ustat_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3069,12 +3126,161 @@ have_ustat.h: have_ustat.c banned.h have_ban_pragma.h ${MAKE_FILE} ${LOC_MKF}
${TRUE}; \ ${TRUE}; \
fi fi
have_statfs.h: have_statfs.c banned.h have_ban_pragma.h have_sys_vfs.h have_sys_param.h \
have_sys_mount.h ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f statfs_tmp $@
${H} echo 'forming $@'
${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '#if !defined(CALC_HAVE_STATFS_H)' >> $@
${Q} echo '#define CALC_HAVE_STATFS_H' >> $@
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '/* do we have or want statfs()? */' >> $@
${Q} ${RM} -f have_statfs.o have_statfs${EXT}
-${Q} ${LCC} ${ICFLAGS} ${HAVE_STATFS} have_statfs.c -c ${S} \
|| ${TRUE}
-${Q} ${LCC} ${ILDFLAGS} have_statfs.o -o have_statfs ${S} \
|| ${TRUE}
-${Q} ./have_statfs${EXT} > statfs_tmp ${E} \
|| ${TRUE}
-${Q} if [ -s statfs_tmp ]; then \
${CAT} statfs_tmp >> $@; \
else \
echo '#undef HAVE_STATFS /* no */' >> $@; \
fi
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '#endif /* !CALC_HAVE_STATFS_H */' >> $@
${Q} ${RM} -f have_statfs${EXT} have_statfs.o statfs_tmp
${H} echo '$@ formed'
-@if [ -z "${Q}" ]; then \
echo ''; \
echo '=-=-= start of $@ =-=-='; \
${CAT} $@; \
echo '=-=-= end of $@ =-=-='; \
echo ''; \
else \
${TRUE}; \
fi
have_sys_vfs.h: ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f $@
${H} echo 'forming $@'
${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '#if !defined(CALC_HAVE_SYS_VFS_H)' >> $@
${Q} echo '#define CALC_HAVE_SYS_VFS_H' >> $@
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '/* do we have <sys/vfs.h>? */' >> $@
-${Q} if [ X"${HAVE_SYS_VFS_H}" = X"YES" ]; then \
echo '#define HAVE_SYS_VFS_H /* yes */' >> $@; \
elif [ X"${HAVE_SYS_VFS_H}" = X"NO" ]; then \
echo '#undef HAVE_SYS_VFS_H /* no */' >> $@; \
elif echo '#include <sys/vfs.h>' | ${CC} -E - ${S}; then \
echo '#define HAVE_SYS_VFS_H /* yes */' >> $@; \
else \
echo '#undef HAVE_SYS_VFS_H /* no */' >> $@; \
fi
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '#endif /* !CALC_HAVE_SYS_VFS_H */' >> $@
${H} echo '$@ formed'
-@if [ -z "${Q}" ]; then \
echo ''; \
echo '=-=-= start of $@ =-=-='; \
${CAT} $@; \
echo '=-=-= end of $@ =-=-='; \
echo ''; \
else \
${TRUE}; \
fi
have_sys_param.h: ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f $@
${H} echo 'forming $@'
${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '#if !defined(CALC_HAVE_SYS_PARAM_H)' >> $@
${Q} echo '#define CALC_HAVE_SYS_PARAM_H' >> $@
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '/* do we have <sys/param.h>? */' >> $@
-${Q} if [ X"${HAVE_SYS_PARAM_H}" = X"YES" ]; then \
echo '#define HAVE_SYS_PARAM_H /* yes */' >> $@; \
elif [ X"${HAVE_SYS_PARAM_H}" = X"NO" ]; then \
echo '#undef HAVE_SYS_PARAM_H /* no */' >> $@; \
elif echo '#include <sys/param.h>' | ${CC} -E - ${S}; then \
echo '#define HAVE_SYS_PARAM_H /* yes */' >> $@; \
else \
echo '#undef HAVE_SYS_PARAM_H /* no */' >> $@; \
fi
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '#endif /* !CALC_HAVE_SYS_PARAM_H */' >> $@
${H} echo '$@ formed'
-@if [ -z "${Q}" ]; then \
echo ''; \
echo '=-=-= start of $@ =-=-='; \
${CAT} $@; \
echo '=-=-= end of $@ =-=-='; \
echo ''; \
else \
${TRUE}; \
fi
have_sys_mount.h: ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f $@
${H} echo 'forming $@'
${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '#if !defined(CALC_HAVE_SYS_MOUNT_H)' >> $@
${Q} echo '#define CALC_HAVE_SYS_MOUNT_H' >> $@
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '/* do we have <sys/param.h>? */' >> $@
-${Q} if [ X"${HAVE_SYS_MOUNT_H}" = X"YES" ]; then \
echo '#define HAVE_SYS_MOUNT_H /* yes */' >> $@; \
elif [ X"${HAVE_SYS_MOUNT_H}" = X"NO" ]; then \
echo '#undef HAVE_SYS_MOUNT_H /* no */' >> $@; \
elif echo '#include <sys/param.h>' | ${CC} -E - ${S}; then \
echo '#define HAVE_SYS_MOUNT_H /* yes */' >> $@; \
else \
echo '#undef HAVE_SYS_MOUNT_H /* no */' >> $@; \
fi
${Q} echo '' >> $@
${Q} echo '' >> $@
${Q} echo '#endif /* !CALC_HAVE_SYS_MOUNT_H */' >> $@
${H} echo '$@ formed'
-@if [ -z "${Q}" ]; then \
echo ''; \
echo '=-=-= start of $@ =-=-='; \
${CAT} $@; \
echo '=-=-= end of $@ =-=-='; \
echo ''; \
else \
${TRUE}; \
fi
have_getsid.h: have_getsid.c have_unistd.h \ have_getsid.h: have_getsid.c have_unistd.h \
banned.h have_ban_pragma.h ${MAKE_FILE} ${LOC_MKF} banned.h have_ban_pragma.h ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f getsid_tmp $@ ${Q} ${RM} -f getsid_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3115,7 +3321,7 @@ have_getpgid.h: have_getpgid.c have_unistd.h \
${Q} ${RM} -f getpgid_tmp $@ ${Q} ${RM} -f getpgid_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3156,7 +3362,7 @@ have_gettime.h: have_gettime.c banned.h have_ban_pragma.h \
${Q} ${RM} -f gettime_tmp $@ ${Q} ${RM} -f gettime_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3197,7 +3403,7 @@ have_getprid.h: have_getprid.c have_unistd.h \
${Q} ${RM} -f getprid_tmp $@ ${Q} ${RM} -f getprid_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3237,7 +3443,7 @@ have_urandom.h: ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f $@ ${Q} ${RM} -f $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3273,7 +3479,7 @@ have_rusage.h: have_rusage.c banned.h have_ban_pragma.h ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f rusage_tmp $@ ${Q} ${RM} -f rusage_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3313,7 +3519,7 @@ have_strdup.h: have_strdup.c banned.h have_ban_pragma.h have_string.h ${MAKE_FIL
${Q} ${RM} -f strdup_tmp $@ ${Q} ${RM} -f strdup_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3354,7 +3560,7 @@ args.h: have_stdvs.c have_varvs.c have_string.h have_unistd.h \
${Q} ${RM} -f $@ ${Q} ${RM} -f $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3467,7 +3673,7 @@ have_unused.h: have_unused.c have_stdlib.h have_ban_pragma.h \
${Q} ${RM} -f unused_tmp $@ ${Q} ${RM} -f unused_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3509,7 +3715,7 @@ have_ban_pragma.h: have_ban_pragma.c banned.h ${MAKE_FILE} ${LOC_MKF}
${Q} ${RM} -f unused_tmp $@ ${Q} ${RM} -f unused_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3552,7 +3758,7 @@ have_strlcpy.h: have_strlcpy.c banned.h have_ban_pragma.h have_string.h \
${Q} ${RM} -f unused_tmp $@ ${Q} ${RM} -f unused_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3594,7 +3800,7 @@ have_strlcat.h: have_strlcat.c banned.h have_ban_pragma.h have_string.h \
${Q} ${RM} -f unused_tmp $@ ${Q} ${RM} -f unused_tmp $@
${H} echo 'forming $@' ${H} echo 'forming $@'
${Q} echo '/*' > $@ ${Q} echo '/*' > $@
${Q} echo ' * DO NOT EDIT -- generated by the Makefile' >> $@ ${Q} echo ' * DO NOT EDIT -- generated by the Makefile rule $@' >> $@
${Q} echo ' */' >> $@ ${Q} echo ' */' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
${Q} echo '' >> $@ ${Q} echo '' >> $@
@@ -3790,7 +3996,7 @@ depend: hsrc custom/Makefile
${Q} ${MKDIR} -p skel ${Q} ${MKDIR} -p skel
-${Q} for i in ${C_SRC} ${BUILD_C_SRC}; do \ -${Q} for i in ${C_SRC} ${BUILD_C_SRC}; do \
${SED} -n '/^#[ ]*include[ ]*"/p' "$$i" | \ ${SED} -n '/^#[ ]*include[ ]*"/p' "$$i" | \
${GREP} -v '\.\./getopt/getopt\.h' > "skel/$$i"; \ ${GREP} -E -v '\.\./getopt/getopt\.h' > "skel/$$i"; \
done done
${Q} ${MKDIR} -p skel/custom ${Q} ${MKDIR} -p skel/custom
-${Q} for i in ${H_SRC} ${BUILD_H_SRC} custom.h /dev/null; do \ -${Q} for i in ${H_SRC} ${BUILD_H_SRC} custom.h /dev/null; do \
@@ -3834,7 +4040,7 @@ depend: hsrc custom/Makefile
${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak ${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak
${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' \ ${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' \
${MAKE_FILE}.bak > ${MAKE_FILE} ${MAKE_FILE}.bak > ${MAKE_FILE}
${Q} ${GREP} -v '^#' skel/makedep.out >> ${MAKE_FILE} ${Q} ${GREP} -E -v '^#' skel/makedep.out >> ${MAKE_FILE}
${Q} echo removing top level skel ${Q} echo removing top level skel
${Q} ${RM} -rf skel ${Q} ${RM} -rf skel
-${Q} if ${CMP} -s ${MAKE_FILE}.bak ${MAKE_FILE}; then \ -${Q} if ${CMP} -s ${MAKE_FILE}.bak ${MAKE_FILE}; then \
@@ -4152,13 +4358,17 @@ env:
@echo 'HAVE_OFFSCL=${HAVE_OFFSCL}'; echo '' @echo 'HAVE_OFFSCL=${HAVE_OFFSCL}'; echo ''
@echo 'HAVE_POSSCL=${HAVE_POSSCL}'; echo '' @echo 'HAVE_POSSCL=${HAVE_POSSCL}'; echo ''
@echo 'HAVE_PRAGMA_GCC_POSION=${HAVE_PRAGMA_GCC_POSION}'; echo '' @echo 'HAVE_PRAGMA_GCC_POSION=${HAVE_PRAGMA_GCC_POSION}'; echo ''
@echo 'HAVE_STATFS=${HAVE_STATFS}'; echo ''
@echo 'HAVE_STDLIB_H=${HAVE_STDLIB_H}'; echo '' @echo 'HAVE_STDLIB_H=${HAVE_STDLIB_H}'; echo ''
@echo 'HAVE_STRDUP=${HAVE_STRDUP}'; echo '' @echo 'HAVE_STRDUP=${HAVE_STRDUP}'; echo ''
@echo 'HAVE_STRING_H=${HAVE_STRING_H}'; echo '' @echo 'HAVE_STRING_H=${HAVE_STRING_H}'; echo ''
@echo 'HAVE_STRLCAT=${HAVE_STRLCAT}'; echo '' @echo 'HAVE_STRLCAT=${HAVE_STRLCAT}'; echo ''
@echo 'HAVE_STRLCPY=${HAVE_STRLCPY}'; echo '' @echo 'HAVE_STRLCPY=${HAVE_STRLCPY}'; echo ''
@echo 'HAVE_SYS_MOUNT_H=${HAVE_SYS_MOUNT_H}'; echo ''
@echo 'HAVE_SYS_PARAM_H=${HAVE_SYS_PARAM_H}'; echo ''
@echo 'HAVE_SYS_TIMES_H=${HAVE_SYS_TIMES_H}'; echo '' @echo 'HAVE_SYS_TIMES_H=${HAVE_SYS_TIMES_H}'; echo ''
@echo 'HAVE_SYS_TIME_H=${HAVE_SYS_TIME_H}'; echo '' @echo 'HAVE_SYS_TIME_H=${HAVE_SYS_TIME_H}'; echo ''
@echo 'HAVE_SYS_VFS_H=${HAVE_SYS_VFS_H}'; echo ''
@echo 'HAVE_TIMES_H=${HAVE_TIMES_H}'; echo '' @echo 'HAVE_TIMES_H=${HAVE_TIMES_H}'; echo ''
@echo 'HAVE_TIME_H=${HAVE_TIME_H}'; echo '' @echo 'HAVE_TIME_H=${HAVE_TIME_H}'; echo ''
@echo 'HAVE_UID_T=${HAVE_UID_T}'; echo '' @echo 'HAVE_UID_T=${HAVE_UID_T}'; echo ''
@@ -4198,18 +4408,18 @@ env:
@echo 'MANEXT=${MANEXT}'; echo '' @echo 'MANEXT=${MANEXT}'; echo ''
@echo 'MANMAKE=${MANMAKE}'; echo '' @echo 'MANMAKE=${MANMAKE}'; echo ''
@echo 'MANMODE=${MANMODE}'; echo '' @echo 'MANMODE=${MANMODE}'; echo ''
@echo 'MKDIR=${MKDIR}'; echo ''
@echo 'MINGW=${MINGW}'; echo '' @echo 'MINGW=${MINGW}'; echo ''
@echo 'MKDIR=${MKDIR}'; echo ''
@echo 'MV=${MV}'; echo '' @echo 'MV=${MV}'; echo ''
@echo 'NROFF=${NROFF}'; echo '' @echo 'NROFF=${NROFF}'; echo ''
@echo 'NROFF_ARG=${NROFF_ARG}'; echo '' @echo 'NROFF_ARG=${NROFF_ARG}'; echo ''
@echo 'OBJS=${OBJS}'; echo '' @echo 'OBJS=${OBJS}'; echo ''
@echo 'OFF_T_BITS=${OFF_T_BITS}'; echo '' @echo 'OFF_T_BITS=${OFF_T_BITS}'; echo ''
@echo 'PREFIX=${PREFIX}'; echo ''
@echo 'PURIFY=${PURIFY}'; echo '' @echo 'PURIFY=${PURIFY}'; echo ''
@echo 'PWD=${PWD}'; echo '' @echo 'PWD=${PWD}'; echo ''
@echo 'PWDCMD=${PWDCMD}'; echo '' @echo 'PWDCMD=${PWDCMD}'; echo ''
@echo 'Q=${Q}'; echo '' @echo 'Q=${Q}'; echo ''
@echo 'PREFIX=${PREFIX}'; echo ''
@echo 'RANLIB=${RANLIB}'; echo '' @echo 'RANLIB=${RANLIB}'; echo ''
@echo 'READLINE_EXTRAS=${READLINE_EXTRAS}'; echo '' @echo 'READLINE_EXTRAS=${READLINE_EXTRAS}'; echo ''
@echo 'READLINE_INCLUDE=${READLINE_INCLUDE}'; echo '' @echo 'READLINE_INCLUDE=${READLINE_INCLUDE}'; echo ''
@@ -4400,16 +4610,16 @@ inst_files: ${MAKE_FILE} ${LOC_MKF} help/Makefile cal/Makefile \
${Q} echo ${BINDIR}/calc${EXT} > inst_files ${Q} echo ${BINDIR}/calc${EXT} > inst_files
${Q} cd help; LANG=C \ ${Q} cd help; LANG=C \
${MAKE} -f Makefile ${HELP_PASSDOWN} echo_inst_files | \ ${MAKE} -f Makefile ${HELP_PASSDOWN} echo_inst_files | \
${GREP} '__file__..' | ${SED} -e s'/.*__file__ //' >> ../inst_files ${GREP} -E '__file__..' | ${SED} -e s'/.*__file__ //' >> ../inst_files
${Q} cd cal; LANG=C \ ${Q} cd cal; LANG=C \
${MAKE} -f Makefile ${CAL_PASSDOWN} echo_inst_files | \ ${MAKE} -f Makefile ${CAL_PASSDOWN} echo_inst_files | \
${GREP} '__file__..' | ${SED} -e s'/.*__file__ //' >> ../inst_files ${GREP} -E '__file__..' | ${SED} -e s'/.*__file__ //' >> ../inst_files
${Q} cd custom; LANG=C \ ${Q} cd custom; LANG=C \
${MAKE} -f Makefile ${CUSTOM_PASSDOWN} echo_inst_files | \ ${MAKE} -f Makefile ${CUSTOM_PASSDOWN} echo_inst_files | \
${GREP} '__file__..' | ${SED} -e s'/.*__file__ //' >> ../inst_files ${GREP} -E '__file__..' | ${SED} -e s'/.*__file__ //' >> ../inst_files
${Q} cd cscript; LANG=C \ ${Q} cd cscript; LANG=C \
${MAKE} -f Makefile ${CSCRIPT_PASSDOWN} echo_inst_files | \ ${MAKE} -f Makefile ${CSCRIPT_PASSDOWN} echo_inst_files | \
${GREP} '__file__..' | ${SED} -e s'/.*__file__ //' >> ../inst_files ${GREP} -E '__file__..' | ${SED} -e s'/.*__file__ //' >> ../inst_files
${Q} echo ${LIBDIR}/libcalc.a >> inst_files ${Q} echo ${LIBDIR}/libcalc.a >> inst_files
${Q} for i in ${LIB_H_SRC} ${BUILD_H_SRC} /dev/null; do \ ${Q} for i in ${LIB_H_SRC} ${BUILD_H_SRC} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \ if [ X"$$i" != X"/dev/null" ]; then \
@@ -4461,7 +4671,7 @@ olduninstall:
tags: ${CALCSRC} ${LIBSRC} ${H_SRC} ${BUILD_H_SRC} ${MAKE_FILE} tags: ${CALCSRC} ${LIBSRC} ${H_SRC} ${BUILD_H_SRC} ${MAKE_FILE}
-${CTAGS} ${CALCSRC} ${LIBSRC} ${H_SRC} ${BUILD_H_SRC} 2>&1 | \ -${CTAGS} ${CALCSRC} ${LIBSRC} ${H_SRC} ${BUILD_H_SRC} 2>&1 | \
${GREP} -v 'Duplicate entry|Second entry ignored' ${GREP} -E -v 'Duplicate entry|Second entry ignored'
clean: clean:
${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= ${MAKE_FILE} start of $@ rule =-=-=-=-='

View File

@@ -1,37 +1,28 @@
If you have a simple general question about calc, send Email to: If you have a general question about calc, consider opening
a new Github discussion under:
calc-quest-mail at asthe dot com https://github.com/lcn2/calc/discussions
NOTE: Remove spaces and replace 'at' with @, and 'dot' with . Look over the existing discussions to see of your question fits
under one of those exiting discussions.
PLEASE put following the SPECIAL PHRASE somewhere in your Email Subject line: You may wish to add your question as a comment to an existing discussion.
Otherwise click on:
calc question ((New discussion))
You may add additional words to your subject line. and ask your question in that new discussion.
IMPORTANT: If your Email doesn't contain the above phrase,
then we WILL NOT SEE your Email.
PLEASE BE SURE you have that SPECIAL PHRASE somewhere in the subject line!
Suggestion:
From time to time, the Email address and Subject SPECIAL PHRASE
may change so verify you have the current info by visiting:
http://www.isthe.com/chongo/tech/comp/calc/calc-question.html
Please limit your questions to general questions about calc. We Please limit your questions to general questions about calc. We
cannot go into great detail in our answers, nor can we do your cannot go into great detail in our answers, nor can we do your
homework, nor can we do much more than answer short general questions homework, nor can we do much more than answer general questions
about calc. about calc.
Please be patient as we cannot always respond to Email messages quickly. Please be patient as we cannot always respond to discussion messages quickly.
=-= =-=
## Copyright (C) 2021 Landon Curt Noll ## Copyright (C) 2021,2023 Landon Curt Noll
## ##
## Calc is open software; you can redistribute it and/or modify it under ## Calc is open software; you can redistribute it and/or modify it under
## the terms of the version 2.1 of the GNU Lesser General Public License ## the terms of the version 2.1 of the GNU Lesser General Public License

View File

@@ -4,19 +4,37 @@
* This file was created by Ernest Bowen <ebowen at une dot edu dot au> * This file was created by Ernest Bowen <ebowen at une dot edu dot au>
* and modified by Landon Curt Noll. * and modified by Landon Curt Noll.
* *
* This dotest_code has been placed in the public domain. Please do not
* copyright this dotest_code.
*
* ERNEST BOWEN AND LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MER-
* CHANTABILITY AND FITNESS. IN NO EVENT SHALL LANDON CURT
* NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* This file is not covered under version 2.1 of the GNU LGPL. * This file is not covered under version 2.1 of the GNU LGPL.
* This file is covered under "The unlicense":
*
* https://unlicense.org
*
* In particular:
*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
* software to the public domain. We make this dedication for the benefit
* of the public at large and to the detriment of our heirs and
* successors. We intend this dedication to be an overt act of
* relinquishment in perpetuity of all present and future rights to this
* software under copyright law.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* For more information, please refer to <http://unlicense.org/>
* *
* Under source dotest_code control: 2006/03/08 05:54:09 * Under source dotest_code control: 2006/03/08 05:54:09
* File existed as early as: 2006 * File existed as early as: 2006

View File

@@ -3,19 +3,37 @@
* *
* This file was created by Ernest Bowen <ebowen at une dot edu dot au>. * This file was created by Ernest Bowen <ebowen at une dot edu dot au>.
* *
* This code has been placed in the public domain. Please do not
* copyright this code.
*
* ERNEST BOWEN DISCLAIMS ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MER-
* CHANTABILITY AND FITNESS. IN NO EVENT SHALL LANDON CURT
* NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* This file is not covered under version 2.1 of the GNU LGPL. * This file is not covered under version 2.1 of the GNU LGPL.
* This file is covered under "The unlicense":
*
* https://unlicense.org
*
* In particular:
*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
* software to the public domain. We make this dedication for the benefit
* of the public at large and to the detriment of our heirs and
* successors. We intend this dedication to be an overt act of
* relinquishment in perpetuity of all present and future rights to this
* software under copyright law.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* For more information, please refer to <http://unlicense.org/>
* *
* Under source code control: 2006/03/08 05:54:09 * Under source code control: 2006/03/08 05:54:09
* File existed as early as: 2006 * File existed as early as: 2006

15
calc.c
View File

@@ -108,8 +108,6 @@ main(int argc, char **argv)
int c; /* option */ int c; /* option */
int index; int index;
int maxindex; int maxindex;
/* fix gcc warning bug */
int unusedint = 0;
char *cp; char *cp;
char *endcp; char *endcp;
char *bp; char *bp;
@@ -289,9 +287,7 @@ main(int argc, char **argv)
exit(6); exit(6);
} }
calc_debug = cp; calc_debug = cp;
/* fix gcc warning bug */ (void) strtol(cp, &endcp, 10);
unusedint =
strtol(cp, &endcp, 10);
cp = endcp; cp = endcp;
if (*cp != '\0' && if (*cp != '\0' &&
*cp != ' ' && *cp != ':') { *cp != ' ' && *cp != ':') {
@@ -323,9 +319,7 @@ main(int argc, char **argv)
exit(9); exit(9);
} }
resource_debug = cp; resource_debug = cp;
/* fix gcc warning bug */ (void) strtol(cp, &endcp, 10);
unusedint =
strtol(cp, &endcp, 10);
cp = endcp; cp = endcp;
if (*cp != '\0' && if (*cp != '\0' &&
*cp != ' ' && *cp != ':') { *cp != ' ' && *cp != ':') {
@@ -355,8 +349,7 @@ main(int argc, char **argv)
exit(12); exit(12);
} }
user_debug = cp; user_debug = cp;
/* unusedint avoids gcc warning bug */ (void) strtol(cp, &endcp, 10);
unusedint = strtol(cp, &endcp, 10);
cp = endcp; cp = endcp;
if (*cp != '\0' && *cp != ' ') { if (*cp != '\0' && *cp != ' ') {
fprintf(stderr, "Bad syntax in" fprintf(stderr, "Bad syntax in"
@@ -765,8 +758,6 @@ main(int argc, char **argv)
/* /*
* All done! - Jessica Noll, Age 2 * All done! - Jessica Noll, Age 2
*/ */
/* fix gcc warning bug */
unusedint++;
libcalc_call_me_last(); libcalc_call_me_last();
return (run_state == RUN_EXIT_WITH_ERROR || return (run_state == RUN_EXIT_WITH_ERROR ||
run_state == RUN_ZERO) ? 1 : 0; run_state == RUN_ZERO) ? 1 : 0;

260
calc.man
View File

@@ -1225,6 +1225,7 @@ The calc commands:
help copyright help copyright
help copying help copying
help copying-lgpl help copying-lgpl
help credit
.fi .fi
.in -0.5i .in -0.5i
.sp .sp
@@ -1259,6 +1260,10 @@ Copyright (C) year David I. Bell, Landon Curt Noll and Ernest Bowen
Copyright (C) year Landon Curt Noll Copyright (C) year Landon Curt Noll
Copyright (C) year Ernest Bowen and Landon Curt Noll Copyright (C) year Ernest Bowen and Landon Curt Noll
Copyright (C) year Ernest Bowen Copyright (C) year Ernest Bowen
Copyright (C) year Petteri Kettunen and Landon Curt Noll
Copyright (C) year Christoph Zurnieden
Copyright (C) year Landon Curt Noll and Thomas Jones-Low
Copyright (C) year Klaus Alexander Seistrup and Landon Curt Noll
.fi .fi
.in -0.5i .in -0.5i
.sp .sp
@@ -1266,12 +1271,22 @@ This man page is:
.sp .sp
.in +0.5i .in +0.5i
.nf .nf
Copyright (C) 1999-2021 Landon Curt Noll Copyright (C) 1999-2023 Landon Curt Noll
.fi .fi
.in -0.5i .in -0.5i
.sp .sp
and is covered under version 2.1 GNU Lesser General and is covered under version 2.1 GNU Lesser General
Public License. Public License.
.sp
A few files in calc are covered under "The Unlicense".
For more information on this license, see:
.sp
.in +0.5i
.nf
https://unlicense.org
.fi
.in -0.5i
.sp
.PP .PP
@@ -1279,61 +1294,27 @@ Public License.
.PP .PP
If you have a simple general question about calc, send Email to: To ask the calc maintainers a general question about calc,
.sp see the output of:
.in +0.5i
calc-quest-mail at asthe dot com
.sp
NOTE: Remove spaces and replace 'at' with @, and 'dot' with .
.in -0.5i
.sp
.in +0.5i
NOTE: Yes, the Email address uses 'asthe',
while the web site uses 'isthe'.
.in -0.5i
.sp
.B PLEASE
put following the
.B SPECIAL PHRASE
somewhere in your Email Subject line:
.sp
.in +0.5i
.B calc question
.in -0.5i
.sp
You may add additional words to your subject line.
.sp
.B IMPORTANT:
If your Email doesn't contain the above phrase,
then we
.B WILL NOT SEE
your Email.
.sp
.B PLEASE BE SURE
you have that
.B SPECIAL PHRASE
somewhere in the subject line!
.sp
.B Suggestion:
.sp
.in +0.5i
From time to time, the Email address and Subject
.B SPECIAL PHRASE
may change so verify you have the current info by visiting:
.sp .sp
.in +0.5i .in +0.5i
.nf .nf
http://www.isthe.com/chongo/tech/comp/calc/calc-question.html ; help question
.fi .fi
.in -0.5i .in +0.5i
.in -0.5i
.sp .sp
Please limit your questions to general questions about calc. .PP
We cannot go into great detail in our answers,
nor can we do your homework, nor can or read the source file:
we do much more than answer short general questions about calc.
.sp
.in +0.5i
.nf
QUESTIONS
.fi
.in +0.5i
.sp .sp
Please be patient as we cannot always respond to Email messages quickly.
.PP .PP
@@ -1341,71 +1322,27 @@ Please be patient as we cannot always respond to Email messages quickly.
.PP .PP
Send bug reports and bug fixes to: To inform the calc maintainers about a bug,
or to submit a bug fix, see the output of:
.sp .sp
.in +0.5i .in +0.5i
.nf .nf
calc-bugrept at asthe dot com ; help bugs
.fi .fi
.sp
NOTE: Remove spaces and replace 'at' with @, 'dot' with .
.sp
NOTE: Yes, the Email address uses 'asthe',
while the web site uses 'isthe'.
.in -0.5i
.sp
You
.B MUST
use following
.B SPECIAL PHRASE
in your Email Subject line:
.sp
.in +0.5i .in +0.5i
.B calc bug report
.in -0.5i
.sp .sp
You may add additional words to your subject line. .PP
.sp
.B Suggestion: or read the source file:
.sp
.in +0.5i
From time to time, the Email address and Subject
.B SPECIAL PHRASE
may change so verify you have the current info by visiting:
.sp .sp
.in +0.5i .in +0.5i
.nf .nf
http://www.isthe.com/chongo/tech/comp/calc/calc-bugrept.html BUGS
.fi .fi
.in -0.5i
.in -0.5i
.sp
.B IMPORTANT:
If your Email doesn't contain the above phrase,
then we
.B WILL NOT SEE
your Email.
.sp
.B PLEASE BE SURE
you have that
.B SPECIAL PHRASE
somewhere in the subject line!
.sp
See the
.I BUGS
source file or use the
.I calc
command:
.sp
.in +0.5i .in +0.5i
.nf
help bugs
.fi
.in -0.5i
.sp .sp
for more information about bug reporting.
.sp
Please be patient as we cannot always respond to Email messages quickly.
.PP .PP
@@ -1415,126 +1352,27 @@ Please be patient as we cannot always respond to Email messages quickly.
.I Calc .I Calc
is open source. is open source.
Contributions of code are welcome. You are welcome to contribute code to calc, or submit bug fixes to to calc.
.sp
We welcome and encourage you to send us:
.sp .sp
To contribute code to calc, please see see the output of:
.sp .sp
.in +0.5i .in +0.5i
.nf .nf
* calc resource files (cal/*.cal) ; help contrib
* calc shell scripts (cscript/*.calc)
* builtin functions that you have modified or written, i.e.:
assocfunc.c comfunc.c func.c func.h
listfunc.c matfunc.c qfunc.c zfunc.c
* custom functions that you have modified or written (custom/*)
* help files modified or written (help/*)
* brief description of you added, fixed, improved in CHANGES
* regression test cases (cal/regress.cal)
* Makefile improvements (Makefile, */Makefile)
* other source code modifications (*.c, *.h)
* etc. (* */* :) )
.fi .fi
.in -0.5i
.sp
If you add functionality to calc, please be sure to modify/patch/add
Makefiles, help files, cal/regress.cal test code as well.
Regression test cases are vital to maintaining calc's level
of correctness and helps us avoid code bug regression.
.sp
In order to consider integrating your code, we need:
.sp
.nf
.in +0.5i .in +0.5i
* calc version you are working with (please try use the latest version)
* new help files or help file patches, if applicable (documentation)
* proposed text for the CHANGES file (brief description of what it does)
* regress.cal test patch as needed
* your source code and/or source code changes (:-))
.in -0.5i
.fi
.sp .sp
The best way to send us new code, if your changes are small, is .PP
via a patch (diff -c from the latest alpha code to your code).
If your change is large, you should send entire files (either or read the source file:
as a diff -c /dev/null your-file patch, or as a uuencoded and
gziped (or compressed) tar file).
.sp
Please try to generate a patch against the most recent
version of calc, and if you use GitHub, the top of the
master branch:
.sp
.nf
.in +0.5i
https://github.com/lcn2/calc
.in -0.5i
.fi
.sp
.sp
The best way contribute to calc bug is to generate calc
GitHub pull request:
.sp
.nf
.in +0.5i
https://github.com/lcn2/calc/pulls
.in -0.5i
.fi
.sp
Your code needs to be contributed under either the 2.1 of the
.B GNU Lesser General Public License (LGPL 2.1)
or be in the public domain.
.sp
If you do not want to use calc GitHub, then send Email to:
.sp .sp
.in +0.5i .in +0.5i
.nf .nf
calc-contrib at asthe dot com CONTRIB-CODE
.fi .fi
.sp
NOTE: Remove spaces and replace 'at' with @, 'dot' with .
.sp
NOTE: Yes, the Email address uses 'asthe',
while the web site uses 'isthe'.
.in -0.5i
.sp
You
.B MUST
use following
.B SPECIAL PHRASE
in your Email Subject line:
.sp
.in +0.5i .in +0.5i
.B calc contribution
.in -0.5i
.sp
You may add additional words to your subject line.
.sp
.B Suggestion:
.sp
.in +0.5i
From time to time, the Email address and Subject
.B SPECIAL PHRASE
may change so verify you have the current info by visiting:
.sp
.in +0.5i
.nf
http://www.isthe.com/chongo/tech/comp/calc/calc-contrib.html
.fi
.in -0.5i
.in -0.5i
.sp
.B IMPORTANT:
If your Email doesn't contain the above phrase,
then we
.B WILL NOT SEE
your Email.
.sp
.B PLEASE BE SURE
you have that
.B SPECIAL PHRASE
somewhere in the subject line!
.sp
Please be patient as we cannot always respond to Email messages quickly.
.PP .PP

View File

@@ -492,7 +492,7 @@ CO= co
CP= cp CP= cp
DIFF= diff DIFF= diff
FMT= fmt FMT= fmt
GREP= egrep GREP= grep
LN= ln LN= ln
LS= ls LS= ls
MAKE= make MAKE= make
@@ -847,7 +847,7 @@ depend:
${C_SRC} 2>/dev/null ${C_SRC} 2>/dev/null
${Q} ${CP} -f skel/custom/makedep.out skel/custom/makedep.in ${Q} ${CP} -f skel/custom/makedep.out skel/custom/makedep.in
${Q} ${SED} -e 's|: ../../|: |' -E < skel/custom/makedep.in | \ ${Q} ${SED} -e 's|: ../../|: |' -E < skel/custom/makedep.in | \
${GREP} -v /usr/include > skel/custom/makedep.out ${GREP} -E -v /usr/include > skel/custom/makedep.out
-${Q} for i in ${C_SRC} /dev/null; do \ -${Q} for i in ${C_SRC} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \ if [ X"$$i" != X"/dev/null" ]; then \
echo "$$i" | ${SED} 's/^\(.*\)\.c/\1.o: \1.c/'; \ echo "$$i" | ${SED} 's/^\(.*\)\.c/\1.o: \1.c/'; \
@@ -861,7 +861,7 @@ depend:
${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak ${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak
${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' \ ${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' \
${MAKE_FILE}.bak > ${MAKE_FILE} ${MAKE_FILE}.bak > ${MAKE_FILE}
${Q} ${GREP} -v '^#' skel/custom/makedep.out >> ${MAKE_FILE} ${Q} ${GREP} -E -v '^#' skel/custom/makedep.out >> ${MAKE_FILE}
${Q} echo removing skel ${Q} echo removing skel
${Q} ${RM} -rf skel ${Q} ${RM} -rf skel
-${Q} if ${CMP} -s ${MAKE_FILE}.bak ${MAKE_FILE}; then \ -${Q} if ${CMP} -s ${MAKE_FILE}.bak ${MAKE_FILE}; then \

View File

@@ -462,7 +462,7 @@ CO= co
CP= cp CP= cp
DIFF= diff DIFF= diff
FMT= fmt FMT= fmt
GREP= egrep GREP= grep
LN= ln LN= ln
LS= ls LS= ls
MAKE= make MAKE= make
@@ -851,7 +851,7 @@ depend:
${C_SRC} 2>/dev/null ${C_SRC} 2>/dev/null
${Q} ${CP} -f skel/custom/makedep.out skel/custom/makedep.in ${Q} ${CP} -f skel/custom/makedep.out skel/custom/makedep.in
${Q} ${SED} -e 's|: ../../|: |' -E < skel/custom/makedep.in | \ ${Q} ${SED} -e 's|: ../../|: |' -E < skel/custom/makedep.in | \
${GREP} -v /usr/include > skel/custom/makedep.out ${GREP} -E -v /usr/include > skel/custom/makedep.out
-${Q} for i in ${C_SRC} /dev/null; do \ -${Q} for i in ${C_SRC} /dev/null; do \
if [ X"$$i" != X"/dev/null" ]; then \ if [ X"$$i" != X"/dev/null" ]; then \
echo "$$i" | ${SED} 's/^\(.*\)\.c/\1.o: \1.c/'; \ echo "$$i" | ${SED} 's/^\(.*\)\.c/\1.o: \1.c/'; \
@@ -865,7 +865,7 @@ depend:
${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak ${Q} ${MV} ${MAKE_FILE} ${MAKE_FILE}.bak
${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' \ ${Q} ${SED} -n '1,/^# DO NOT DELETE THIS LINE/p' \
${MAKE_FILE}.bak > ${MAKE_FILE} ${MAKE_FILE}.bak > ${MAKE_FILE}
${Q} ${GREP} -v '^#' skel/custom/makedep.out >> ${MAKE_FILE} ${Q} ${GREP} -E -v '^#' skel/custom/makedep.out >> ${MAKE_FILE}
${Q} echo removing skel ${Q} echo removing skel
${Q} ${RM} -rf skel ${Q} ${RM} -rf skel
-${Q} if ${CMP} -s ${MAKE_FILE}.bak ${MAKE_FILE}; then \ -${Q} if ${CMP} -s ${MAKE_FILE}.bak ${MAKE_FILE}; then \

732
func.c

File diff suppressed because it is too large Load Diff

82
have_statfs.c Normal file
View File

@@ -0,0 +1,82 @@
/*
* have_statfs - Determine if we have statfs()
*
* Copyright (C) 2023 Landon Curt Noll
*
* Calc is open software; you can redistribute it and/or modify it under
* the terms of the version 2.1 of the GNU Lesser General Public License
* as published by the Free Software Foundation.
*
* Calc is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
* Public License for more details.
*
* A copy of version 2.1 of the GNU Lesser General Public License is
* distributed with calc under the filename COPYING-LGPL. You should have
* received a copy with calc; if not, write to Free Software Foundation, Inc.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* Under source code control: 2023/03/06 00:51:53
* File existed as early as: 2023
*
* chongo <was here> /\oo/\ http://www.isthe.com/chongo/
* Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
*/
/*
* usage:
* have_statfs
*
* Not all systems have the statfs() function, so this may not
* compile on your system.
*
* This prog outputs several defines:
*
* HAVE_STATFS
* defined ==> use statfs()
* undefined ==> do not call or cannot call statfs()
*/
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "have_sys_vfs.h"
#if defined(HAVE_SYS_VFS_H)
# include <sys/vfs.h>
#endif /* HAVE_SYS_VFS_H */
#include "have_sys_param.h"
#if defined(HAVE_SYS_PARAM_H)
# include <sys/param.h>
#endif /* HAVE_SYS_PARAM_H */
#include "have_sys_mount.h"
#if defined(HAVE_SYS_MOUNT_H)
# include <sys/mount.h>
#endif /* HAVE_SYS_MOUNT_H */
#include "banned.h" /* include after system header <> includes */
int
main(void)
{
#if defined(HAVE_NO_STATFS)
printf("#undef HAVE_STATFS /* no */\n");
#else /* HAVE_NO_STATFS */
struct statfs statfs_dot; /* usage stat of "." */
(void) statfs(".", &statfs_dot);
printf("#define HAVE_STATFS /* yes */\n");
#endif /* HAVE_NO_STATFS */
/* exit(0); */
return 0;
}

View File

@@ -247,7 +247,7 @@ CHMOD= chmod
CMP= cmp CMP= cmp
CP= cp CP= cp
FMT= fmt FMT= fmt
GREP= egrep GREP= grep
ICFLAGS= ICFLAGS=
ILDFLAGS= ILDFLAGS=
LCC= cc LCC= cc
@@ -717,7 +717,7 @@ builtin: builtin.top builtin.end ../func.c funclist.sed
-I.. funclist.c -c ${S} -I.. funclist.c -c ${S}
${Q} ${LCC} ${ILDFLAGS} funclist.o -o funclist${EXT} ${S} ${Q} ${LCC} ${ILDFLAGS} funclist.o -o funclist${EXT} ${S}
${Q} ${RM} -f builtin ${Q} ${RM} -f builtin
${Q} ${GREP} -v '^#' builtin.top > builtin ${Q} ${GREP} -E -v '^#' builtin.top > builtin
${Q} ./funclist${EXT} | \ ${Q} ./funclist${EXT} | \
${SED} -e 's/^/ /' -e 's/[ ][ ]*$$//' >> builtin ${SED} -e 's/^/ /' -e 's/[ ][ ]*$$//' >> builtin
${Q} ${CAT} builtin.end >> builtin ${Q} ${CAT} builtin.end >> builtin

View File

@@ -26,13 +26,22 @@ Credits
Most of this source and binary has one of the following copyrights: Most of this source and binary has one of the following copyrights:
Copyright (C) year David I. Bell Copyright (C) year David I. Bell
Copyright (C) year David I. Bell and Landon Curt Noll Copyright (C) year David I. Bell and Landon Curt Noll
Copyright (C) year David I. Bell and Ernest Bowen Copyright (C) year David I. Bell and Ernest Bowen
Copyright (C) year David I. Bell, Landon Curt Noll and Ernest Bowen Copyright (C) year David I. Bell, Landon Curt Noll and Ernest Bowen
Copyright (C) year Landon Curt Noll Copyright (C) year Landon Curt Noll
Copyright (C) year Ernest Bowen and Landon Curt Noll Copyright (C) year Ernest Bowen and Landon Curt Noll
Copyright (C) year Ernest Bowen Copyright (C) year Ernest Bowen
Copyright (C) year Petteri Kettunen and Landon Curt Noll
Copyright (C) year Christoph Zurnieden
Copyright (C) year Landon Curt Noll and Thomas Jones-Low
Copyright (C) year Klaus Alexander Seistrup and Landon Curt Noll
A few files in calc are covered under "The Unlicense". For more
information on this license, see:
https://unlicense.org
Copying / Calc GNU Lesser General Public License Copying / Calc GNU Lesser General Public License
@@ -61,11 +70,11 @@ Copying / Calc GNU Lesser General Public License
See also: See also:
help copyright help copyright
help copying help copying
help copying-lgpl help copying-lgpl
## Copyright (C) 1999 Landon Curt Noll ## Copyright (C) 1999,2023 Landon Curt Noll
## ##
## Calc is open software; you can redistribute it and/or modify it under ## Calc is open software; you can redistribute it and/or modify it under
## the terms of the version 2.1 of the GNU Lesser General Public License ## the terms of the version 2.1 of the GNU Lesser General Public License

799
opcodes.c

File diff suppressed because it is too large Load Diff

9
rpm.mk
View File

@@ -75,7 +75,6 @@ RM= rm
LS= ls LS= ls
CPIO= cpio CPIO= cpio
CP= cp CP= cp
EGREP= egrep
MKDIR= mkdir MKDIR= mkdir
GREP= grep GREP= grep
SORT= sort SORT= sort
@@ -171,8 +170,8 @@ srcpkg: make_rhdir
${V} echo PROJECT_RELEASE="${PROJECT_RELEASE}" ${V} echo PROJECT_RELEASE="${PROJECT_RELEASE}"
${RM} -rf "$(TMPDIR)/$(PROJECT)" ${RM} -rf "$(TMPDIR)/$(PROJECT)"
${FIND} . -depth -print | \ ${FIND} . -depth -print | \
${EGREP} -v '/RCS|/CVS|/NOTES|/\.|\.out$$|\.safe$$\.tar\.bz2$$' | \ ${GREP} -E -v '/RCS|/CVS|/NOTES|/\.|\.out$$|\.safe$$\.tar\.bz2$$' | \
${EGREP} -v '/old[._-]|\.old$$|\.tar\.gz$$|/ver_calc$$' | \ ${GREP} -E -v '/old[._-]|\.old$$|\.tar\.gz$$|/ver_calc$$' | \
LANG=C ${SORT} | \ LANG=C ${SORT} | \
${CPIO} -dumpv "$(TMPDIR)/$(PROJECT)" ${CPIO} -dumpv "$(TMPDIR)/$(PROJECT)"
${RM} -f "$(TMPDIR)/$(PROJECT)/Makefile" ${RM} -f "$(TMPDIR)/$(PROJECT)/Makefile"
@@ -277,8 +276,8 @@ chkpkg:
.PHONY: chksys .PHONY: chksys
chksys: chksys:
${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= rpm.mk start of $@ rule =-=-=-=-='
${RPM_TOOL} -qa | ${GREP} "$(PROJECT_NAME)" ${RPM_TOOL} -qa | ${GREP} -E "$(PROJECT_NAME)"
${RPM_TOOL} -qa | ${GREP} "$(PROJECT_NAME)-devel" ${RPM_TOOL} -qa | ${GREP} -E "$(PROJECT_NAME)-devel"
${V} echo '=-=-=-=-= rpm.mk end of $@ rule =-=-=-=-=' ${V} echo '=-=-=-=-= rpm.mk end of $@ rule =-=-=-=-='
.PHONY: test .PHONY: test

72
seed.c
View File

@@ -66,24 +66,30 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include "have_times.h" #include "have_times.h"
#if defined(HAVE_TIME_H) #if defined(HAVE_TIME_H)
#include <time.h> #include <time.h>
#endif #endif /* HAVE_TIME_H */
#if defined(HAVE_SYS_TIME_H) #if defined(HAVE_SYS_TIME_H)
#include <sys/time.h> #include <sys/time.h>
#endif #endif /* HAVE_SYS_TIME_H */
#if defined(HAVE_SYS_TIMES_H) #if defined(HAVE_SYS_TIMES_H)
#include <sys/times.h> #include <sys/times.h>
#endif #endif /* HAVE_SYS_TIMES_H */
#if !defined(_WIN32) && !defined(_WIN64) #if !defined(_WIN32) && !defined(_WIN64)
# include <sys/resource.h> # include <sys/resource.h>
#endif #endif
#if defined(HAVE_STDLIB_H) #if defined(HAVE_STDLIB_H)
# include <stdlib.h> # include <stdlib.h>
/* NOTE: RANDOM_CNT should remain 32 to circular shift 31-bit returns */ /* NOTE: RANDOM_CNT should remain 32 to circular shift 31-bit returns */
# define RANDOM_CNT (32) /* random() call repeat and circular shift */ # define RANDOM_CNT (32) /* random() call repeat and circular shift */
# define INITSTATE_SIZE (256) /* initstate pool size */ # define INITSTATE_SIZE (256) /* initstate pool size */
#endif #endif /* HAVE_STDLIB_H */
#include <setjmp.h> #include <setjmp.h>
#include "alloc.h" #include "alloc.h"
#include "qmath.h" #include "qmath.h"
@@ -98,15 +104,33 @@
#include "have_uid_t.h" #include "have_uid_t.h"
#include "have_environ.h" #include "have_environ.h"
#include "have_arc4random.h" #include "have_arc4random.h"
#if defined(HAVE_USTAT) #if defined(HAVE_USTAT)
# include <ustat.h> # include <ustat.h>
#endif #endif /* HAVE_USTAT */
#if defined(HAVE_URANDOM) #if defined(HAVE_URANDOM)
# include <fcntl.h> # include <fcntl.h>
# define DEV_URANDOM "/dev/urandom" # define DEV_URANDOM "/dev/urandom"
# define DEV_URANDOM_POOL (16) # define DEV_URANDOM_POOL (16)
#endif #endif /* HAVE_URANDOM */
#include "have_sys_vfs.h"
#if defined(HAVE_SYS_VFS_H)
# include <sys/vfs.h>
#endif /* HAVE_SYS_VFS_H */
#include "have_sys_param.h"
#if defined(HAVE_SYS_PARAM_H)
# include <sys/param.h>
#endif /* HAVE_SYS_PARAM_H */
#include "have_sys_mount.h"
#if defined(HAVE_SYS_MOUNT_H)
# include <sys/mount.h>
#endif /* HAVE_SYS_MOUNT_H */
#include "have_statfs.h"
#include "banned.h" /* include after system header <> includes */ #include "banned.h" /* include after system header <> includes */
@@ -417,6 +441,25 @@ pseudo_seed(void)
/* usage stat of "/var/log/messages" */ /* usage stat of "/var/log/messages" */
struct ustat ustat_messages; struct ustat ustat_messages;
#endif #endif
#if defined(HAVE_STATFS)
struct statfs statfs_dot; /* filesystem stat of "." */
struct statfs statfs_dotdot; /* filesystem stat of ".." */
struct statfs statfs_tmp; /* filesystem stat of "/tmp" */
struct statfs statfs_root; /* filesystem stat of "/" */
struct statfs statfs_tty; /* filesystem stat of "/dev/tty" */
struct statfs statfs_console; /* filesystem stat of "/dev/console" */
struct statfs statfs_stdin; /* filesystem stat of stdin */
struct statfs statfs_stdout; /* filesystem stat of stdout */
struct statfs statfs_stderr; /* filesystem stat of stderr */
struct statfs statfs_zero; /* filesystem stat of "/dev/zero" */
struct statfs statfs_null; /* filesystem stat of "/dev/null" */
struct statfs statfs_sh; /* filesystem stat of "/bin/sh" */
struct statfs statfs_ls; /* filesystem stat of "/bin/ls" */
/* filesystem stat of "/var/log/system.log" */
struct statfs statfs_system;
/* filesystem stat of "/var/log/messages" */
struct statfs statfs_messages;
#endif
#if defined(HAVE_GETSID) #if defined(HAVE_GETSID)
pid_t getsid; /* session ID */ pid_t getsid; /* session ID */
#endif #endif
@@ -559,6 +602,23 @@ pseudo_seed(void)
(void) ustat(sdata.stat_system.st_dev, &sdata.ustat_system); (void) ustat(sdata.stat_system.st_dev, &sdata.ustat_system);
(void) ustat(sdata.stat_messages.st_dev, &sdata.ustat_messages); (void) ustat(sdata.stat_messages.st_dev, &sdata.ustat_messages);
#endif #endif
#if defined(HAVE_STATFS)
(void) statfs("..", &sdata.statfs_dot);
(void) statfs(".", &sdata.statfs_dotdot);
(void) statfs("/tmp", &sdata.statfs_tmp);
(void) statfs("/", &sdata.statfs_root);
(void) statfs("/dev/tty", &sdata.statfs_tty);
(void) statfs("/dev/console", &sdata.statfs_console);
(void) statfs(".dev/stdin", &sdata.statfs_stdin);
(void) statfs("/dev/stdout", &sdata.statfs_stdout);
(void) statfs("/dev/stderr", &sdata.statfs_stderr);
(void) statfs("/dev/zero", &sdata.statfs_zero);
(void) statfs("/dev/null", &sdata.statfs_null);
(void) statfs("/bin/sh", &sdata.statfs_sh);
(void) statfs("/dev/ls", &sdata.statfs_ls);
(void) statfs("/var/log/system.log", &sdata.statfs_system);
(void) statfs("/var/log/messages", &sdata.statfs_messages);
#endif
#if defined(HAVE_GETSID) #if defined(HAVE_GETSID)
sdata.getsid = getsid((pid_t)0); sdata.getsid = getsid((pid_t)0);
#endif #endif

49
sha1.c
View File

@@ -3,26 +3,37 @@
* *
* Written 2 September 1992, Peter C. Gutmann. * Written 2 September 1992, Peter C. Gutmann.
* *
* This file has been extensively modified by:
*
* Landon Curt Noll
* http://www.isthe.com/chongo/
*
* chongo <was here> /\../\
*
* This code has been placed in the public domain. Please do not
* copyright this code.
*
* LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MER-
* CHANTABILITY AND FITNESS. IN NO EVENT SHALL LANDON CURT
* NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* This file is not covered under version 2.1 of the GNU LGPL. * This file is not covered under version 2.1 of the GNU LGPL.
* This file is covered under "The unlicense":
*
* https://unlicense.org
*
* In particular:
*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
* software to the public domain. We make this dedication for the benefit
* of the public at large and to the detriment of our heirs and
* successors. We intend this dedication to be an overt act of
* relinquishment in perpetuity of all present and future rights to this
* software under copyright law.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* For more information, please refer to <http://unlicense.org/>
*/ */

49
sha1.h
View File

@@ -3,26 +3,37 @@
* *
* Written 2 September 1992, Peter C. Gutmann. * Written 2 September 1992, Peter C. Gutmann.
* *
* This file and been extensively modified by:
*
* Landon Curt Noll
* http://www.isthe.com/chongo/
*
* chongo <was here> /\../\
*
* This code has been placed in the public domain. Please do not
* copyright this code.
*
* LANDON CURT NOLL DISCLAIMS ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MER-
* CHANTABILITY AND FITNESS. IN NO EVENT SHALL LANDON CURT
* NOLL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* This file is not covered under version 2.1 of the GNU LGPL. * This file is not covered under version 2.1 of the GNU LGPL.
* This file is covered under "The unlicense":
*
* https://unlicense.org
*
* In particular:
*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
* software to the public domain. We make this dedication for the benefit
* of the public at large and to the detriment of our heirs and
* successors. We intend this dedication to be an overt act of
* relinquishment in perpetuity of all present and future rights to this
* software under copyright law.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* For more information, please refer to <http://unlicense.org/>
*/ */

View File

@@ -373,7 +373,6 @@ freeglobals(void)
{ {
GLOBAL **hp; /* hash table head address */ GLOBAL **hp; /* hash table head address */
GLOBAL *sp; /* current global symbol pointer */ GLOBAL *sp; /* current global symbol pointer */
long count; /* number of global variables freed */
/* /*
* We prevent the hp pointer from walking behind globalhash * We prevent the hp pointer from walking behind globalhash
@@ -384,12 +383,10 @@ freeglobals(void)
* short and running the loop one last time manually helps make * short and running the loop one last time manually helps make
* code checkers such as insure happy. * code checkers such as insure happy.
*/ */
count = 0;
for (hp = &globalhash[HASHSIZE-1]; hp > globalhash; hp--) { for (hp = &globalhash[HASHSIZE-1]; hp > globalhash; hp--) {
for (sp = *hp; sp; sp = sp->g_next) { for (sp = *hp; sp; sp = sp->g_next) {
if (sp->g_value.v_type != V_NULL) { if (sp->g_value.v_type != V_NULL) {
freevalue(&sp->g_value); freevalue(&sp->g_value);
count++;
} }
} }
} }
@@ -397,7 +394,6 @@ freeglobals(void)
for (sp = *hp; sp; sp = sp->g_next) { for (sp = *hp; sp; sp = sp->g_next) {
if (sp->g_value.v_type != V_NULL) { if (sp->g_value.v_type != V_NULL) {
freevalue(&sp->g_value); freevalue(&sp->g_value);
count++;
} }
} }
} }

44
value.c
View File

@@ -377,6 +377,7 @@ negvalue(VALUE *vp, VALUE *vres)
void void
addvalue(VALUE *v1, VALUE *v2, VALUE *vres) addvalue(VALUE *v1, VALUE *v2, VALUE *vres)
{ {
unsigned int twoval_as_uint; /* TWOVAL(a,b) or TWOVAL_INVALID */
COMPLEX *c; COMPLEX *c;
VALUE tmp; VALUE tmp;
NUMBER *q; NUMBER *q;
@@ -403,7 +404,8 @@ addvalue(VALUE *v1, VALUE *v2, VALUE *vres)
return; return;
} }
vres->v_type = v1->v_type; vres->v_type = v1->v_type;
switch (TWOVAL(v1->v_type, v2->v_type)) { twoval_as_uint = TWOVAL_AS_UINT(v1->v_type, v2->v_type);
switch (twoval_as_uint) {
case TWOVAL(V_NUM, V_NUM): case TWOVAL(V_NUM, V_NUM):
vres->v_num = qqadd(v1->v_num, v2->v_num); vres->v_num = qqadd(v1->v_num, v2->v_num);
return; return;
@@ -474,13 +476,15 @@ addvalue(VALUE *v1, VALUE *v2, VALUE *vres)
void void
subvalue(VALUE *v1, VALUE *v2, VALUE *vres) subvalue(VALUE *v1, VALUE *v2, VALUE *vres)
{ {
unsigned int twoval_as_uint; /* TWOVAL(a,b) or TWOVAL_INVALID */
COMPLEX *c; COMPLEX *c;
NUMBER *q; NUMBER *q;
int i; int i;
vres->v_type = v1->v_type; vres->v_type = v1->v_type;
vres->v_subtype = V_NOSUBTYPE; vres->v_subtype = V_NOSUBTYPE;
switch (TWOVAL(v1->v_type, v2->v_type)) { twoval_as_uint = TWOVAL_AS_UINT(v1->v_type, v2->v_type);
switch (twoval_as_uint) {
case TWOVAL(V_NUM, V_NUM): case TWOVAL(V_NUM, V_NUM):
vres->v_num = qsub(v1->v_num, v2->v_num); vres->v_num = qsub(v1->v_num, v2->v_num);
return; return;
@@ -562,11 +566,13 @@ subvalue(VALUE *v1, VALUE *v2, VALUE *vres)
void void
mulvalue(VALUE *v1, VALUE *v2, VALUE *vres) mulvalue(VALUE *v1, VALUE *v2, VALUE *vres)
{ {
unsigned int twoval_as_uint; /* TWOVAL(a,b) or TWOVAL_INVALID */
COMPLEX *c; COMPLEX *c;
vres->v_type = v1->v_type; vres->v_type = v1->v_type;
vres->v_subtype = V_NOSUBTYPE; vres->v_subtype = V_NOSUBTYPE;
switch (TWOVAL(v1->v_type, v2->v_type)) { twoval_as_uint = TWOVAL_AS_UINT(v1->v_type, v2->v_type);
switch (twoval_as_uint) {
case TWOVAL(V_NUM, V_NUM): case TWOVAL(V_NUM, V_NUM):
vres->v_num = qmul(v1->v_num, v2->v_num); vres->v_num = qmul(v1->v_num, v2->v_num);
return; return;
@@ -727,6 +733,8 @@ invertvalue(VALUE *vp, VALUE *vres)
void void
andvalue(VALUE *v1, VALUE *v2, VALUE *vres) andvalue(VALUE *v1, VALUE *v2, VALUE *vres)
{ {
unsigned int twoval_as_uint; /* TWOVAL(a,b) or TWOVAL_INVALID */
vres->v_subtype = V_NOSUBTYPE; vres->v_subtype = V_NOSUBTYPE;
if (v1->v_type == V_NULL) { if (v1->v_type == V_NULL) {
copyvalue(v2, vres); copyvalue(v2, vres);
@@ -737,7 +745,8 @@ andvalue(VALUE *v1, VALUE *v2, VALUE *vres)
return; return;
} }
vres->v_type = v1->v_type; vres->v_type = v1->v_type;
switch (TWOVAL(v1->v_type, v2->v_type)) { twoval_as_uint = TWOVAL_AS_UINT(v1->v_type, v2->v_type);
switch (twoval_as_uint) {
case TWOVAL(V_NUM, V_NUM): case TWOVAL(V_NUM, V_NUM):
vres->v_num = qand(v1->v_num, v2->v_num); vres->v_num = qand(v1->v_num, v2->v_num);
return; return;
@@ -783,6 +792,8 @@ andvalue(VALUE *v1, VALUE *v2, VALUE *vres)
void void
orvalue(VALUE *v1, VALUE *v2, VALUE *vres) orvalue(VALUE *v1, VALUE *v2, VALUE *vres)
{ {
unsigned int twoval_as_uint; /* TWOVAL(a,b) or TWOVAL_INVALID */
if (v1->v_type == V_NULL) { if (v1->v_type == V_NULL) {
copyvalue(v2, vres); copyvalue(v2, vres);
return; return;
@@ -793,7 +804,8 @@ orvalue(VALUE *v1, VALUE *v2, VALUE *vres)
} }
vres->v_type = v1->v_type; vres->v_type = v1->v_type;
vres->v_subtype = V_NOSUBTYPE; vres->v_subtype = V_NOSUBTYPE;
switch (TWOVAL(v1->v_type, v2->v_type)) { twoval_as_uint = TWOVAL_AS_UINT(v1->v_type, v2->v_type);
switch (twoval_as_uint) {
case TWOVAL(V_NUM, V_NUM): case TWOVAL(V_NUM, V_NUM):
vres->v_num = qor(v1->v_num, v2->v_num); vres->v_num = qor(v1->v_num, v2->v_num);
return; return;
@@ -840,9 +852,12 @@ orvalue(VALUE *v1, VALUE *v2, VALUE *vres)
void void
xorvalue(VALUE *v1, VALUE *v2, VALUE *vres) xorvalue(VALUE *v1, VALUE *v2, VALUE *vres)
{ {
unsigned int twoval_as_uint; /* TWOVAL(a,b) or TWOVAL_INVALID */
vres->v_type = v1->v_type; vres->v_type = v1->v_type;
vres->v_subtype = V_NOSUBTYPE; vres->v_subtype = V_NOSUBTYPE;
switch (TWOVAL(v1->v_type, v2->v_type)) { twoval_as_uint = TWOVAL_AS_UINT(v1->v_type, v2->v_type);
switch (twoval_as_uint) {
case (TWOVAL(V_NUM, V_NUM)): case (TWOVAL(V_NUM, V_NUM)):
vres->v_num = qxor(v1->v_num, v2->v_num); vres->v_num = qxor(v1->v_num, v2->v_num);
return; return;
@@ -886,11 +901,13 @@ xorvalue(VALUE *v1, VALUE *v2, VALUE *vres)
void void
hashopvalue(VALUE *v1, VALUE *v2, VALUE *vres) hashopvalue(VALUE *v1, VALUE *v2, VALUE *vres)
{ {
unsigned int twoval_as_uint; /* TWOVAL(a,b) or TWOVAL_INVALID */
NUMBER *q; NUMBER *q;
vres->v_type = v1->v_type; vres->v_type = v1->v_type;
vres->v_subtype = V_NOSUBTYPE; vres->v_subtype = V_NOSUBTYPE;
switch (TWOVAL(v1->v_type, v2->v_type)) { twoval_as_uint = TWOVAL_AS_UINT(v1->v_type, v2->v_type);
switch (twoval_as_uint) {
case TWOVAL(V_NUM, V_NUM): case TWOVAL(V_NUM, V_NUM):
q = qsub(v1->v_num, v2->v_num); q = qsub(v1->v_num, v2->v_num);
vres->v_num = qqabs(q); vres->v_num = qqabs(q);
@@ -952,9 +969,12 @@ backslashvalue(VALUE *vp, VALUE *vres)
void void
setminusvalue(VALUE *v1, VALUE *v2, VALUE *vres) setminusvalue(VALUE *v1, VALUE *v2, VALUE *vres)
{ {
unsigned int twoval_as_uint; /* TWOVAL(a,b) or TWOVAL_INVALID */
vres->v_type = v1->v_type; vres->v_type = v1->v_type;
vres->v_subtype = V_NOSUBTYPE; vres->v_subtype = V_NOSUBTYPE;
switch (TWOVAL(v1->v_type, v2->v_type)) { twoval_as_uint = TWOVAL_AS_UINT(v1->v_type, v2->v_type);
switch (twoval_as_uint) {
case TWOVAL(V_NUM, V_NUM): case TWOVAL(V_NUM, V_NUM):
vres->v_num = qandnot(v1->v_num, v2->v_num); vres->v_num = qandnot(v1->v_num, v2->v_num);
return; return;
@@ -2010,6 +2030,7 @@ powvalue(VALUE *v1, VALUE *v2, VALUE *vres)
void void
powervalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres) powervalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres)
{ {
unsigned int twoval_as_uint; /* TWOVAL(a,b) or TWOVAL_INVALID */
NUMBER *epsilon; NUMBER *epsilon;
COMPLEX *c, ctmp1, ctmp2; COMPLEX *c, ctmp1, ctmp2;
@@ -2042,7 +2063,8 @@ powervalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres)
return; return;
} }
switch (TWOVAL(v1->v_type, v2->v_type)) { twoval_as_uint = TWOVAL_AS_UINT(v1->v_type, v2->v_type);
switch (twoval_as_uint) {
case TWOVAL(V_NUM, V_NUM): case TWOVAL(V_NUM, V_NUM):
if (qisneg(v1->v_num)) { if (qisneg(v1->v_num)) {
ctmp1.real = v1->v_num; ctmp1.real = v1->v_num;
@@ -2098,6 +2120,7 @@ powervalue(VALUE *v1, VALUE *v2, VALUE *v3, VALUE *vres)
void void
divvalue(VALUE *v1, VALUE *v2, VALUE *vres) divvalue(VALUE *v1, VALUE *v2, VALUE *vres)
{ {
unsigned int twoval_as_uint; /* TWOVAL(a,b) or TWOVAL_INVALID */
COMPLEX *c; COMPLEX *c;
COMPLEX ctmp; COMPLEX ctmp;
NUMBER *q; NUMBER *q;
@@ -2124,7 +2147,8 @@ divvalue(VALUE *v1, VALUE *v2, VALUE *vres)
return; return;
} }
vres->v_type = v1->v_type; vres->v_type = v1->v_type;
switch (TWOVAL(v1->v_type, v2->v_type)) { twoval_as_uint = TWOVAL_AS_UINT(v1->v_type, v2->v_type);
switch (twoval_as_uint) {
case TWOVAL(V_NUM, V_NUM): case TWOVAL(V_NUM, V_NUM):
vres->v_num = qqdiv(v1->v_num, v2->v_num); vres->v_num = qqdiv(v1->v_num, v2->v_num);
return; return;

44
value.h
View File

@@ -167,7 +167,8 @@ struct value {
#define V_OPTR 19 /* octet address as pointer */ #define V_OPTR 19 /* octet address as pointer */
#define V_SPTR 20 /* string address as pointer */ #define V_SPTR 20 /* string address as pointer */
#define V_NPTR 21 /* number address as pointer */ #define V_NPTR 21 /* number address as pointer */
#define V_MAX 21 /* highest legal value */
#define V_MAX V_NPTR /* highest legal value - must be last and match highest V_something value */
#define V_NOSUBTYPE 0 /* subtype has no meaning */ #define V_NOSUBTYPE 0 /* subtype has no meaning */
#define V_NOASSIGNTO 1 /* protection status 1 */ #define V_NOASSIGNTO 1 /* protection status 1 */
@@ -189,7 +190,46 @@ struct value {
*/ */
#define TWOVAL(a,b) ((a) << 5 | (b)) /* for switch of two values */ /*
* NOTE: The shift of 8 in TWOVAL() macro below assumes V_MAX < 1<<8
*
* The macro TWOVAL_ARGS_OK(a,b) will return true if both a and b are in range,
* otherwise it will return false.
*
* The TWOVAL_INVALID is a value that TWOVAL_ARGS_OK(a,b) is true,
* will never match a TWOVAL(a,b) value (i.e., using V_something defined values).
*
* The TWOVAL_AS_UINT(a,b) may be assigned to a unsigned int value so that
* with one switches on that unsigned int, cases with a and/or b being
* out of range will fall into the default (non-matching) case.
*
* unsigned int twoval_as_uint;
*
* ...
*
* twoval_as_uint = TWOVAL_AS_UINT(a,b);
* switch (twoval_as_uint) {
* case TWOVAL(V_INT,V_INT):
* ...
* break;
* case TWOVAL(V_INT,V_NUM):
* ...
* break;
* default:
* ...
* break;
* }
*
* If a is NOT 0 <= a <= V_MAX or if b is NOT 0 <= b <= V_MAX,
* when () macro returns -1 (all bits set) in order to
* not match and true TWOVAL() macro combination that uses
* uses a V_something defined value above.
*/
#define TWOVAL(a,b) ((unsigned int)(((a) << 8) | (b))) /* logical OR for switch of two V_something values */
#define TWOVAL_ARGS_OK(a,b) (((a) >= 0) && ((a) <= V_MAX) && ((b) >= 0) && ((b) <= V_MAX))
#define TWOVAL_INVALID ((unsigned int)(-1)) /* never a valid TWOVAL(a,b) value when a and b are in range */
#define TWOVAL_AS_UINT(a,b) (TWOVAL_ARGS_OK(a,b) ? TWOVAL(a,b) : TWOVAL_INVALID)
#define NULL_VALUE ((VALUE *) 0) #define NULL_VALUE ((VALUE *) 0)

View File

@@ -1,7 +1,7 @@
/* /*
* version - determine the version of calc * version - determine the version of calc
* *
* Copyright (C) 1999-2021 David I. Bell and Landon Curt Noll * Copyright (C) 1999-2023 David I. Bell and Landon Curt Noll
* *
* Primary author: David I. Bell * Primary author: David I. Bell
* *
@@ -84,7 +84,7 @@ static char *program;
#define MAJOR_VER 2 /* major library version */ #define MAJOR_VER 2 /* major library version */
#define MINOR_VER 14 /* minor library version */ #define MINOR_VER 14 /* minor library version */
#define MAJOR_PATCH 1 /* major software version level */ #define MAJOR_PATCH 1 /* major software version level */
#define MINOR_PATCH 3 /* minor software version level */ #define MINOR_PATCH 4 /* minor software version level */
/* /*

View File

@@ -36,6 +36,9 @@ HAVE_UNISTD_H=NO
HAVE_LIMITS_H=YES HAVE_LIMITS_H=YES
HAVE_ENVIRON=-DHAVE_NO_ENVIRON HAVE_ENVIRON=-DHAVE_NO_ENVIRON
HAVE_ARC4RANDOM=-DHAVE_NO_ARC4RANDOM HAVE_ARC4RANDOM=-DHAVE_NO_ARC4RANDOM
HAVE_SYS_VFS_H=NO
HAVE_SYS_PARAM_H=NO
HAVE_SYS_MOUNT_H=NO
BINDIR=/usr/bin/calc BINDIR=/usr/bin/calc
LIBDIR=/lib/calc LIBDIR=/lib/calc

View File

@@ -1036,7 +1036,7 @@ zgcd(ZVALUE z1, ZVALUE z2, ZVALUE *res)
} }
g = (FULL) (*a0 * w); g = (FULL) (*a0 * w);
if (h < BASEB) { if (h < BASEB) {
g &= (1 << h) - 1; g &= (FULL)lowhalf[h];
} else { } else {
g &= BASE1; g &= BASE1;
} }
@@ -1354,14 +1354,14 @@ zlog10(ZVALUE z, BOOL *was_10_power)
} }
/* create power10 table */ /* create power10 table */
power10 = malloc(sizeof(long) * (max_power10_exp+1)); power10 = calloc(max_power10_exp+1, sizeof(long));
if (power10 == NULL) { if (power10 == NULL) {
math_error("cannot malloc power10 table"); math_error("cannot malloc power10 table");
not_reached(); not_reached();
} }
/* load power10 table */ /* load power10 table */
for (i=0, v = 1L; i <= max_power10_exp; ++i, v *= 10L) { for (i=0, v = 1L; i < max_power10_exp; ++i, v *= 10L) {
power10[i] = v; power10[i] = v;
} }
} }

View File

@@ -88,9 +88,11 @@ HALF *half_tbl[] = {
/* /*
* highhalf[i] - masks off the upper i bits of a HALF * highhalf[i] - masks off the upper i bits of a HALF
* rhighhalf[i] - masks off the upper BASEB-i bits of a HALF * rhighhalf[i] - masks off the upper BASEB-i bits of a HALF
* lowhalf[i] - masks off the upper i bits of a HALF * lowhalf[i] - masks off the lower i bits of a HALF
* rlowhalf[i] - masks off the upper BASEB-i bits of a HALF * rlowhalf[i] - masks off the lower BASEB-i bits of a HALF
* bitmask[i] - (1 << i) for 0 <= i <= BASEB*2 * bitmask[i] - (1 << i) for 0 <= i <= BASEB*2
*
* NOTE: In all cases 0 <= i <= BASEB
*/ */
HALF highhalf[BASEB+1] = { HALF highhalf[BASEB+1] = {
#if BASEB == 32 #if BASEB == 32

View File

@@ -606,7 +606,7 @@ E_FUNC void zredcpower(REDC *rp, ZVALUE z1, ZVALUE z2, ZVALUE *res);
#define MODE2_OFF (MODE_MAX+1) #define MODE2_OFF (MODE_MAX+1)
/* XXX - perhaps we need the MODE_REAL_AUTO vs MODE_REAL as a config mode? */ /* XXX - perhaps we need the MODE_REAL_AUTO vs MODE_REAL as a config mode? */
#if 0 /* XXX - can we safely set MODE_INITIAL to MODE_REAL_AUTO ?? */ #if 0 /* XXX - can we safely set MODE_INITIAL to MODE_REAL_AUTO ?? */
#define MODE_INITIAL MODE_REAL_AUTO #define MODE_INITIAL MODE_REAL_AUTO
#else #else
#define MODE_INITIAL MODE_REAL #define MODE_INITIAL MODE_REAL

View File

@@ -2861,7 +2861,7 @@ zrandom(long cnt, ZVALUE *res)
t = blum.bits-(dest.bit+1); t = blum.bits-(dest.bit+1);
*dest.loc-- = (blum.buffer >> t); *dest.loc-- = (blum.buffer >> t);
dest.bit = BASEB-t-1; dest.bit = BASEB-t-1;
*dest.loc = ((blum.buffer&lowhalf[t]) << (dest.bit+1)); *dest.loc = (HALF)(((unsigned long)(blum.buffer&lowhalf[t])) << (dest.bit+1));
} }
dest.len -= blum.bits; dest.len -= blum.bits;
} }
@@ -2896,7 +2896,7 @@ zrandom(long cnt, ZVALUE *res)
t = loglogn-(dest.bit+1); t = loglogn-(dest.bit+1);
*dest.loc-- |= (blum.buffer >> t); *dest.loc-- |= (blum.buffer >> t);
dest.bit = BASEB-t-1; dest.bit = BASEB-t-1;
*dest.loc = ((blum.buffer&lowhalf[t]) << (dest.bit+1)); *dest.loc = (HALF)(((unsigned long)(blum.buffer&lowhalf[t])) << (dest.bit+1));
} }
dest.len -= loglogn; dest.len -= loglogn;
} }