mirror of
https://github.com/lcn2/calc.git
synced 2025-08-19 01:13:27 +03:00
Compare commits
48 Commits
prod-2.15.
...
v2.15.1.2
Author | SHA1 | Date | |
---|---|---|---|
|
db83b7383f | ||
|
d9245844aa | ||
|
8542143463 | ||
|
50cb6ec798 | ||
|
41951e2c09 | ||
|
b9cee333b2 | ||
|
e35bb7ffa6 | ||
|
c5b64c373b | ||
|
4017579aeb | ||
|
88fb6a4e47 | ||
|
7eb7e9de1f | ||
|
42d5749da2 | ||
|
bbcbb76369 | ||
|
232b3bddef | ||
|
5ac3e495b2 | ||
|
56153d6615 | ||
|
2a4f399593 | ||
|
160de4bb38 | ||
|
db77e29a23 | ||
|
fe9cefe6ef | ||
|
ea4c50ade0 | ||
|
7f72908b95 | ||
|
a547c36f0a | ||
|
1e2698b42d | ||
|
33815f49e6 | ||
|
732279bcc3 | ||
|
7f4e1eb68d | ||
|
1232b59949 | ||
|
90feefc622 | ||
|
c97ee188ad | ||
|
ae85846839 | ||
|
e096bd9ad8 | ||
|
884b1bc81b | ||
|
a30a518ba7 | ||
|
bb3b861090 | ||
|
0a3469125e | ||
|
9b37e79f21 | ||
|
18cd1f9067 | ||
|
43fc022dc8 | ||
|
29695028cd | ||
|
1d37930d22 | ||
|
60698d2130 | ||
|
3e7ccfd31c | ||
|
488d81b809 | ||
|
932d27053e | ||
|
8e8d6c852a | ||
|
54dd89dcf7 | ||
|
d91e966f19 |
43
.github/workflows/codeql-analysis.yml
vendored
43
.github/workflows/codeql-analysis.yml
vendored
@@ -13,10 +13,10 @@ name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ master ]
|
||||
branches: [ "master" ]
|
||||
schedule:
|
||||
- cron: '41 1 * * 6'
|
||||
|
||||
@@ -33,39 +33,48 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'cpp' ]
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
||||
# Learn more:
|
||||
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
||||
# Use only 'java' to analyze code written in Java, Kotlin or both
|
||||
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
|
||||
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
||||
# queries: security-extended,security-and-quality
|
||||
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v2
|
||||
uses: github/codeql-action/autobuild@v3
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
||||
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
||||
|
||||
# - run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
# echo "Run, Build Application using script"
|
||||
# ./location_of_script_within_repo/buildscript.sh
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
uses: github/codeql-action/analyze@v3
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
||||
|
32
.gitignore
vendored
32
.gitignore
vendored
@@ -1,17 +1,17 @@
|
||||
# generic excluded patterns
|
||||
#
|
||||
# We sort the list below via: sort -u -f
|
||||
# We sort the list below via: sort -d -u
|
||||
#
|
||||
*,v
|
||||
*~
|
||||
*.BAK
|
||||
core*
|
||||
.DS_Store
|
||||
*.dSYM/
|
||||
*.exe
|
||||
*.o.tmp
|
||||
*.[oa]
|
||||
*~
|
||||
*.o.tmp
|
||||
.*.swp
|
||||
.DS_Store
|
||||
core*
|
||||
*,v
|
||||
|
||||
# files and directories created during the building of calc and other Makefile actions
|
||||
#
|
||||
@@ -19,30 +19,28 @@ core*
|
||||
# not consider development source. Some other file(s) and/or programs
|
||||
# generate these files.
|
||||
#
|
||||
# We sort the list below via: sort -u -f
|
||||
# We sort the list below via: sort -d -u
|
||||
#
|
||||
.dynamic
|
||||
.hsrc
|
||||
.static
|
||||
align32
|
||||
align32.h
|
||||
align32_tmp
|
||||
arc4random_tmp
|
||||
args.h
|
||||
cal/.all
|
||||
cal/test082.cal
|
||||
calc
|
||||
calc-static
|
||||
calc.1
|
||||
calc.cat1
|
||||
calc.spec
|
||||
calc-static
|
||||
calc.usage
|
||||
cal/test082.cal
|
||||
charbit.h
|
||||
chatbit
|
||||
chk_c
|
||||
conf.h
|
||||
const_tmp
|
||||
cscript/.all
|
||||
cscript/4dsphere
|
||||
cscript/.all
|
||||
cscript/fproduct
|
||||
cscript/mersenne
|
||||
cscript/piforever
|
||||
@@ -54,15 +52,16 @@ cscript/square
|
||||
custom/.all
|
||||
custom/libcustcalc*
|
||||
debug.out
|
||||
.dynamic
|
||||
endian
|
||||
endian_calc.h
|
||||
environ_tmp
|
||||
errcode
|
||||
errsym.h
|
||||
fpos_tmp
|
||||
fposval
|
||||
fposval.h
|
||||
fposval_tmp
|
||||
fpos_tmp
|
||||
func.show
|
||||
func.sort
|
||||
getpgid_tmp
|
||||
@@ -91,8 +90,6 @@ have_gettime
|
||||
have_gettime.h
|
||||
have_inttypes.h
|
||||
have_limits.h
|
||||
have_memmv
|
||||
have_memmv.h
|
||||
have_newstr
|
||||
have_newstr.h
|
||||
have_offscl
|
||||
@@ -156,13 +153,13 @@ help/releases
|
||||
help/resource
|
||||
help/type
|
||||
help/usage
|
||||
.hsrc
|
||||
libcalc.*
|
||||
libcustcalc.*
|
||||
ll_tmp
|
||||
longbits
|
||||
longbits.h
|
||||
Makefile.our
|
||||
memmv_tmp
|
||||
newstr_tmp
|
||||
NOTES
|
||||
offscl_tmp
|
||||
@@ -174,6 +171,7 @@ sample_many-static
|
||||
sample_rand
|
||||
sample_rand-static
|
||||
statfs_tmp
|
||||
.static
|
||||
status.chk_c.h
|
||||
strdup_tmp
|
||||
tags
|
||||
|
130
CHANGES
130
CHANGES
@@ -1,3 +1,133 @@
|
||||
The following are the changes from calc version 2.15.1.2 to 2.15.1.2:
|
||||
|
||||
Removed use of HAVE_MEMMOVE as well have_memmv.c. Removed the
|
||||
building and including of have_memmv.h. Removed the memmove()
|
||||
function in blkcpy.c, used when HAVE_MEMMOVE was NOT defined.
|
||||
The libc memmove(3) function as defined by <string.h> is now
|
||||
required to compile calc because the replacement code in
|
||||
blkcpy.c q was problematic, especially when regions overlap.
|
||||
The HAVE_MEMMOVE make symbol was removed from Makefile.config.
|
||||
Thanks to GitHub user @skeeto for reporting this problem.
|
||||
|
||||
|
||||
The following are the changes from calc version 2.15.1.1 to 2.15.1.1:
|
||||
|
||||
Change Makefile.config to, if not using not HomeBrew, then try to
|
||||
detect macports and/or using /opt/local/{lib,include}.
|
||||
|
||||
Put full date range (1989-2025) of calc source into version.h.
|
||||
|
||||
Version 2.16.0.0 will form the basis for the calc v2 to calc v3 fork.
|
||||
|
||||
|
||||
The following are the changes from calc version 2.15.0.7 to 2.15.1.0:
|
||||
|
||||
Converted all ASCII tabs to ASCII spaces using a 8 character
|
||||
tab stop, for all files, except for all Makefiles (plus rpm.mk).
|
||||
The command `git diff -w` reports no changes. There is no
|
||||
functionality change in calc: only ASCII tabs to ASCII spaces.
|
||||
|
||||
Fixed trailblank. It was pruning . in its find search.
|
||||
Added check for ASCII tabs is non-Makefiles.
|
||||
|
||||
|
||||
The following are the changes from calc version 2.15.0.6 to 2.15.0.7:
|
||||
|
||||
Thanks to GitHub user @bambooleafz a critical bug (GitHub issue
|
||||
#148 - https://github.com/lcn2/calc/issues/148) they identified
|
||||
was fixed.
|
||||
|
||||
|
||||
The following are the changes from calc version 2.15.0.5 to 2.15.0.6:
|
||||
|
||||
Thanks to GitHub user @ashamedbit, a long standing memory leak in
|
||||
zrandom.c has been fixed.
|
||||
|
||||
|
||||
The following are the changes from calc version 2.15.0.4 to 2.15.0.5:
|
||||
|
||||
make clobber now removes the legacy files: have_fpos.h, help/man,
|
||||
and help/usage. The latter 2 are now managed as help aliases
|
||||
in help.c.
|
||||
|
||||
make install now removes the legacy files: ${HELPDIR}/man
|
||||
and ${HELPDIR}/usage.
|
||||
|
||||
Fixed a problem where, when calc was linked with and uses GNU
|
||||
readline then for any multi-line copy-and-paste, only the first
|
||||
line is executed. Thanks to GitHub user @malfisya for reporting
|
||||
this problem, and thanks to GitHub user @gromit1811 for doing
|
||||
the research needed to overcome deficiencies in the GNU readline
|
||||
documentation, and for supplying the work-a-round to allow
|
||||
multi-line copy-and-paste to work as expected!
|
||||
|
||||
|
||||
The following are the changes from calc version 2.15.0.3 to 2.15.0.4:
|
||||
|
||||
Fixed bug that caused calc to fail to compile filepos2z() in file.c
|
||||
on little endian machines for the Debian apcalc package. Thanks to
|
||||
Martin Buck (m at rtin-buck dor de) for for fix.
|
||||
|
||||
Removed unused macros from zmath.h:
|
||||
|
||||
SWAP_B32_IN_HASH(dest, src)
|
||||
SWAP_B16_IN_HASH(dest, src)
|
||||
SWAP_B8_IN_HASH(dest, src)
|
||||
SWAP_B32_IN_FLAG(dest, src)
|
||||
SWAP_B16_IN_FLAG(dest, src)
|
||||
SWAP_B8_IN_FLAG(dest, src)
|
||||
|
||||
When SWAP_HALF_IN_B32(dest, src), SWAP_B32_IN_FULL(dest, src),
|
||||
SWAP_B16_IN_HALF(dest, src), SWAP_B32_IN_bool(dest, src),
|
||||
or SWAP_B32_IN_LEN(dest, src), SWAP_HALF_IN_FILEPOS(dest, src)
|
||||
is an assignment such as:
|
||||
|
||||
(*(dest) = *(src))
|
||||
|
||||
We now case the dest and src pointers to the proper type before
|
||||
referencing and performing the assignment.
|
||||
|
||||
Documented unexpected behavior when calc is running in
|
||||
"shell script mode" and the prompt builtin function is used
|
||||
without the -p flag. Updated help/prompt, help/unexpected
|
||||
and the calc man page accordingly.
|
||||
|
||||
Unless calc is given the -p command line option, calc will reopen
|
||||
stdin as /dev/null instead of just closing stdin. This prevents
|
||||
subsequent opens grabbing the 1st file descriptor.
|
||||
|
||||
Disable regress tests 4709, 4710, and 7763 because they print
|
||||
multi-byte sequences, which are just fine for calc, the awk
|
||||
used to evaluate the regression suite output in some legacy
|
||||
systems report a "multibyte conversion failure".
|
||||
|
||||
Added a number of missing Makefile variables to the "make env" rule.
|
||||
|
||||
The man command is used to format the calc.1 man page into calc.usage.
|
||||
|
||||
The "help calc" command now prints the formatted calc man page (calc.usage).
|
||||
The "help man" command now prints the formatted calc man page (calc.usage).
|
||||
The "help usage" command now prints the formatted calc man page (calc.usage).
|
||||
|
||||
The file, calc.cat1, is formed by gzipping the calc.usage
|
||||
formatted man page. The calc.cat1 is installed as the calc
|
||||
cat section 1 man page.
|
||||
|
||||
Updated the Copyright string in version.c to refer to
|
||||
the COPYING file and the "help copying" command.
|
||||
|
||||
Added calc.cat1 to .gitignore. Using "sort -d -u" to sort .gitignore content.
|
||||
|
||||
Avoiding use of modern [[ and ]] in Makefile for those legacy systems
|
||||
whose shell do not support them. Be sure to use ||'s between []'s
|
||||
to avoid problems with legacy shell such as the Bourne shell. *sigh*
|
||||
|
||||
Fixed the order of "help full" to match the order of topics listed
|
||||
buy the "help help" command.
|
||||
|
||||
Sorted the halias[] help topics table in help.c using sort -d -u.
|
||||
|
||||
|
||||
The following are the changes from calc version 2.15.0.1 to 2.15.0.2:
|
||||
|
||||
Updated BUGS about MSYS2 on Windows compiling of calc.
|
||||
|
241
Makefile
241
Makefile
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# calc - arbitrary precision calculator
|
||||
#
|
||||
# Copyright (C) 1999-2018,2021-2023 Landon Curt Noll
|
||||
# Copyright (C) 1999-2018,2021-2025 Landon Curt Noll
|
||||
#
|
||||
# Suggestion: Read the HOWTO.INSTALL file.
|
||||
#
|
||||
@@ -173,7 +173,7 @@ LIB_H_SRC= alloc.h attribute.h banned.h blkcpy.h block.h bool.h byteswap.h \
|
||||
BUILD_H_SRC= align32.h args.h charbit.h conf.h endian_calc.h errsym.h fposval.h \
|
||||
have_arc4random.h have_ban_pragma.h have_const.h have_environ.h \
|
||||
have_fgetsetpos.h have_fpos_pos.h have_getpgid.h have_getprid.h \
|
||||
have_getsid.h have_gettime.h have_inttypes.h have_limits.h have_memmv.h \
|
||||
have_getsid.h have_gettime.h have_inttypes.h have_limits.h \
|
||||
have_newstr.h have_offscl.h have_posscl.h have_rusage.h have_statfs.h \
|
||||
have_stdbool.h have_stdint.h have_stdlib.h have_strdup.h have_string.h \
|
||||
have_strlcat.h have_strlcpy.h have_sys_mount.h have_sys_param.h \
|
||||
@@ -191,7 +191,7 @@ BUILD_C_SRC=
|
||||
UTIL_C_SRC= align32.c charbit.c chk_c.c endian.c fposval.c have_arc4random.c \
|
||||
have_ban_pragma.c have_const.c have_environ.c have_fgetsetpos.c \
|
||||
have_fpos_pos.c have_getpgid.c have_getprid.c have_getsid.c \
|
||||
have_gettime.c have_memmv.c have_newstr.c have_offscl.c have_posscl.c \
|
||||
have_gettime.c have_newstr.c have_offscl.c have_posscl.c \
|
||||
have_rusage.c have_statfs.c have_stdvs.c have_strdup.c have_strlcat.c \
|
||||
have_strlcpy.c have_uid_t.c have_unused.c have_ustat.c have_varvs.c \
|
||||
longbits.c
|
||||
@@ -207,7 +207,7 @@ UTIL_MISC_SRC= fposval.h.def
|
||||
#
|
||||
UTIL_OBJS= endian.o longbits.o have_newstr.o have_uid_t.o \
|
||||
have_const.o fposval.o have_fgetsetpos.o have_fpos_pos.o \
|
||||
try_strarg.o have_stdvs.o have_varvs.o have_posscl.o have_memmv.o \
|
||||
try_strarg.o have_stdvs.o have_varvs.o have_posscl.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_unused.o have_ban_pragma.o have_strlcpy.o have_strlcat.o \
|
||||
@@ -216,7 +216,7 @@ UTIL_OBJS= endian.o longbits.o have_newstr.o have_uid_t.o \
|
||||
# these temp files may be created (and removed) during the build of BUILD_C_SRC
|
||||
#
|
||||
UTIL_TMP= ll_tmp fpos_tmp fposval_tmp const_tmp uid_tmp newstr_tmp vs_tmp \
|
||||
memmv_tmp offscl_tmp posscl_tmp newstr_tmp \
|
||||
offscl_tmp posscl_tmp newstr_tmp \
|
||||
getsid_tmp gettime_tmp getprid_tmp rusage_tmp strdup_tmp
|
||||
|
||||
# these utility executables may be created in the process of
|
||||
@@ -321,14 +321,17 @@ STATIC_FIRST_TARGETS= ${LICENSE} .static
|
||||
|
||||
# late targets - things needed after the main build phase is complete
|
||||
#
|
||||
LATE_TARGETS= calc.1 calc.usage \
|
||||
LATE_TARGETS= calc.1 calc.usage calc.cat1 \
|
||||
cal/.all help/.all help/builtin help/errorcodes \
|
||||
cscript/.all
|
||||
|
||||
# calc tools - tools used by the maintainers of the calc source base
|
||||
#
|
||||
# trailblank - find trailing blanks and other file format picky issues
|
||||
# update_ver - update version numbers in Makefile.config
|
||||
# Calc supplied tools:
|
||||
#
|
||||
# TRAILBLANK - find trailing blanks and other file format picky issues
|
||||
# UPDATE_VER - update version numbers in Makefile.config
|
||||
# CALC_TOOLS - the complete list of calc supplied tools
|
||||
#
|
||||
TRAILBLANK= trailblank
|
||||
UPDATE_VER= update_ver
|
||||
@@ -529,15 +532,19 @@ calc.1: calc.man ${MK_SET}
|
||||
-e 's,:\([/.~]\),:\\:\1,g' < calc.man > calc.1
|
||||
${Q} echo calc.1 formed
|
||||
|
||||
calc.usage: calc.1 ${MK_SET}
|
||||
calc.usage: calc.1
|
||||
${Q} echo forming $@ from calc.1
|
||||
${RM} -f $@
|
||||
${Q} echo forming calc.usage from calc.1
|
||||
${Q} if [ -z "${NROFF}" ]; then \
|
||||
LESSCHARSET=iso8859 ${CALCPAGER} calc.1; \
|
||||
else \
|
||||
${NROFF} -man calc.1; \
|
||||
fi 2>&1 | ${GREP} -E -v 'cannot adjust line' | ${COL} -b > $@
|
||||
${Q} echo calc.usage formed
|
||||
${MAN} ./calc.1 > $@
|
||||
${CHMOD} 0444 $@
|
||||
${Q} echo $@ formed
|
||||
|
||||
calc.cat1: calc.usage
|
||||
${Q} echo forming $@ from calc.usage
|
||||
${RM} -f $@
|
||||
${GZIP} --best -f -c calc.usage > $@
|
||||
${CHMOD} 0444 $@
|
||||
${Q} echo $@ formed
|
||||
|
||||
|
||||
##
|
||||
@@ -563,7 +570,7 @@ sample_many${EXT}: sample_many.o ${CALC_DYNAMIC_LIBS} ${MK_SET}
|
||||
###
|
||||
|
||||
hist.o: hist.c ${MK_SET}
|
||||
${CC} ${CFLAGS} ${TERMCONTROL} ${USE_READLINE} ${READLINE_INCLUDE} \
|
||||
${CC} ${CFLAGS} -Wno-strict-prototypes ${TERMCONTROL} ${USE_READLINE} ${READLINE_INCLUDE} \
|
||||
-c hist.c
|
||||
|
||||
seed.o: seed.c ${MK_SET}
|
||||
@@ -1227,7 +1234,7 @@ have_fpos_pos.h: have_fpos_pos.c have_fgetsetpos.h have_posscl.h have_string.h \
|
||||
|
||||
fposval.h: fposval.c have_fgetsetpos.h have_fpos_pos.h have_offscl.h have_posscl.h \
|
||||
endian_calc.h banned.h have_ban_pragma.h fposval.h.def alloc.h \
|
||||
have_newstr.h have_memmv.h have_string.h have_const.h have_string.h \
|
||||
have_newstr.h have_string.h have_const.h have_string.h \
|
||||
have_unused.h have_stdbool.h ${MK_SET}
|
||||
${Q} ${RM} -f fposval_tmp $@
|
||||
${H} echo 'forming $@'
|
||||
@@ -1615,46 +1622,6 @@ have_newstr.h: have_newstr.c banned.h have_ban_pragma.h have_string.h ${MK_SET}
|
||||
${TRUE}; \
|
||||
fi
|
||||
|
||||
have_memmv.h: have_memmv.c banned.h have_ban_pragma.h have_string.h ${MK_SET}
|
||||
${Q} ${RM} -f have_memmv have_memmv.o memmv_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_MEMMV_H)' >> $@
|
||||
${Q} echo '#define CALC_HAVE_MEMMV_H' >> $@
|
||||
${Q} echo '' >> $@
|
||||
${Q} echo '' >> $@
|
||||
${Q} echo '/* do we have or want memmove()? */' >> $@
|
||||
${Q} ${RM} -f have_memmv.o have_memmv
|
||||
-${Q} ${LCC} ${ICFLAGS} ${HAVE_MEMMOVE} have_memmv.c -c ${S} \
|
||||
|| ${TRUE}
|
||||
-${Q} ${LCC} ${ILDFLAGS} have_memmv.o -o have_memmv${EXT} ${S} \
|
||||
|| ${TRUE}
|
||||
-${Q} ./have_memmv${EXT} > memmv_tmp ${E} \
|
||||
|| ${TRUE}
|
||||
-${Q} if [ -s memmv_tmp ]; then \
|
||||
${CAT} memmv_tmp >> $@; \
|
||||
else \
|
||||
echo '#undef HAVE_MEMMOVE /* no */' >> $@; \
|
||||
fi
|
||||
${Q} echo '' >> $@
|
||||
${Q} echo '' >> $@
|
||||
${Q} echo '#endif /* !CALC_HAVE_MEMMV_H */' >> $@
|
||||
${Q} ${RM} -f have_memmv have_memmv.o memmv_tmp
|
||||
${H} echo '$@ formed'
|
||||
-@if [ -z "${Q}" ]; then \
|
||||
echo ''; \
|
||||
echo '=-=-= start of $@ =-=-='; \
|
||||
${CAT} $@; \
|
||||
echo '=-=-= end of $@ =-=-='; \
|
||||
echo ''; \
|
||||
else \
|
||||
${TRUE}; \
|
||||
fi
|
||||
|
||||
have_ustat.h: have_ustat.c banned.h have_ban_pragma.h ${MK_SET}
|
||||
${Q} ${RM} -f ustat_tmp $@
|
||||
${H} echo 'forming $@'
|
||||
@@ -2200,7 +2167,7 @@ errsym.h: errcode${EXT}
|
||||
fi
|
||||
|
||||
errcode${EXT}: errtbl.c attribute.h bool.h errtbl.h have_const.h have_stdbool.h have_newstr.h \
|
||||
have_memmv.h endian_calc.h longbits.h ${MK_SET}
|
||||
endian_calc.h longbits.h ${MK_SET}
|
||||
${RM} -f $@
|
||||
${LCC} ${ICFLAGS} ${ILDFLAGS} -DERRCODE_SRC errtbl.c -o $@
|
||||
|
||||
@@ -2643,7 +2610,7 @@ version:
|
||||
@echo ${VERSION}
|
||||
|
||||
ver_calc${EXT}: version.c strl.c have_string.h have_const.h have_newstr.h \
|
||||
have_strlcpy.h have_memmv.h have_strlcat.h endian_calc.h longbits.h \
|
||||
have_strlcpy.h have_strlcat.h endian_calc.h longbits.h \
|
||||
have_unused.h charbit.h have_stdbool.h
|
||||
${RM} -f $@
|
||||
${LCC} ${ICFLAGS} -DCALC_VER ${ILDFLAGS} version.c strl.c -o $@
|
||||
@@ -2846,23 +2813,25 @@ env:
|
||||
@echo 'BUILD_C_SRC=${BUILD_C_SRC}'; echo ''
|
||||
@echo 'BUILD_H_SRC=${BUILD_H_SRC}'; echo ''
|
||||
@echo 'BYTE_ORDER=${BYTE_ORDER}'; echo ''
|
||||
@echo 'CALC_BYTE_ORDER=${CALC_BYTE_ORDER}'; echo ''
|
||||
@echo 'CALC_CHARBIT=${CALC_CHARBIT}'; echo ''
|
||||
@echo 'CALC_DYNAMIC_LIBS=${CALC_DYNAMIC_LIBS}'; echo ''
|
||||
@echo 'CALC_ENV=${CALC_ENV}'; echo ''
|
||||
@echo 'CALC_INCDIR=${CALC_INCDIR}'; echo ''
|
||||
@echo 'CALCLIBLIST=${CALCLIBLIST}'; echo ''
|
||||
@echo 'CALCOBJS=${CALCOBJS}'; echo ''
|
||||
@echo 'CALCPAGER=${CALCPAGER}'; echo ''
|
||||
@echo 'CALCPATH=${CALCPATH}'; echo ''
|
||||
@echo 'CALCRC=${CALCRC}'; echo ''
|
||||
@echo 'CALCSRC=${CALCSRC}'; echo ''
|
||||
@echo 'CALC_DYNAMIC_LIBS=${CALC_DYNAMIC_LIBS}'; echo ''
|
||||
@echo 'CALC_ENV=${CALC_ENV}'; echo ''
|
||||
@echo 'CALC_INCDIR=${CALC_INCDIR}'; echo ''
|
||||
@echo 'CALC_SHAREDIR=${CALC_SHAREDIR}'; echo ''
|
||||
@echo 'CALCSRC=${CALCSRC}'; echo ''
|
||||
@echo 'CALC_STATIC_LIBS=${CALC_STATIC_LIBS}'; echo ''
|
||||
@echo 'CALC_TOOLS=${CALC_TOOLS}'; echo ''
|
||||
@echo 'CAT=${CAT}'; echo ''
|
||||
@echo 'CATDIR=${CATDIR}'; echo ''
|
||||
@echo 'CATEXT=${CATEXT}'; echo ''
|
||||
@echo 'CATMODE=${CATMODE}'; echo ''
|
||||
@echo 'CC=${CC}'; echo ''
|
||||
@echo 'CCBAN=${CCBAN}'; echo ''
|
||||
@echo 'CC=${CC}'; echo ''
|
||||
@echo 'CCMISC=${CCMISC}'; echo ''
|
||||
@echo 'CCOPT=${CCOPT}'; echo ''
|
||||
@echo 'CCWARN=${CCWARN}'; echo ''
|
||||
@@ -2871,32 +2840,36 @@ env:
|
||||
@echo 'CHMOD=${CHMOD}'; echo ''
|
||||
@echo 'CMP=${CMP}'; echo ''
|
||||
@echo 'CO=${CO}'; echo ''
|
||||
@echo 'COL=${COL}'; echo ''
|
||||
@echo 'COMMON_ADD=${COMMON_ADD}'; echo ''
|
||||
@echo 'COMMON_CFLAGS=${COMMON_CFLAGS}'; echo ''
|
||||
@echo 'COMMON_LDFLAGS=${COMMON_LDFLAGS}'; echo ''
|
||||
@echo 'CONFIG_MKF=${CONFIG_MKF}'; echo ''
|
||||
@echo 'CP=${CP}'; echo ''
|
||||
@echo 'CSCRIPT_TARGETS=${CSCRIPT_TARGETS}'; echo ''
|
||||
@echo 'C_SRC=${C_SRC}'; echo ''
|
||||
@echo 'CTAGS=${CTAGS}'; echo ''
|
||||
@echo 'CUSTOMCALDIR=${CUSTOMCALDIR}'; echo ''
|
||||
@echo 'CUSTOMHELPDIR=${CUSTOMHELPDIR}'; echo ''
|
||||
@echo 'CUSTOMINCDIR=${CUSTOMINCDIR}'; echo ''
|
||||
@echo 'C_SRC=${C_SRC}'; echo ''
|
||||
@echo 'DATE=${DATE}'; echo ''
|
||||
@echo 'DEBUG=${DEBUG}'; echo ''
|
||||
@echo 'DEFAULT_LIB_INSTALL_PATH=${DEFAULT_LIB_INSTALL_PATH}'; echo ''
|
||||
@echo 'DEV_BITS=${DEV_BITS}'; echo ''
|
||||
@echo 'DIFF=${DIFF}'; echo ''
|
||||
@echo 'DISTLIST=${DISTLIST}'; echo ''
|
||||
@echo 'E=${E}'; echo ''
|
||||
@echo 'DYNAMIC_FIRST_TARGETS=${DYNAMIC_FIRST_TARGETS}'; echo ''
|
||||
@echo 'EARLY_TARGETS=${EARLY_TARGETS}'; echo ''
|
||||
@echo 'ECHON=${ECHON}'; echo ''
|
||||
@echo 'E=${E}'; echo ''
|
||||
@echo 'EXT=${EXT}'; echo ''
|
||||
@echo 'EXTRA_CFLAGS=${EXTRA_CFLAGS}'; echo ''
|
||||
@echo 'EXTRA_LDFLAGS=${EXTRA_LDFLAGS}'; echo ''
|
||||
@echo 'FMT=${FMT}'; echo ''
|
||||
@echo 'FPOS_BITS=${FPOS_BITS}'; echo ''
|
||||
@echo 'FPOS_POS_BITS=${FPOS_POS_BITS}'; echo ''
|
||||
@echo 'FSANITIZE=${FSANITIZE}'; echo ''
|
||||
@echo 'GREP=${GREP}'; echo ''
|
||||
@echo 'H=${H}'; echo ''
|
||||
@echo 'GZIP=${GZIP}'; echo ''
|
||||
@echo 'HAVE_ARC4RANDOM=${HAVE_ARC4RANDOM}'; echo ''
|
||||
@echo 'HAVE_CONST=${HAVE_CONST}'; echo ''
|
||||
@echo 'HAVE_ENVIRON=${HAVE_ENVIRON}'; echo ''
|
||||
@@ -2909,7 +2882,6 @@ env:
|
||||
@echo 'HAVE_GETTIME=${HAVE_GETTIME}'; echo ''
|
||||
@echo 'HAVE_INTTYPES_H=${HAVE_INTTYPES_H}'; echo ''
|
||||
@echo 'HAVE_LIMITS_H=${HAVE_LIMITS_H}'; echo ''
|
||||
@echo 'HAVE_MEMMOVE=${HAVE_MEMMOVE}'; echo ''
|
||||
@echo 'HAVE_NEWSTR=${HAVE_NEWSTR}'; echo ''
|
||||
@echo 'HAVE_OFFSCL=${HAVE_OFFSCL}'; echo ''
|
||||
@echo 'HAVE_POSSCL=${HAVE_POSSCL}'; echo ''
|
||||
@@ -2924,11 +2896,11 @@ env:
|
||||
@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_TIME_H=${HAVE_SYS_TIME_H}'; echo ''
|
||||
@echo 'HAVE_SYS_TIMES_H=${HAVE_SYS_TIMES_H}'; echo ''
|
||||
@echo 'HAVE_SYS_VFS_H=${HAVE_SYS_VFS_H}'; echo ''
|
||||
@echo 'HAVE_TIMES_H=${HAVE_TIMES_H}'; echo ''
|
||||
@echo 'HAVE_TIME_H=${HAVE_TIME_H}'; echo ''
|
||||
@echo 'HAVE_TIMES_H=${HAVE_TIMES_H}'; echo ''
|
||||
@echo 'HAVE_UID_T=${HAVE_UID_T}'; echo ''
|
||||
@echo 'HAVE_UNISTD_H=${HAVE_UNISTD_H}'; echo ''
|
||||
@echo 'HAVE_UNUSED=${HAVE_UNUSED}'; echo ''
|
||||
@@ -2936,6 +2908,7 @@ env:
|
||||
@echo 'HAVE_USTAT=${HAVE_USTAT}'; echo ''
|
||||
@echo 'HAVE_VSNPRINTF=${HAVE_VSNPRINTF}'; echo ''
|
||||
@echo 'HELPDIR=${HELPDIR}'; echo ''
|
||||
@echo 'H=${H}'; echo ''
|
||||
@echo 'HOSTNAME=${HOSTNAME}'; echo ''
|
||||
@echo 'H_SRC=${H_SRC}'; echo ''
|
||||
@echo 'ICFLAGS=${ICFLAGS}'; echo ''
|
||||
@@ -2946,46 +2919,48 @@ env:
|
||||
@echo 'LATE_TARGETS=${LATE_TARGETS}'; echo ''
|
||||
@echo 'LCC=${LCC}'; echo ''
|
||||
@echo 'LDCONFIG=${LDCONFIG}'; echo ''
|
||||
@echo 'LDFLAGS=${LDFLAGS}'; echo ''
|
||||
@echo 'LD_DEBUG=${LD_DEBUG}'; echo ''
|
||||
@echo 'LDFLAGS=${LDFLAGS}'; echo ''
|
||||
@echo 'LD_SHARE=${LD_SHARE}'; echo ''
|
||||
@echo 'LIBCALC_SHLIB=${LIBCALC_SHLIB}'; echo ''
|
||||
@echo 'LIBCUSTCALC_SHLIB=${LIBCUSTCALC_SHLIB}'; echo ''
|
||||
@echo 'LIBDIR=${LIBDIR}'; echo ''
|
||||
@echo 'LIB_EXT=${LIB_EXT}'; echo ''
|
||||
@echo 'LIB_EXT_VER=${LIB_EXT_VER}'; echo ''
|
||||
@echo 'LIB_EXT_VERSION=${LIB_EXT_VERSION}'; echo ''
|
||||
@echo 'LIB_H_SRC=${LIB_H_SRC}'; echo ''
|
||||
@echo 'LIBOBJS=${LIBOBJS}'; echo ''
|
||||
@echo 'LIBSRC=${LIBSRC}'; echo ''
|
||||
@echo 'LIB_H_SRC=${LIB_H_SRC}'; echo ''
|
||||
@echo 'LICENSE=${LICENSE}'; echo ''
|
||||
@echo 'LN=${LN}'; echo ''
|
||||
@echo 'LOCAL_MKF=${LOCAL_MKF}'; echo ''
|
||||
@echo 'LONG_BITS=${LONG_BITS}'; echo ''
|
||||
@echo 'MAKE=${MAKE}'; echo ''
|
||||
@echo 'LS=${LS}'; echo ''
|
||||
@echo 'MAKEDEPEND=${MAKEDEPEND}'; echo ''
|
||||
@echo 'MAKE_FILE=${MAKE_FILE}'; echo ''
|
||||
@echo 'MAKE=${MAKE}'; echo ''
|
||||
@echo 'MAN=${MAN}'; echo ''
|
||||
@echo 'MANDIR=${MANDIR}'; echo ''
|
||||
@echo 'MANEXT=${MANEXT}'; echo ''
|
||||
@echo 'MANMAKE=${MANMAKE}'; echo ''
|
||||
@echo 'MANMODE=${MANMODE}'; echo ''
|
||||
@echo 'MINGW=${MINGW}'; echo ''
|
||||
@echo 'MKDIR=${MKDIR}'; echo ''
|
||||
@echo 'MK_SET=${MK_SET}'; echo ''
|
||||
@echo 'MV=${MV}'; echo ''
|
||||
@echo 'NROFF=${NROFF}'; echo ''
|
||||
@echo 'NROFF_ARG=${NROFF_ARG}'; echo ''
|
||||
@echo 'OBJS=${OBJS}'; echo ''
|
||||
@echo 'OFF_T_BITS=${OFF_T_BITS}'; echo ''
|
||||
@echo 'OSNAME=${OSNAME}'; echo ''
|
||||
@echo 'PHONY=${PHONY}'; echo ''
|
||||
@echo 'PREFIX=${PREFIX}'; echo ''
|
||||
@echo 'PURIFY=${PURIFY}'; echo ''
|
||||
@echo 'PWD=${PWD}'; echo ''
|
||||
@echo 'PWDCMD=${PWDCMD}'; echo ''
|
||||
@echo 'PWD=${PWD}'; echo ''
|
||||
@echo 'Q=${Q}'; echo ''
|
||||
@echo 'RANLIB=${RANLIB}'; echo ''
|
||||
@echo 'READLINE_EXTRAS=${READLINE_EXTRAS}'; echo ''
|
||||
@echo 'READLINE_INCLUDE=${READLINE_INCLUDE}'; echo ''
|
||||
@echo 'READLINE_LIB=${READLINE_LIB}'; echo ''
|
||||
@echo 'RM=${RM}'; echo ''
|
||||
@echo 'RMDIR=${RMDIR}'; echo ''
|
||||
@echo 'S=${S}'; echo ''
|
||||
@echo 'RM=${RM}'; echo ''
|
||||
@echo 'SAMPLE_C_SRC=${SAMPLE_C_SRC}'; echo ''
|
||||
@echo 'SAMPLE_H_SRC=${SAMPLE_H_SRC}'; echo ''
|
||||
@echo 'SAMPLE_OBJ=${SAMPLE_OBJ}'; echo ''
|
||||
@@ -2996,17 +2971,23 @@ env:
|
||||
@echo 'SED=${SED}'; echo ''
|
||||
@echo 'SHELL=${SHELL}'; echo ''
|
||||
@echo 'SORT=${SORT}'; echo ''
|
||||
@echo 'SPLINT=${SPLINT}'; echo ''
|
||||
@echo 'SPLINT_OPTS=${SPLINT_OPTS}'; echo ''
|
||||
@echo 'SPLINT=${SPLINT}'; echo ''
|
||||
@echo 'S=${S}'; echo ''
|
||||
@echo 'STATIC_FIRST_TARGETS=${STATIC_FIRST_TARGETS}'; echo ''
|
||||
@echo 'STRIP=${STRIP}'; echo ''
|
||||
@echo 'SYM_DYNAMIC_LIBS=${SYM_DYNAMIC_LIBS}'; echo ''
|
||||
@echo 'T=${T}'; echo ''
|
||||
@echo 'TARGETS=${TARGETS}'; echo ''
|
||||
@echo 'TAIL=${TAIL}'; echo ''
|
||||
@echo 'TARGET_MKF=${TARGET_MKF}'; echo ''
|
||||
@echo 'TARGETS=${TARGETS}'; echo ''
|
||||
@echo 'TEE=${TEE}'; echo ''
|
||||
@echo 'TERMCONTROL=${TERMCONTROL}'; echo ''
|
||||
@echo 'TOUCH=${TOUCH}'; echo ''
|
||||
@echo 'TRAILBLANK=${TRAILBLANK}'; echo ''
|
||||
@echo 'TRUE=${TRUE}'; echo ''
|
||||
@echo 'T=${T}'; echo ''
|
||||
@echo 'UNAME=${UNAME}'; echo ''
|
||||
@echo 'UPDATE_VER=${UPDATE_VER}'; echo ''
|
||||
@echo 'USE_READLINE=${USE_READLINE}'; echo ''
|
||||
@echo 'UTIL_C_SRC=${UTIL_C_SRC}'; echo ''
|
||||
@echo 'UTIL_FILES=${UTIL_FILES}'; echo ''
|
||||
@@ -3014,8 +2995,9 @@ env:
|
||||
@echo 'UTIL_OBJS=${UTIL_OBJS}'; echo ''
|
||||
@echo 'UTIL_PROGS=${UTIL_PROGS}'; echo ''
|
||||
@echo 'UTIL_TMP=${UTIL_TMP}'; echo ''
|
||||
@echo 'V=${V}'; echo ''
|
||||
@echo 'VERSION=${VERSION}'; echo ''
|
||||
@echo 'VER=${VER}'; echo ''
|
||||
@echo 'V=${V}'; echo ''
|
||||
@echo 'WNO_ERROR_LONG_LONG=${WNO_ERROR_LONG_LONG}'; echo ''
|
||||
@echo 'WNO_IMPLICT=${WNO_IMPLICT};' echo ''
|
||||
@echo 'WNO_LONG_LONG=${WNO_LONG_LONG}'; echo ''
|
||||
@@ -3201,9 +3183,9 @@ prep:
|
||||
${Q}echo
|
||||
${MAKE} -s depend
|
||||
${Q}echo
|
||||
@if [[ -f ${MAKE_FILE}.bak ]]; then echo ${MAKE_FILE}.bak exists 1>&2; exit 1; fi
|
||||
@if [[ -f cscript/${MAKE_FILE}.bak ]]; then echo cscript/${MAKE_FILE}.bak exists 1>&2; exit 2; fi
|
||||
@if [[ -f custom/${MAKE_FILE}.bak ]]; then echo custom/${MAKE_FILE}.bak exists 1>&2; exit 3; fi
|
||||
@if [ -f ${MAKE_FILE}.bak ]; then echo ${MAKE_FILE}.bak exists 1>&2; exit 1; fi
|
||||
@if [ -f cscript/${MAKE_FILE}.bak ]; then echo cscript/${MAKE_FILE}.bak exists 1>&2; exit 2; fi
|
||||
@if [ -f custom/${MAKE_FILE}.bak ]; then echo custom/${MAKE_FILE}.bak exists 1>&2; exit 3; fi
|
||||
${Q}echo '=-=-=-=-=-= end of ${MAKE} depend =-=-=-=-=-='
|
||||
${Q}echo
|
||||
${Q}echo '=-=-=-=-=-= start of ${MAKE} testfuncsort =-=-=-=-=-='
|
||||
@@ -3415,7 +3397,7 @@ clobber: clean
|
||||
${RM} -f *.u
|
||||
${RM} -f libcalc.a
|
||||
${RM} -f libcustcalc.a
|
||||
${RM} -f calc.1 calc.usage
|
||||
${RM} -f calc.1 calc.usage calc.cat1
|
||||
${RM} -f calc.pixie calc.rf calc.Counts calc.cord
|
||||
${RM} -f gen_h Makefile.bak tmp.patch
|
||||
${RM} -rf skel
|
||||
@@ -3455,7 +3437,7 @@ clobber: clean
|
||||
${RM} -rf .DS_Store; \
|
||||
fi
|
||||
${RM} -f func.show func.sort
|
||||
${RM} -f outfile
|
||||
${RM} -f outfile have_fpos.h
|
||||
${V} echo '=-=-=-=-= ${MAKE_FILE} end of $@ rule =-=-=-=-='
|
||||
|
||||
# install everything
|
||||
@@ -3751,7 +3733,7 @@ install: ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all custom/Makefile
|
||||
echo "removed old ${T}${CALC_INCDIR}/string.h"; \
|
||||
fi; \
|
||||
done
|
||||
-${Q} if [ -z "${MANDIR}" ]; then \
|
||||
-${Q} if [ -z "${MANDIR}" ] || [ ! -s calc.1 ]; then \
|
||||
${TRUE}; \
|
||||
else \
|
||||
if ${CMP} -s calc.1 ${T}${MANDIR}/calc.${MANEXT}; then \
|
||||
@@ -3765,24 +3747,17 @@ install: ${LIB_H_SRC} ${BUILD_H_SRC} calc.1 all custom/Makefile
|
||||
echo "installed ${T}${MANDIR}/calc.${MANEXT}"; \
|
||||
fi; \
|
||||
fi
|
||||
-${Q} if [ -z "${CATDIR}" ]; then \
|
||||
-${Q} if [ -z "${CATDIR}" ] || [ ! -s calc.cat1 ]; then \
|
||||
${TRUE}; \
|
||||
else \
|
||||
if ${CMP} -s calc.1 ${T}${MANDIR}/calc.${MANEXT}; then \
|
||||
if ${CMP} -s calc.cat1 ${T}${CATDIR}/calc.${MANEXT}; then \
|
||||
${TRUE}; \
|
||||
else \
|
||||
if [ -n "${NROFF}" ]; then \
|
||||
${RM} -f ${T}${CATDIR}/calc.${CATEXT}.new; \
|
||||
${NROFF} ${NROFF_ARG} calc.1 > \
|
||||
${T}${CATDIR}/calc.${CATEXT}.new; \
|
||||
${CHMOD} ${MANMODE} ${T}${MANDIR}/calc.${CATEXT}.new; \
|
||||
${CP} -f calc.cat1 ${T}${CATDIR}/calc.${CATEXT}.new; \
|
||||
${MV} -f ${T}${CATDIR}/calc.${CATEXT}.new \
|
||||
${T}${CATDIR}/calc.${CATEXT}; \
|
||||
echo "installed ${T}${CATDIR}/calc.${CATEXT}"; \
|
||||
elif [ -x "${MANNAME}" ]; then \
|
||||
echo "${MANMAKE} calc.1 ${T}${CATDIR}"; \
|
||||
${MANMAKE} calc.1 ${T}${CATDIR}; \
|
||||
fi; \
|
||||
fi; \
|
||||
fi
|
||||
${V} # NOTE: misc install cleanup
|
||||
@@ -4066,7 +4041,6 @@ addop.o: hash.h
|
||||
addop.o: have_ban_pragma.h
|
||||
addop.o: have_const.h
|
||||
addop.o: have_limits.h
|
||||
addop.o: have_memmv.h
|
||||
addop.o: have_newstr.h
|
||||
addop.o: have_stdbool.h
|
||||
addop.o: have_stdlib.h
|
||||
@@ -4108,7 +4082,6 @@ assocfunc.o: hash.h
|
||||
assocfunc.o: have_ban_pragma.h
|
||||
assocfunc.o: have_const.h
|
||||
assocfunc.o: have_limits.h
|
||||
assocfunc.o: have_memmv.h
|
||||
assocfunc.o: have_newstr.h
|
||||
assocfunc.o: have_stdbool.h
|
||||
assocfunc.o: have_stdlib.h
|
||||
@@ -4143,7 +4116,6 @@ blkcpy.o: have_ban_pragma.h
|
||||
blkcpy.o: have_const.h
|
||||
blkcpy.o: have_fgetsetpos.h
|
||||
blkcpy.o: have_limits.h
|
||||
blkcpy.o: have_memmv.h
|
||||
blkcpy.o: have_newstr.h
|
||||
blkcpy.o: have_stdbool.h
|
||||
blkcpy.o: have_stdlib.h
|
||||
@@ -4174,7 +4146,6 @@ block.o: hash.h
|
||||
block.o: have_ban_pragma.h
|
||||
block.o: have_const.h
|
||||
block.o: have_limits.h
|
||||
block.o: have_memmv.h
|
||||
block.o: have_newstr.h
|
||||
block.o: have_stdbool.h
|
||||
block.o: have_stdlib.h
|
||||
@@ -4202,7 +4173,6 @@ byteswap.o: errtbl.h
|
||||
byteswap.o: have_ban_pragma.h
|
||||
byteswap.o: have_const.h
|
||||
byteswap.o: have_limits.h
|
||||
byteswap.o: have_memmv.h
|
||||
byteswap.o: have_newstr.h
|
||||
byteswap.o: have_stdbool.h
|
||||
byteswap.o: have_stdlib.h
|
||||
@@ -4234,7 +4204,6 @@ calc.o: hash.h
|
||||
calc.o: have_ban_pragma.h
|
||||
calc.o: have_const.h
|
||||
calc.o: have_limits.h
|
||||
calc.o: have_memmv.h
|
||||
calc.o: have_newstr.h
|
||||
calc.o: have_stdbool.h
|
||||
calc.o: have_stdlib.h
|
||||
@@ -4293,7 +4262,6 @@ codegen.o: hash.h
|
||||
codegen.o: have_ban_pragma.h
|
||||
codegen.o: have_const.h
|
||||
codegen.o: have_limits.h
|
||||
codegen.o: have_memmv.h
|
||||
codegen.o: have_newstr.h
|
||||
codegen.o: have_stdbool.h
|
||||
codegen.o: have_stdlib.h
|
||||
@@ -4331,7 +4299,6 @@ comfunc.o: errtbl.h
|
||||
comfunc.o: have_ban_pragma.h
|
||||
comfunc.o: have_const.h
|
||||
comfunc.o: have_limits.h
|
||||
comfunc.o: have_memmv.h
|
||||
comfunc.o: have_newstr.h
|
||||
comfunc.o: have_stdbool.h
|
||||
comfunc.o: have_stdlib.h
|
||||
@@ -4356,7 +4323,6 @@ commath.o: errtbl.h
|
||||
commath.o: have_ban_pragma.h
|
||||
commath.o: have_const.h
|
||||
commath.o: have_limits.h
|
||||
commath.o: have_memmv.h
|
||||
commath.o: have_newstr.h
|
||||
commath.o: have_stdbool.h
|
||||
commath.o: have_stdlib.h
|
||||
@@ -4385,7 +4351,6 @@ config.o: hash.h
|
||||
config.o: have_ban_pragma.h
|
||||
config.o: have_const.h
|
||||
config.o: have_limits.h
|
||||
config.o: have_memmv.h
|
||||
config.o: have_newstr.h
|
||||
config.o: have_stdbool.h
|
||||
config.o: have_stdlib.h
|
||||
@@ -4424,7 +4389,6 @@ const.o: hash.h
|
||||
const.o: have_ban_pragma.h
|
||||
const.o: have_const.h
|
||||
const.o: have_limits.h
|
||||
const.o: have_memmv.h
|
||||
const.o: have_newstr.h
|
||||
const.o: have_stdbool.h
|
||||
const.o: have_stdlib.h
|
||||
@@ -4457,7 +4421,6 @@ custom.o: hash.h
|
||||
custom.o: have_ban_pragma.h
|
||||
custom.o: have_const.h
|
||||
custom.o: have_limits.h
|
||||
custom.o: have_memmv.h
|
||||
custom.o: have_newstr.h
|
||||
custom.o: have_stdbool.h
|
||||
custom.o: have_stdlib.h
|
||||
@@ -4493,7 +4456,6 @@ errtbl.o: func.h
|
||||
errtbl.o: hash.h
|
||||
errtbl.o: have_const.h
|
||||
errtbl.o: have_limits.h
|
||||
errtbl.o: have_memmv.h
|
||||
errtbl.o: have_newstr.h
|
||||
errtbl.o: have_stdbool.h
|
||||
errtbl.o: have_stdlib.h
|
||||
@@ -4530,7 +4492,6 @@ file.o: have_const.h
|
||||
file.o: have_fgetsetpos.h
|
||||
file.o: have_fpos_pos.h
|
||||
file.o: have_limits.h
|
||||
file.o: have_memmv.h
|
||||
file.o: have_newstr.h
|
||||
file.o: have_stdbool.h
|
||||
file.o: have_stdlib.h
|
||||
@@ -4560,7 +4521,6 @@ fposval.o: have_const.h
|
||||
fposval.o: have_fgetsetpos.h
|
||||
fposval.o: have_fpos_pos.h
|
||||
fposval.o: have_limits.h
|
||||
fposval.o: have_memmv.h
|
||||
fposval.o: have_newstr.h
|
||||
fposval.o: have_offscl.h
|
||||
fposval.o: have_posscl.h
|
||||
@@ -4594,7 +4554,6 @@ func.o: have_ban_pragma.h
|
||||
func.o: have_const.h
|
||||
func.o: have_fgetsetpos.h
|
||||
func.o: have_limits.h
|
||||
func.o: have_memmv.h
|
||||
func.o: have_newstr.h
|
||||
func.o: have_rusage.h
|
||||
func.o: have_stdbool.h
|
||||
@@ -4641,7 +4600,6 @@ hash.o: hash.h
|
||||
hash.o: have_ban_pragma.h
|
||||
hash.o: have_const.h
|
||||
hash.o: have_limits.h
|
||||
hash.o: have_memmv.h
|
||||
hash.o: have_newstr.h
|
||||
hash.o: have_stdbool.h
|
||||
hash.o: have_stdlib.h
|
||||
@@ -4693,10 +4651,6 @@ have_getsid.o: have_unistd.h
|
||||
have_gettime.o: banned.h
|
||||
have_gettime.o: have_ban_pragma.h
|
||||
have_gettime.o: have_gettime.c
|
||||
have_memmv.o: banned.h
|
||||
have_memmv.o: have_ban_pragma.h
|
||||
have_memmv.o: have_memmv.c
|
||||
have_memmv.o: have_string.h
|
||||
have_newstr.o: banned.h
|
||||
have_newstr.o: have_ban_pragma.h
|
||||
have_newstr.o: have_newstr.c
|
||||
@@ -4771,7 +4725,6 @@ help.o: hash.h
|
||||
help.o: have_ban_pragma.h
|
||||
help.o: have_const.h
|
||||
help.o: have_limits.h
|
||||
help.o: have_memmv.h
|
||||
help.o: have_newstr.h
|
||||
help.o: have_stdbool.h
|
||||
help.o: have_stdlib.h
|
||||
@@ -4805,7 +4758,6 @@ hist.o: hash.h
|
||||
hist.o: have_ban_pragma.h
|
||||
hist.o: have_const.h
|
||||
hist.o: have_limits.h
|
||||
hist.o: have_memmv.h
|
||||
hist.o: have_newstr.h
|
||||
hist.o: have_stdbool.h
|
||||
hist.o: have_stdlib.h
|
||||
@@ -4846,7 +4798,6 @@ input.o: hash.h
|
||||
input.o: have_ban_pragma.h
|
||||
input.o: have_const.h
|
||||
input.o: have_limits.h
|
||||
input.o: have_memmv.h
|
||||
input.o: have_newstr.h
|
||||
input.o: have_stdbool.h
|
||||
input.o: have_stdlib.h
|
||||
@@ -4890,7 +4841,6 @@ label.o: hash.h
|
||||
label.o: have_ban_pragma.h
|
||||
label.o: have_const.h
|
||||
label.o: have_limits.h
|
||||
label.o: have_memmv.h
|
||||
label.o: have_newstr.h
|
||||
label.o: have_stdbool.h
|
||||
label.o: have_stdlib.h
|
||||
@@ -4928,7 +4878,6 @@ lib_calc.o: hash.h
|
||||
lib_calc.o: have_ban_pragma.h
|
||||
lib_calc.o: have_const.h
|
||||
lib_calc.o: have_limits.h
|
||||
lib_calc.o: have_memmv.h
|
||||
lib_calc.o: have_newstr.h
|
||||
lib_calc.o: have_stdbool.h
|
||||
lib_calc.o: have_stdlib.h
|
||||
@@ -4966,7 +4915,6 @@ lib_util.o: errtbl.h
|
||||
lib_util.o: have_ban_pragma.h
|
||||
lib_util.o: have_const.h
|
||||
lib_util.o: have_limits.h
|
||||
lib_util.o: have_memmv.h
|
||||
lib_util.o: have_newstr.h
|
||||
lib_util.o: have_stdbool.h
|
||||
lib_util.o: have_stdlib.h
|
||||
@@ -4993,7 +4941,6 @@ listfunc.o: hash.h
|
||||
listfunc.o: have_ban_pragma.h
|
||||
listfunc.o: have_const.h
|
||||
listfunc.o: have_limits.h
|
||||
listfunc.o: have_memmv.h
|
||||
listfunc.o: have_newstr.h
|
||||
listfunc.o: have_stdbool.h
|
||||
listfunc.o: have_stdlib.h
|
||||
@@ -5032,7 +4979,6 @@ matfunc.o: hash.h
|
||||
matfunc.o: have_ban_pragma.h
|
||||
matfunc.o: have_const.h
|
||||
matfunc.o: have_limits.h
|
||||
matfunc.o: have_memmv.h
|
||||
matfunc.o: have_newstr.h
|
||||
matfunc.o: have_stdbool.h
|
||||
matfunc.o: have_stdlib.h
|
||||
@@ -5067,7 +5013,6 @@ math_error.o: hash.h
|
||||
math_error.o: have_ban_pragma.h
|
||||
math_error.o: have_const.h
|
||||
math_error.o: have_limits.h
|
||||
math_error.o: have_memmv.h
|
||||
math_error.o: have_newstr.h
|
||||
math_error.o: have_stdbool.h
|
||||
math_error.o: have_stdlib.h
|
||||
@@ -5101,7 +5046,6 @@ obj.o: hash.h
|
||||
obj.o: have_ban_pragma.h
|
||||
obj.o: have_const.h
|
||||
obj.o: have_limits.h
|
||||
obj.o: have_memmv.h
|
||||
obj.o: have_newstr.h
|
||||
obj.o: have_stdbool.h
|
||||
obj.o: have_stdlib.h
|
||||
@@ -5143,7 +5087,6 @@ opcodes.o: have_ban_pragma.h
|
||||
opcodes.o: have_const.h
|
||||
opcodes.o: have_fgetsetpos.h
|
||||
opcodes.o: have_limits.h
|
||||
opcodes.o: have_memmv.h
|
||||
opcodes.o: have_newstr.h
|
||||
opcodes.o: have_stdbool.h
|
||||
opcodes.o: have_stdlib.h
|
||||
@@ -5175,7 +5118,6 @@ pix.o: endian_calc.h
|
||||
pix.o: have_ban_pragma.h
|
||||
pix.o: have_const.h
|
||||
pix.o: have_limits.h
|
||||
pix.o: have_memmv.h
|
||||
pix.o: have_newstr.h
|
||||
pix.o: have_stdbool.h
|
||||
pix.o: have_stdlib.h
|
||||
@@ -5203,7 +5145,6 @@ poly.o: hash.h
|
||||
poly.o: have_ban_pragma.h
|
||||
poly.o: have_const.h
|
||||
poly.o: have_limits.h
|
||||
poly.o: have_memmv.h
|
||||
poly.o: have_newstr.h
|
||||
poly.o: have_stdbool.h
|
||||
poly.o: have_stdlib.h
|
||||
@@ -5227,7 +5168,6 @@ prime.o: endian_calc.h
|
||||
prime.o: have_ban_pragma.h
|
||||
prime.o: have_const.h
|
||||
prime.o: have_limits.h
|
||||
prime.o: have_memmv.h
|
||||
prime.o: have_newstr.h
|
||||
prime.o: have_stdbool.h
|
||||
prime.o: have_stdlib.h
|
||||
@@ -5253,7 +5193,6 @@ qfunc.o: errtbl.h
|
||||
qfunc.o: have_ban_pragma.h
|
||||
qfunc.o: have_const.h
|
||||
qfunc.o: have_limits.h
|
||||
qfunc.o: have_memmv.h
|
||||
qfunc.o: have_newstr.h
|
||||
qfunc.o: have_stdbool.h
|
||||
qfunc.o: have_stdlib.h
|
||||
@@ -5280,7 +5219,6 @@ qio.o: errtbl.h
|
||||
qio.o: have_ban_pragma.h
|
||||
qio.o: have_const.h
|
||||
qio.o: have_limits.h
|
||||
qio.o: have_memmv.h
|
||||
qio.o: have_newstr.h
|
||||
qio.o: have_stdbool.h
|
||||
qio.o: have_stdlib.h
|
||||
@@ -5306,7 +5244,6 @@ qmath.o: errtbl.h
|
||||
qmath.o: have_ban_pragma.h
|
||||
qmath.o: have_const.h
|
||||
qmath.o: have_limits.h
|
||||
qmath.o: have_memmv.h
|
||||
qmath.o: have_newstr.h
|
||||
qmath.o: have_stdbool.h
|
||||
qmath.o: have_stdlib.h
|
||||
@@ -5331,7 +5268,6 @@ qmod.o: errtbl.h
|
||||
qmod.o: have_ban_pragma.h
|
||||
qmod.o: have_const.h
|
||||
qmod.o: have_limits.h
|
||||
qmod.o: have_memmv.h
|
||||
qmod.o: have_newstr.h
|
||||
qmod.o: have_stdbool.h
|
||||
qmod.o: have_stdlib.h
|
||||
@@ -5356,7 +5292,6 @@ qtrans.o: errtbl.h
|
||||
qtrans.o: have_ban_pragma.h
|
||||
qtrans.o: have_const.h
|
||||
qtrans.o: have_limits.h
|
||||
qtrans.o: have_memmv.h
|
||||
qtrans.o: have_newstr.h
|
||||
qtrans.o: have_stdbool.h
|
||||
qtrans.o: have_stdlib.h
|
||||
@@ -5384,7 +5319,6 @@ quickhash.o: hash.h
|
||||
quickhash.o: have_ban_pragma.h
|
||||
quickhash.o: have_const.h
|
||||
quickhash.o: have_limits.h
|
||||
quickhash.o: have_memmv.h
|
||||
quickhash.o: have_newstr.h
|
||||
quickhash.o: have_stdbool.h
|
||||
quickhash.o: have_stdlib.h
|
||||
@@ -5418,7 +5352,6 @@ sample_many.o: hash.h
|
||||
sample_many.o: have_ban_pragma.h
|
||||
sample_many.o: have_const.h
|
||||
sample_many.o: have_limits.h
|
||||
sample_many.o: have_memmv.h
|
||||
sample_many.o: have_newstr.h
|
||||
sample_many.o: have_stdbool.h
|
||||
sample_many.o: have_stdlib.h
|
||||
@@ -5452,7 +5385,6 @@ sample_rand.o: hash.h
|
||||
sample_rand.o: have_ban_pragma.h
|
||||
sample_rand.o: have_const.h
|
||||
sample_rand.o: have_limits.h
|
||||
sample_rand.o: have_memmv.h
|
||||
sample_rand.o: have_newstr.h
|
||||
sample_rand.o: have_stdbool.h
|
||||
sample_rand.o: have_stdlib.h
|
||||
@@ -5484,7 +5416,6 @@ seed.o: have_getprid.h
|
||||
seed.o: have_getsid.h
|
||||
seed.o: have_gettime.h
|
||||
seed.o: have_limits.h
|
||||
seed.o: have_memmv.h
|
||||
seed.o: have_newstr.h
|
||||
seed.o: have_rusage.h
|
||||
seed.o: have_statfs.h
|
||||
@@ -5522,7 +5453,6 @@ sha1.o: hash.h
|
||||
sha1.o: have_ban_pragma.h
|
||||
sha1.o: have_const.h
|
||||
sha1.o: have_limits.h
|
||||
sha1.o: have_memmv.h
|
||||
sha1.o: have_newstr.h
|
||||
sha1.o: have_stdbool.h
|
||||
sha1.o: have_stdlib.h
|
||||
@@ -5553,7 +5483,6 @@ size.o: hash.h
|
||||
size.o: have_ban_pragma.h
|
||||
size.o: have_const.h
|
||||
size.o: have_limits.h
|
||||
size.o: have_memmv.h
|
||||
size.o: have_newstr.h
|
||||
size.o: have_stdbool.h
|
||||
size.o: have_stdlib.h
|
||||
@@ -5587,7 +5516,6 @@ str.o: hash.h
|
||||
str.o: have_ban_pragma.h
|
||||
str.o: have_const.h
|
||||
str.o: have_limits.h
|
||||
str.o: have_memmv.h
|
||||
str.o: have_newstr.h
|
||||
str.o: have_stdbool.h
|
||||
str.o: have_stdlib.h
|
||||
@@ -5609,7 +5537,6 @@ strl.o: banned.h
|
||||
strl.o: decl.h
|
||||
strl.o: have_ban_pragma.h
|
||||
strl.o: have_const.h
|
||||
strl.o: have_memmv.h
|
||||
strl.o: have_newstr.h
|
||||
strl.o: have_string.h
|
||||
strl.o: have_strlcat.h
|
||||
@@ -5635,7 +5562,6 @@ symbol.o: hash.h
|
||||
symbol.o: have_ban_pragma.h
|
||||
symbol.o: have_const.h
|
||||
symbol.o: have_limits.h
|
||||
symbol.o: have_memmv.h
|
||||
symbol.o: have_newstr.h
|
||||
symbol.o: have_stdbool.h
|
||||
symbol.o: have_stdlib.h
|
||||
@@ -5672,7 +5598,6 @@ token.o: hash.h
|
||||
token.o: have_ban_pragma.h
|
||||
token.o: have_const.h
|
||||
token.o: have_limits.h
|
||||
token.o: have_memmv.h
|
||||
token.o: have_newstr.h
|
||||
token.o: have_stdbool.h
|
||||
token.o: have_stdlib.h
|
||||
@@ -5709,7 +5634,6 @@ value.o: have_ban_pragma.h
|
||||
value.o: have_const.h
|
||||
value.o: have_fgetsetpos.h
|
||||
value.o: have_limits.h
|
||||
value.o: have_memmv.h
|
||||
value.o: have_newstr.h
|
||||
value.o: have_stdbool.h
|
||||
value.o: have_stdlib.h
|
||||
@@ -5746,7 +5670,6 @@ version.o: hash.h
|
||||
version.o: have_ban_pragma.h
|
||||
version.o: have_const.h
|
||||
version.o: have_limits.h
|
||||
version.o: have_memmv.h
|
||||
version.o: have_newstr.h
|
||||
version.o: have_stdbool.h
|
||||
version.o: have_stdlib.h
|
||||
@@ -5777,7 +5700,6 @@ zfunc.o: errtbl.h
|
||||
zfunc.o: have_ban_pragma.h
|
||||
zfunc.o: have_const.h
|
||||
zfunc.o: have_limits.h
|
||||
zfunc.o: have_memmv.h
|
||||
zfunc.o: have_newstr.h
|
||||
zfunc.o: have_stdbool.h
|
||||
zfunc.o: have_stdlib.h
|
||||
@@ -5801,7 +5723,6 @@ zio.o: errtbl.h
|
||||
zio.o: have_ban_pragma.h
|
||||
zio.o: have_const.h
|
||||
zio.o: have_limits.h
|
||||
zio.o: have_memmv.h
|
||||
zio.o: have_newstr.h
|
||||
zio.o: have_stdbool.h
|
||||
zio.o: have_stdlib.h
|
||||
@@ -5826,7 +5747,6 @@ zmath.o: have_ban_pragma.h
|
||||
zmath.o: have_const.h
|
||||
zmath.o: have_inttypes.h
|
||||
zmath.o: have_limits.h
|
||||
zmath.o: have_memmv.h
|
||||
zmath.o: have_newstr.h
|
||||
zmath.o: have_stdbool.h
|
||||
zmath.o: have_stdint.h
|
||||
@@ -5852,7 +5772,6 @@ zmod.o: errtbl.h
|
||||
zmod.o: have_ban_pragma.h
|
||||
zmod.o: have_const.h
|
||||
zmod.o: have_limits.h
|
||||
zmod.o: have_memmv.h
|
||||
zmod.o: have_newstr.h
|
||||
zmod.o: have_stdbool.h
|
||||
zmod.o: have_stdlib.h
|
||||
@@ -5877,7 +5796,6 @@ zmul.o: errtbl.h
|
||||
zmul.o: have_ban_pragma.h
|
||||
zmul.o: have_const.h
|
||||
zmul.o: have_limits.h
|
||||
zmul.o: have_memmv.h
|
||||
zmul.o: have_newstr.h
|
||||
zmul.o: have_stdbool.h
|
||||
zmul.o: have_stdlib.h
|
||||
@@ -5905,7 +5823,6 @@ zprime.o: hash.h
|
||||
zprime.o: have_ban_pragma.h
|
||||
zprime.o: have_const.h
|
||||
zprime.o: have_limits.h
|
||||
zprime.o: have_memmv.h
|
||||
zprime.o: have_newstr.h
|
||||
zprime.o: have_stdbool.h
|
||||
zprime.o: have_stdlib.h
|
||||
@@ -5939,7 +5856,6 @@ zrand.o: hash.h
|
||||
zrand.o: have_ban_pragma.h
|
||||
zrand.o: have_const.h
|
||||
zrand.o: have_limits.h
|
||||
zrand.o: have_memmv.h
|
||||
zrand.o: have_newstr.h
|
||||
zrand.o: have_stdbool.h
|
||||
zrand.o: have_stdlib.h
|
||||
@@ -5972,7 +5888,6 @@ zrandom.o: hash.h
|
||||
zrandom.o: have_ban_pragma.h
|
||||
zrandom.o: have_const.h
|
||||
zrandom.o: have_limits.h
|
||||
zrandom.o: have_memmv.h
|
||||
zrandom.o: have_newstr.h
|
||||
zrandom.o: have_stdbool.h
|
||||
zrandom.o: have_stdlib.h
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# Makefile.config - Calc configuration and compile configuration values
|
||||
#
|
||||
# Copyright (C) 2023 Landon Curt Noll
|
||||
# Copyright (C) 2023,2025 Landon Curt Noll
|
||||
#
|
||||
# Suggestion: Read the HOWTO.INSTALL file.
|
||||
#
|
||||
@@ -436,18 +436,6 @@ HAVE_ARC4RANDOM=
|
||||
HAVE_NEWSTR=
|
||||
#HAVE_NEWSTR= -DHAVE_NO_NEWSTR
|
||||
|
||||
# Determine if we have memmove()
|
||||
#
|
||||
# If HAVE_MEMMOVE is empty, this Makefile will run the have_memmv program
|
||||
# to determine if memmove() is supported. If HAVE_MEMMOVE is set to
|
||||
# -DHAVE_NO_MEMMOVE, then calc will use internal functions to simulate
|
||||
# the memory move function that does correct overlapping memory moves.
|
||||
#
|
||||
# If in doubt, leave HAVE_MEMMOVE empty and this Makefile will figure it out.
|
||||
#
|
||||
HAVE_MEMMOVE=
|
||||
#HAVE_MEMMOVE= -DHAVE_NO_MEMMOVE
|
||||
|
||||
# Determine if we have ustat()
|
||||
#
|
||||
# If HAVE_USTAT is empty, this Makefile will run the have_ustat program
|
||||
@@ -997,9 +985,6 @@ endif # ($(target),Darwin)
|
||||
#
|
||||
# Use CATDIR= to disable installation of the calc cat (formatted) page.
|
||||
#
|
||||
# NOTE: If CATDIR is non-empty, then one should have either the
|
||||
# ${NROFF} executable and/or the ${MANMAKE} executable.
|
||||
#
|
||||
CATDIR=
|
||||
#CATDIR= ${PREFIX}/man/cat1
|
||||
#CATDIR= ${PREFIX}/catman/cat1
|
||||
@@ -1026,36 +1011,6 @@ CATEXT= 1
|
||||
#CATEXT= 0
|
||||
#CATEXT= l
|
||||
|
||||
# how to format a man page
|
||||
#
|
||||
# If CATDIR is non-empty, then
|
||||
#
|
||||
# If NROFF is non-empty, then
|
||||
#
|
||||
# ${NROFF} ${NROFF_ARG} calc.1 > ${CATDIR}/calc.${CATEXT}
|
||||
# is used to build and install the cat page
|
||||
#
|
||||
# else (NROFF is empty)
|
||||
#
|
||||
# ${MANMAKE} calc.1 ${CATDIR}
|
||||
# is used to build and install the cat page
|
||||
# else
|
||||
#
|
||||
# The cat page is not built or installed
|
||||
#
|
||||
# If in doubt and you don't want to fool with man pages, set MANDIR
|
||||
# and CATDIR to empty and ignore the NROFF, NROFF_ARG and MANMAKE
|
||||
# lines below.
|
||||
#
|
||||
#NROFF= nroff
|
||||
NROFF=
|
||||
#NROFF= groff
|
||||
NROFF_ARG= -man
|
||||
#NROFF_ARG= -mandoc
|
||||
MANMAKE= ${PREFIX}/bin/manmake
|
||||
#MANMAKE= manmake
|
||||
MANMODE= 0444
|
||||
CATMODE= 0444
|
||||
|
||||
# By default, custom builtin functions may only be executed if calc
|
||||
# is given the -C option. This is because custom builtin functions
|
||||
@@ -1145,6 +1100,9 @@ READLINE_EXTRAS= -lhistory -lncurses
|
||||
#READLINE_LIB= -L${PREFIX}/lib -lreadline
|
||||
#READLINE_EXTRAS= -lhistory -lncurses
|
||||
#
|
||||
#READLINE_LIB= -L/opt/local/lib -lreadline
|
||||
#READLINE_EXTRAS= -lhistory -lncurses
|
||||
#
|
||||
# For Apple OS X: install fink from http://fink.sourceforge.net
|
||||
# and then do a 'fink install readline' and then use:
|
||||
#
|
||||
@@ -1163,6 +1121,7 @@ READLINE_EXTRAS= -lhistory -lncurses
|
||||
READLINE_INCLUDE=
|
||||
#READLINE_INCLUDE= -I/usr/gnu/include
|
||||
#READLINE_INCLUDE= -I${PREFIX}/include
|
||||
#READLINE_INCLUDE= -I/opt/local/include
|
||||
|
||||
# Handle the case where macOS is being used with HomeBrew
|
||||
# # and using the readline, history, and ncurses libraries.
|
||||
@@ -1170,6 +1129,16 @@ READLINE_INCLUDE=
|
||||
ifneq ($(HOMEBREW_PREFIX),)
|
||||
READLINE_LIB:= -L${HOMEBREW_PREFIX}/opt/readline/lib -lreadline
|
||||
READLINE_INCLUDE:= -I${HOMEBREW_PREFIX}/opt/readline/include
|
||||
|
||||
# If not HomeBrew, then try to detect macports and/or using /opt/local/{lib,include}
|
||||
#
|
||||
else # perhaps macports and/or using /opt/local/{lib,include} ?
|
||||
ifneq ($(wildcard /opt/local/lib/*),)
|
||||
READLINE_LIB:= -L/opt/local/lib -lreadline
|
||||
endif
|
||||
ifneq ($(wildcard /opt/local/incliude/*),)
|
||||
READLINE_INCLUDE:= -I/opt/local/include
|
||||
endif
|
||||
endif # ($(HOMEBREW_PREFIX),)
|
||||
|
||||
# If $PAGER is not set, use this program to display a help file
|
||||
@@ -1276,11 +1245,11 @@ EXT=
|
||||
|
||||
# The calc version in the form of x.y.z.w
|
||||
#
|
||||
VERSION= 2.15.0.2
|
||||
VERSION= 2.15.1.2
|
||||
|
||||
# The calc major version in the form of x.y.z
|
||||
#
|
||||
VER= 2.15.0
|
||||
VER= 2.15.1
|
||||
|
||||
# Names of shared libraries with versions
|
||||
#
|
||||
@@ -1296,13 +1265,13 @@ CAT= cat
|
||||
CHMOD= chmod
|
||||
CMP= cmp
|
||||
CO= co
|
||||
COL= col
|
||||
CP= cp
|
||||
CTAGS= ctags
|
||||
DATE= date
|
||||
DIFF= diff
|
||||
FMT= fmt
|
||||
GREP= grep
|
||||
GZIP= gzip
|
||||
HOSTNAME= hostname
|
||||
LANG= C
|
||||
LDCONFIG= ldconfig
|
||||
@@ -1310,6 +1279,7 @@ LN= ln
|
||||
LS= ls
|
||||
MAKE= make
|
||||
MAKEDEPEND= makedepend
|
||||
MAN= man
|
||||
MKDIR= mkdir
|
||||
MV= mv
|
||||
PWDCMD= pwd
|
||||
@@ -1321,8 +1291,8 @@ SORT= sort
|
||||
SPLINT= splint
|
||||
SPLINT_OPTS=
|
||||
STRIP= strip
|
||||
TEE= tee
|
||||
TAIL= tail
|
||||
TEE= tee
|
||||
TOUCH= touch
|
||||
TRUE= true
|
||||
UNAME= uname
|
||||
|
@@ -8,7 +8,7 @@ on Debian: sudo apt install calc
|
||||
on RHEL: sudo dnf install calc
|
||||
on Ubuntu: sudo apt install calc
|
||||
via Termux: apt install calc
|
||||
via src: sudo make clobber all chk instsll
|
||||
via src: sudo make clobber all chk install
|
||||
```
|
||||
|
||||
## TL;DR Run calc
|
||||
@@ -283,3 +283,8 @@ help unexpected
|
||||
|
||||
It contains information about differences between C and calc
|
||||
that may surprise C programmers.
|
||||
|
||||
|
||||
# Reporting Security Issues
|
||||
|
||||
To report a security issue, please visit "[Reporting Security Issues](https://github.com/lcn2/calc/security/policy)".
|
||||
|
22
SECURITY.md
22
SECURITY.md
@@ -1,4 +1,16 @@
|
||||
# Security Policy
|
||||
# Reporting Security Issues
|
||||
|
||||
We take security bugs seriously. We appreciate your efforts to responsibly
|
||||
disclose your findings, and will make every effort to acknowledge your
|
||||
contributions for any verified security issues when they have been fixed.
|
||||
|
||||
To report a security issue, click on: "[Open a draft security advisory](https://github.com/lcn2/calc/security/advisories/new)"
|
||||
|
||||
We will send a response indicating the next steps in handling your
|
||||
report. After the initial reply to your report, we will keep you informed
|
||||
of the progress towards a fix and full announcement, and may ask for
|
||||
additional information or guidance.
|
||||
|
||||
|
||||
## Supported Versions
|
||||
|
||||
@@ -9,11 +21,3 @@ If the most recent stable of calc is also supported with security updates.
|
||||
FYI: please review the BUGS file, or enter the calc command:
|
||||
|
||||
; help BUGS
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
Please create a calc GitHub repo issue:
|
||||
|
||||
https://github.com/lcn2/calc/issues
|
||||
|
||||
Click on ((New issue)) and follow the issue template.
|
||||
|
19
alloc.h
19
alloc.h
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* alloc - storage allocation and storage debug macros
|
||||
*
|
||||
* Copyright (C) 1999-2007,2014 David I. Bell
|
||||
* Copyright (C) 1999-2007,2014,2025 David I. Bell
|
||||
*
|
||||
* 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
|
||||
@@ -29,13 +29,15 @@
|
||||
|
||||
|
||||
#if defined(CALC_SRC) /* if we are building from the calc source tree */
|
||||
# include "decl.h"
|
||||
# include "have_newstr.h"
|
||||
# include "have_string.h"
|
||||
# include "have_memmv.h"
|
||||
# include "have_const.h"
|
||||
#else
|
||||
# include <calc/decl.h>
|
||||
# include <calc/have_newstr.h>
|
||||
# include <calc/have_string.h>
|
||||
# include <calc/have_memmv.h>
|
||||
# include <calc/have_const.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
@@ -75,15 +77,4 @@ E_FUNC int strcmp();
|
||||
#define strchr(s, c) index(s, c)
|
||||
#endif /* HAVE_NEWSTR */
|
||||
|
||||
#if !defined(HAVE_MEMMOVE)
|
||||
# undef MEMMOVE_SIZE_T
|
||||
#if defined(FORCE_STDC) || \
|
||||
(defined(__STDC__) && __STDC__ != 0) || defined(__cplusplus)
|
||||
# define MEMMOVE_SIZE_T size_t
|
||||
# else
|
||||
# define MEMMOVE_SIZE_T long
|
||||
# endif
|
||||
E_FUNC void *memmove(void *s1, CONST void *s2, MEMMOVE_SIZE_T n);
|
||||
#endif
|
||||
|
||||
#endif /* !INCLUDE_ALLOC_H */
|
||||
|
58
blkcpy.c
58
blkcpy.c
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* blkcpy - general values and related routines used by the calculator
|
||||
*
|
||||
* Copyright (C) 1999-2007,2021-2023 Landon Curt Noll and Ernest Bowen
|
||||
* Copyright (C) 1999-2007,2021-2023,2025 Landon Curt Noll and Ernest Bowen
|
||||
*
|
||||
* Primary author: Landon Curt Noll
|
||||
*
|
||||
@@ -924,62 +924,6 @@ copyostr2blk(char *str,long ssi,long num,BLOCK *dblk,long dsi,bool noreloc)
|
||||
dblk->datalen = newlen;
|
||||
return 0;
|
||||
}
|
||||
#if !defined(HAVE_MEMMOVE)
|
||||
/*
|
||||
* memmove - simulate the memory move function that deals with overlap
|
||||
*
|
||||
* Copying between objects that overlap will take place correctly.
|
||||
*
|
||||
* given:
|
||||
* s1 destination
|
||||
* s2 source
|
||||
* n octet count
|
||||
*
|
||||
* returns:
|
||||
* s1
|
||||
*/
|
||||
void *
|
||||
memmove(void *s1, CONST void *s2, MEMMOVE_SIZE_T n)
|
||||
{
|
||||
/*
|
||||
* firewall
|
||||
*/
|
||||
if (s1 == NULL || s2 == NULL) {
|
||||
math_error("bogus memmove NULL ptr");
|
||||
not_reached();
|
||||
}
|
||||
if (n <= 0) {
|
||||
/* neg or 0 count does nothing */
|
||||
return s1;
|
||||
}
|
||||
if ((char *)s1 == (char *)s2) {
|
||||
/* copy to same location does nothing */
|
||||
return s1;
|
||||
}
|
||||
|
||||
/*
|
||||
* determine if we need to deal with overlap copy
|
||||
*/
|
||||
if ((char *)s1 > (char *)s2 && (char *)s1 < (char *)s2+n) {
|
||||
|
||||
/*
|
||||
* we have to copy backwards ... slowly
|
||||
*/
|
||||
while (n-- > 0) {
|
||||
((char *)s1)[n] = ((char *)s2)[n];
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
/*
|
||||
* safe ... no overlap problems
|
||||
*/
|
||||
(void) memcpy(s1, s2, n);
|
||||
|
||||
}
|
||||
return s1;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
|
@@ -3030,6 +3030,24 @@ define test_2600()
|
||||
strcat(str(tnum++),
|
||||
': round(log(1.2+1.2i,1e-10),10) == ',
|
||||
'0.2296962439+0.3410940885i'));
|
||||
vrfy(log2(0.5) == -1,
|
||||
strcat(str(tnum++), ': log2(0.5) == -1'));
|
||||
vrfy(log2(0.5) == -1,
|
||||
strcat(str(tnum++), ': log2(0.5) == -1'));
|
||||
vrfy(log2(0.5) == log2(0.5),
|
||||
strcat(str(tnum++), ': log2(0.5) == log2(0.5)'));
|
||||
vrfy(0^0 == 1,
|
||||
strcat(str(tnum++), ': 0^0 == 1'));
|
||||
vrfy(1^0 == 1,
|
||||
strcat(str(tnum++), ': 1^0 == 1'));
|
||||
vrfy(1^1 == 1,
|
||||
strcat(str(tnum++), ': 1^1 == 1'));
|
||||
vrfy(2^0 == 1,
|
||||
strcat(str(tnum++), ': 2^0 == 1'));
|
||||
vrfy(log2(1) == 0,
|
||||
strcat(str(tnum++), ': log2(1) == 0'));
|
||||
vrfy(log2(1.0) == 0,
|
||||
strcat(str(tnum++), ': log2(1.0) == 0'));
|
||||
vrfy(log2(2) == 1,
|
||||
strcat(str(tnum++), ': log2(2) == 1'));
|
||||
vrfy(log2(4) == 2,
|
||||
@@ -4879,8 +4897,9 @@ define test_charset()
|
||||
vrfy("\123" == char(0123), '4706: "\\123" == char(0123)');
|
||||
vrfy("\123\124" == "ST", '4707: "\\123\\124" == "ST"');
|
||||
vrfy("\311" == char(201), '4708: "\\311" == char(201)');
|
||||
vrfy("\119" == "\t9", '4709: "\\119" == "\t9"');
|
||||
vrfy("\765" == "\365", '4710: "\\765" == "\365"');
|
||||
/* NOTE: We skip non-ASCII to avoid problems with old awk that cannot handle them */
|
||||
/* vrfy("\119" == "\t9", '4709: "\\119" == "\t9"'); */
|
||||
/* vrfy("\765" == "\365", '4710: "\\765" == "\365"'); */
|
||||
vrfy("\x61" == "a", '4711: "\\x61" == "a"');
|
||||
vrfy("\x73" == "s", '4712: "\\x73" == "s"');
|
||||
vrfy("\xea" == char(234), '4713: "\\xea" == char(234)');
|
||||
@@ -8191,7 +8210,8 @@ define test_newstring()
|
||||
vrfy(A == "A\255gdef", '7761: A == "A\\255gdef"');
|
||||
setbit(A, 16, 0);
|
||||
print '7762: setbit(A, 16, 0);';
|
||||
vrfy(A == "A\255fdef", '7763: A == "A\255fdef"');
|
||||
/* NOTE: We skip non-ASCII to avoid problems with old awk that cannot handle them */
|
||||
/* vrfy(A == "A\255fdef", '7763: A == "A\255fdef"'); */
|
||||
|
||||
q = "curds" " and " "whey";
|
||||
print '7764: q = "curds" " and " "whey"';
|
||||
|
4
calc.c
4
calc.c
@@ -543,8 +543,8 @@ main(int argc, char **argv)
|
||||
cmdbuf[cmdlen++] = '\n';
|
||||
cmdbuf[cmdlen] = '\0';
|
||||
if (p_flag != true) {
|
||||
if (fclose(stdin)) {
|
||||
perror("main(): fclose(stdin) failed:");
|
||||
if (freopen("/dev/null", "r", stdin) == NULL) {
|
||||
perror("in main: freopen(\"/dev/null\", \"r\", stdin) failed:");
|
||||
}
|
||||
stdin_closed = true;
|
||||
}
|
||||
|
85
calc.man
85
calc.man
@@ -470,6 +470,24 @@ The
|
||||
flag overrides
|
||||
.BR \-i .
|
||||
|
||||
.sp 1
|
||||
When running calc as a shell script (see
|
||||
.B "SHELL SCRIPT MODE"
|
||||
for details), calc will close standard input (stdin)
|
||||
during startup
|
||||
.B UNLESS
|
||||
the
|
||||
.B \-p
|
||||
flag is given on the command line.
|
||||
When calc is running in
|
||||
.BR "shell script mode" ,
|
||||
shell scripts that call the
|
||||
.BR prompt (str)
|
||||
builtin will not work properly (the prompt builtin
|
||||
will always fail) unless the
|
||||
.B \-p
|
||||
flag is given on the command line.
|
||||
|
||||
.TP
|
||||
.B \-q
|
||||
Disable the reading of the startup scripts.
|
||||
@@ -651,7 +669,9 @@ echo chongo was here | calc \-i 'print fgetline(files(0));'
|
||||
.fi
|
||||
.in -5n
|
||||
.sp 1
|
||||
This is because without \-p, the interactive parser, in an effort
|
||||
This is because without
|
||||
.BR \-p ,
|
||||
the interactive parser, in an effort
|
||||
to parse interactive commands, flushes data on standard input.
|
||||
|
||||
.PP
|
||||
@@ -932,6 +952,67 @@ whereas
|
||||
.sp 1
|
||||
will not.
|
||||
|
||||
.sp 1
|
||||
By default, using calc startup in
|
||||
.BR "shell script mode" ,
|
||||
calc will close standard input (stdin).
|
||||
Thus builtin functions such as
|
||||
.BR prompt (str)
|
||||
will fail (return a null value).
|
||||
Calc shell scripts that call the
|
||||
.BR prompt (str)
|
||||
builtin will not work properly (the prompt builtin
|
||||
will always fail and return a null value) unless the
|
||||
.B \-p
|
||||
flag is given on the command line.
|
||||
|
||||
.sp 1
|
||||
The following shell script will always print "got null" because
|
||||
stdin will be closed by calc during startup:
|
||||
|
||||
.sp 1
|
||||
.in +5n
|
||||
.nf
|
||||
#!/usr/bin/calc \-q \-f
|
||||
|
||||
# The prompt will ALWAYS FAIL and return a null value
|
||||
n = prompt("Test> ");
|
||||
if (isnull(n)) {
|
||||
print("got null");
|
||||
} else {
|
||||
print("got " + n);
|
||||
}
|
||||
.fi
|
||||
.in -5n
|
||||
.sp 1
|
||||
However the following shell script (note the
|
||||
.B \-p
|
||||
before the
|
||||
.B \-f
|
||||
in the 1st line) will be interactive, prompt with "Test> " and print
|
||||
the "got" result as expected:
|
||||
|
||||
.sp 1
|
||||
.in +5n
|
||||
.nf
|
||||
#!/usr/bin/calc \-q \-p \-f
|
||||
|
||||
n = prompt("Test> ");
|
||||
if (isnull(n)) {
|
||||
print("got null");
|
||||
} else {
|
||||
print("got " + n);
|
||||
}
|
||||
.fi
|
||||
.in -5n
|
||||
|
||||
.sp 1
|
||||
Note in the example above, the
|
||||
.B \-p
|
||||
flag must be given before the final
|
||||
.B \-f
|
||||
command line flag.
|
||||
|
||||
.PP
|
||||
|
||||
.SH DATA TYPES
|
||||
@@ -1431,7 +1512,7 @@ the following GitHub repo:
|
||||
https://github.com/lcn2/calc
|
||||
.in -0.5i
|
||||
.sp
|
||||
The very latest calc souece is found at the top master branch.
|
||||
The very latest calc source is found at the top master branch.
|
||||
|
||||
.PP
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# custom - makefile for calc custom routines
|
||||
#
|
||||
# Copyright (C) 1999-2006,2014,2017-2018,2021,2023 Landon Curt Noll
|
||||
# Copyright (C) 1999-2006,2014,2017-2018,2021,2023,2025 Landon Curt Noll
|
||||
#
|
||||
# Suggestion: Read the ../HOWTO.INSTALL file.
|
||||
#
|
||||
@@ -728,7 +728,6 @@ c_argv.o: ../hash.h
|
||||
c_argv.o: ../have_ban_pragma.h
|
||||
c_argv.o: ../have_const.h
|
||||
c_argv.o: ../have_limits.h
|
||||
c_argv.o: ../have_memmv.h
|
||||
c_argv.o: ../have_newstr.h
|
||||
c_argv.o: ../have_stdbool.h
|
||||
c_argv.o: ../have_stdlib.h
|
||||
@@ -761,7 +760,6 @@ c_devnull.o: ../hash.h
|
||||
c_devnull.o: ../have_ban_pragma.h
|
||||
c_devnull.o: ../have_const.h
|
||||
c_devnull.o: ../have_limits.h
|
||||
c_devnull.o: ../have_memmv.h
|
||||
c_devnull.o: ../have_newstr.h
|
||||
c_devnull.o: ../have_stdbool.h
|
||||
c_devnull.o: ../have_stdlib.h
|
||||
@@ -795,7 +793,6 @@ c_help.o: ../hash.h
|
||||
c_help.o: ../have_ban_pragma.h
|
||||
c_help.o: ../have_const.h
|
||||
c_help.o: ../have_limits.h
|
||||
c_help.o: ../have_memmv.h
|
||||
c_help.o: ../have_newstr.h
|
||||
c_help.o: ../have_stdbool.h
|
||||
c_help.o: ../have_stdlib.h
|
||||
@@ -829,7 +826,6 @@ c_pmodm127.o: ../hash.h
|
||||
c_pmodm127.o: ../have_ban_pragma.h
|
||||
c_pmodm127.o: ../have_const.h
|
||||
c_pmodm127.o: ../have_limits.h
|
||||
c_pmodm127.o: ../have_memmv.h
|
||||
c_pmodm127.o: ../have_newstr.h
|
||||
c_pmodm127.o: ../have_stdbool.h
|
||||
c_pmodm127.o: ../have_stdlib.h
|
||||
@@ -862,7 +858,6 @@ c_pzasusb8.o: ../hash.h
|
||||
c_pzasusb8.o: ../have_ban_pragma.h
|
||||
c_pzasusb8.o: ../have_const.h
|
||||
c_pzasusb8.o: ../have_limits.h
|
||||
c_pzasusb8.o: ../have_memmv.h
|
||||
c_pzasusb8.o: ../have_newstr.h
|
||||
c_pzasusb8.o: ../have_stdbool.h
|
||||
c_pzasusb8.o: ../have_stdlib.h
|
||||
@@ -896,7 +891,6 @@ c_register.o: ../hash.h
|
||||
c_register.o: ../have_ban_pragma.h
|
||||
c_register.o: ../have_const.h
|
||||
c_register.o: ../have_limits.h
|
||||
c_register.o: ../have_memmv.h
|
||||
c_register.o: ../have_newstr.h
|
||||
c_register.o: ../have_stdbool.h
|
||||
c_register.o: ../have_stdlib.h
|
||||
@@ -932,7 +926,6 @@ c_sysinfo.o: ../hash.h
|
||||
c_sysinfo.o: ../have_ban_pragma.h
|
||||
c_sysinfo.o: ../have_const.h
|
||||
c_sysinfo.o: ../have_limits.h
|
||||
c_sysinfo.o: ../have_memmv.h
|
||||
c_sysinfo.o: ../have_newstr.h
|
||||
c_sysinfo.o: ../have_stdbool.h
|
||||
c_sysinfo.o: ../have_stdlib.h
|
||||
@@ -970,7 +963,6 @@ custtbl.o: ../hash.h
|
||||
custtbl.o: ../have_ban_pragma.h
|
||||
custtbl.o: ../have_const.h
|
||||
custtbl.o: ../have_limits.h
|
||||
custtbl.o: ../have_memmv.h
|
||||
custtbl.o: ../have_newstr.h
|
||||
custtbl.o: ../have_stdbool.h
|
||||
custtbl.o: ../have_stdlib.h
|
||||
|
2
file.c
2
file.c
@@ -1387,7 +1387,7 @@ filepos2z(FILEPOS pos)
|
||||
ret.len = FILEPOS_BITS/BASEB;
|
||||
ret.v = alloc(ret.len);
|
||||
zclearval(ret);
|
||||
SWAP_HALF_IN_FILEPOS(ret.v, &pos);
|
||||
SWAP_HALF_IN_FILEPOS(ret.v, (HALF *)&pos);
|
||||
ret.sign = 0;
|
||||
ztrim(&ret);
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* fposval - Determine information about the file position type
|
||||
*
|
||||
* Copyright (C) 1999,2021,2023 Landon Curt Noll
|
||||
* Copyright (C) 1999,2021,2023,2025 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
|
||||
@@ -71,7 +71,6 @@
|
||||
#include "have_fpos_pos.h"
|
||||
#include "alloc.h"
|
||||
#include "have_unused.h"
|
||||
#include "have_memmv.h"
|
||||
#include "zmath.h"
|
||||
|
||||
|
||||
@@ -140,7 +139,7 @@ main(int UNUSED(argc), char **argv)
|
||||
*/
|
||||
#if defined(HAVE_FILEPOS_SCALAR)
|
||||
printf("#define SWAP_HALF_IN_FILEPOS(dest, src) \\\n"
|
||||
"\t(*(dest) = *(src))\n");
|
||||
"\t(*((HALF *)(dest)) = *((HALF *)(src)))\n");
|
||||
#else /* HAVE_FILEPOS_SCALAR */
|
||||
/*
|
||||
* Normally a "(*(dest) = *(src))" would do, but on some
|
||||
|
73
have_memmv.c
73
have_memmv.c
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* have_memmv - Determine if we have memmove()
|
||||
*
|
||||
* Copyright (C) 1999,2021 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: 1997/04/16 02:02:34
|
||||
* File existed as early as: 1997
|
||||
*
|
||||
* chongo <was here> /\oo/\ http://www.isthe.com/chongo/
|
||||
* Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
|
||||
*/
|
||||
|
||||
/*
|
||||
* usage:
|
||||
* have_memmv
|
||||
*
|
||||
* Not all systems with memcpy() have memmove() functions, so this may not
|
||||
* compile on your system.
|
||||
*
|
||||
* This prog outputs several defines:
|
||||
*
|
||||
* HAVE_MEMMOVE
|
||||
* defined ==> use memmove()
|
||||
* undefined ==> use internal slow memmove() instead
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "have_string.h"
|
||||
#ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include "banned.h" /* include after system header <> includes */
|
||||
|
||||
|
||||
#define MOVELEN 3
|
||||
|
||||
char src[] = "chongo was here";
|
||||
char dest[MOVELEN+1];
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
#if defined(HAVE_NO_MEMMOVE)
|
||||
|
||||
printf("#undef HAVE_MEMMOVE /* no */\n");
|
||||
|
||||
#else /* HAVE_NO_MEMMOVE */
|
||||
|
||||
(void) memmove(dest, src, MOVELEN);
|
||||
|
||||
printf("#define HAVE_MEMMOVE /* yes */\n");
|
||||
|
||||
#endif /* HAVE_NO_MEMMOVE */
|
||||
|
||||
/* exit(0); */
|
||||
return 0;
|
||||
}
|
39
help.c
39
help.c
@@ -56,38 +56,41 @@ STATIC struct help_alias {
|
||||
char *topic;
|
||||
char *filename;
|
||||
} halias[] = {
|
||||
/* We sort the list below via: sort -d -u */
|
||||
{"=", "address"},
|
||||
{"->", "arrow"},
|
||||
{"=", "assign"},
|
||||
{"*", "dereference"},
|
||||
{".", "oldvalue"},
|
||||
{"%", "mod"},
|
||||
{"//", "quo"},
|
||||
{".", "oldvalue"},
|
||||
{"#", "pound"},
|
||||
{"calc", "help"},
|
||||
{"//", "quo"},
|
||||
{"COPYING_LGPL", "COPYING-LGPL"},
|
||||
{"COPYLEFT", "copyright"},
|
||||
{"COPYRIGHT", "copyright"},
|
||||
{"Copyleft", "copyright"},
|
||||
{"Copyright", "copyright"},
|
||||
{"abort", "command"},
|
||||
{"cd", "command"},
|
||||
{"copy", "blkcpy"},
|
||||
{"copying", "COPYING"},
|
||||
{"copying-lgpl", "COPYING-LGPL"},
|
||||
{"copying_lgpl", "COPYING-LGPL"},
|
||||
{"COPYING_LGPL", "COPYING-LGPL"},
|
||||
{"Copyright", "copyright"},
|
||||
{"COPYRIGHT", "copyright"},
|
||||
{"Copyleft", "copyright"},
|
||||
{"COPYLEFT", "copyright"},
|
||||
{"define", "command"},
|
||||
{"read", "command"},
|
||||
{"write", "command"},
|
||||
{"quit", "command"},
|
||||
{"exit", "command"},
|
||||
{"abort", "command"},
|
||||
{"cd", "command"},
|
||||
{"show", "command"},
|
||||
{"stdlib", "resource"},
|
||||
{"question", "questions"},
|
||||
{"dm2d", "dms2d"},
|
||||
{"exit", "command"},
|
||||
{"gm2g", "gms2g"},
|
||||
{"hm2d", "hms2d"},
|
||||
{"man", "calc"},
|
||||
{"question", "questions"},
|
||||
{"quit", "command"},
|
||||
{"read", "command"},
|
||||
{"release", "releases"},
|
||||
{"show", "command"},
|
||||
{"stdlib", "resource"},
|
||||
{"usage", "calc"},
|
||||
{"write", "command"},
|
||||
|
||||
/* MUST BE LAST! */
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
@@ -118,76 +118,65 @@ V=@:
|
||||
# Files managed by this Makefile #
|
||||
##################################
|
||||
|
||||
STD_HELP_FILES_1= intro overview help
|
||||
STD_HELP_FILES_1= intro overview
|
||||
BLT_HELP_FILES_1a= calc
|
||||
|
||||
STD_HELP_FILES_2= assoc
|
||||
|
||||
BLT_HELP_FILES_3= builtin man
|
||||
|
||||
STD_HELP_FILES_4= command config custom define environment expression
|
||||
|
||||
BLT_HELP_FILES_3= builtin
|
||||
STD_HELP_FILES_4= command config custom define environment
|
||||
BLT_HELP_FILES_5= errorcodes
|
||||
|
||||
STD_HELP_FILES_6= file history interrupt list mat
|
||||
|
||||
STD_HELP_FILES_6= expression file history interrupt list mat
|
||||
# because obj is built special (due to confusion with it as
|
||||
# a symlink for some built environments, we treat obj specially
|
||||
# and call it obj.file
|
||||
#
|
||||
SPECIAL_HELP_7= obj.file
|
||||
|
||||
STD_HELP_FILES_8= operator statement
|
||||
|
||||
STD_HELP_FILES_8= operator
|
||||
BLT_HELP_FILES_9= resource
|
||||
STD_HELP_FILES_10= script statement types unexpected variable
|
||||
|
||||
STD_HELP_FILES_10= types script
|
||||
|
||||
BLT_HELP_FILES_10a= usage cscript
|
||||
|
||||
STD_HELP_FILES_10b= unexpected variable
|
||||
|
||||
BLT_HELP_FILES_11= bindings custom_cal libcalc new_custom resource
|
||||
BLT_HELP_FILES_11= bindings custom_cal libcalc new_custom cscript
|
||||
|
||||
STD_HELP_FILES_12= archive
|
||||
BLT_HELP_FILES_13= bugs changes contrib
|
||||
STD_HELP_FILES_14= todo wishlist
|
||||
|
||||
BLT_HELP_FILES_13= bugs changes
|
||||
STD_HELP_FILES_15= credit
|
||||
# copyright is printed by help.c is from the Copyright string found in version.c
|
||||
BLT_HELP_FILES_16= COPYING COPYING-LGPL questions releases
|
||||
|
||||
STD_HELP_FILES_14= credit
|
||||
|
||||
BLT_HELP_FILES_14= contrib COPYING COPYING-LGPL questions releases
|
||||
|
||||
STD_HELP_FILES_15= wishlist todo
|
||||
STD_HELP_FILES_17= help
|
||||
|
||||
# These files are used in the following order to construct full
|
||||
#
|
||||
FULL_HELP_FILES= ${STD_HELP_FILES_1} ${STD_HELP_FILES_2} \
|
||||
FULL_HELP_FILES= ${STD_HELP_FILES_1} ${BLT_HELP_FILES_1a} \
|
||||
${STD_HELP_FILES_2} \
|
||||
${BLT_HELP_FILES_3} ${STD_HELP_FILES_4} \
|
||||
${BLT_HELP_FILES_5} ${STD_HELP_FILES_6} \
|
||||
${SPECIAL_HELP_7} ${STD_HELP_FILES_8} \
|
||||
${BLT_HELP_FILES_9} ${STD_HELP_FILES_10} \
|
||||
${BLT_HELP_FILES_10a} ${STD_HELP_FILES_10b} \
|
||||
${BLT_HELP_FILES_11} ${STD_HELP_FILES_12} \
|
||||
${BLT_HELP_FILES_13} ${STD_HELP_FILES_14} \
|
||||
${BLT_HELP_FILES_14} ${STD_HELP_FILES_15}
|
||||
${STD_HELP_FILES_15} ${BLT_HELP_FILES_16} \
|
||||
${STD_HELP_FILES_17}
|
||||
|
||||
# These full files are those who are not built or constructed
|
||||
#
|
||||
STD_HELP_FILES= ${STD_HELP_FILES_1} ${STD_HELP_FILES_2} \
|
||||
${STD_HELP_FILES_4} ${STD_HELP_FILES_6} \
|
||||
${STD_HELP_FILES_8} ${STD_HELP_FILES_10} \
|
||||
${STD_HELP_FILES_10b} \
|
||||
${STD_HELP_FILES_12} ${STD_HELP_FILES_14} \
|
||||
${STD_HELP_FILES_15}
|
||||
${STD_HELP_FILES_15} ${STD_HELP_FILES_17}
|
||||
|
||||
# These full files are those who are built by this Makefile
|
||||
#
|
||||
# Note that ${SPECIAL_HELP_7} is not included in this list
|
||||
# because of problems with its name.
|
||||
#
|
||||
BLT_HELP_FILES= ${BLT_HELP_FILES_3} ${BLT_HELP_FILES_5} \
|
||||
${BLT_HELP_FILES_9} \
|
||||
${BLT_HELP_FILES_10a} \
|
||||
${BLT_HELP_FILES_11} ${BLT_HELP_FILES_13} \
|
||||
${BLT_HELP_FILES_14}
|
||||
BLT_HELP_FILES= ${BLT_HELP_FILES_1a} \
|
||||
${BLT_HELP_FILES_3} ${BLT_HELP_FILES_5} \
|
||||
${BLT_HELP_FILES_9} ${BLT_HELP_FILES_11} \
|
||||
${BLT_HELP_FILES_13} ${BLT_HELP_FILES_16}
|
||||
|
||||
# The detailed list of help files to install
|
||||
#
|
||||
@@ -382,7 +371,7 @@ errorcodes: ../errcode${EXT}
|
||||
${TRUE}; \
|
||||
fi
|
||||
|
||||
usage: ../calc.usage
|
||||
calc: ../calc.usage
|
||||
${RM} -f $@
|
||||
${CP} ../calc.usage $@
|
||||
${CHMOD} 0444 $@
|
||||
@@ -433,18 +422,6 @@ copy: blkcpy
|
||||
${TRUE}; \
|
||||
fi
|
||||
|
||||
man: help
|
||||
${RM} -f $@
|
||||
${CP} help $@
|
||||
${CHMOD} 0444 $@
|
||||
-@if [ -z "${Q}" ]; then \
|
||||
echo ''; \
|
||||
echo '=-=-= skipping the ${CAT} of help/$@ =-=-='; \
|
||||
echo ''; \
|
||||
else \
|
||||
${TRUE}; \
|
||||
fi
|
||||
|
||||
COPYING: ../COPYING
|
||||
${RM} -f $@
|
||||
${CP} ../COPYING $@
|
||||
@@ -698,7 +675,7 @@ clean:
|
||||
${RM} -f COPYING COPYING-LGPL questions
|
||||
|
||||
clobber: clean
|
||||
${RM} -f ${BLT_HELP_FILES} full .all calc
|
||||
${RM} -f ${BLT_HELP_FILES} full .all calc man usage
|
||||
${RM} -f ${SINGULAR_FILES} ${DETAIL_CLONE}
|
||||
-${Q} if [ -e .DS_Store ]; then \
|
||||
echo ${RM} -rf .DS_Store; \
|
||||
@@ -766,6 +743,14 @@ install: all
|
||||
${RM} -f ${T}${HELPDIR}/md5; \
|
||||
echo "removed old ${T}${HELPDIR}/md5"; \
|
||||
fi;
|
||||
-${Q} if [ -f "${T}${HELPDIR}/man" ]; then \
|
||||
${RM} -f ${T}${HELPDIR}/man; \
|
||||
echo "removed old ${T}${HELPDIR}/man"; \
|
||||
fi;
|
||||
-${Q} if [ -f "${T}${HELPDIR}/usage" ]; then \
|
||||
${RM} -f ${T}${HELPDIR}/usage; \
|
||||
echo "removed old ${T}${HELPDIR}/usage"; \
|
||||
fi;
|
||||
|
||||
# Try to remove everything that was installed
|
||||
#
|
||||
|
10
help/help
10
help/help
@@ -5,7 +5,7 @@ following topics:
|
||||
----- -----------
|
||||
intro introduction to calc
|
||||
overview overview of calc
|
||||
help this file
|
||||
calc calc man page, how to invoke the calc command
|
||||
|
||||
assoc using associations
|
||||
builtin builtin functions
|
||||
@@ -13,7 +13,7 @@ following topics:
|
||||
config configuration parameters
|
||||
custom information about the custom builtin interface
|
||||
define how to define functions
|
||||
environment how environment variables effect calc
|
||||
environment how environment variables affect calc
|
||||
errorcodes calc generated error codes
|
||||
expression expression sequences
|
||||
file using files
|
||||
@@ -23,18 +23,17 @@ following topics:
|
||||
mat using matrices
|
||||
obj user defined data types
|
||||
operator math, relational, logic and variable access operators
|
||||
resource standard calc resource files
|
||||
script using calc shell scripts
|
||||
statement flow control and declaration statements
|
||||
types builtin data types
|
||||
unexpected unexpected syntax/usage surprises for C programmers
|
||||
usage how to invoke the calc command
|
||||
variable variables and variable declarations
|
||||
|
||||
bindings input & history character bindings
|
||||
custom_cal information about custom calc resource files
|
||||
libcalc using the arbitrary precision routines in a C program
|
||||
new_custom information about how to add new custom functions
|
||||
resource standard calc resource files
|
||||
script using calc shell scripts
|
||||
cscript info on the calc shell scripts supplied with calc
|
||||
|
||||
archive where to get the latest versions of calc
|
||||
@@ -51,6 +50,7 @@ following topics:
|
||||
questions how to ask simple general question about calc
|
||||
release on calc versions and releases
|
||||
|
||||
help this file
|
||||
full all of the above (in the above order)
|
||||
|
||||
For example:
|
||||
|
@@ -1,5 +1,5 @@
|
||||
NAME
|
||||
log2 - base 10 logarithm
|
||||
log2 - base 2 logarithm
|
||||
|
||||
SYNOPSIS
|
||||
log2(x [,eps])
|
||||
|
37
help/prompt
37
help/prompt
@@ -15,6 +15,39 @@ DESCRIPTION
|
||||
read from the input; the string formed by the characters in the line
|
||||
(other than the newline) is returned as the value of prompt().
|
||||
|
||||
Be careful when using prompt(str) while calc is being used as a
|
||||
shell script. Unless calc is run with the -p command line option,
|
||||
the prompt builtin will fail and return null. This is because when
|
||||
calc is running as a shell script, calc will close stdin run in in
|
||||
a non-interactive mode.
|
||||
|
||||
The following shell script will always print "got null" because
|
||||
stdin will be closed by calc during startup:
|
||||
|
||||
#!/usr/bin/calc -q -f
|
||||
|
||||
# The prompt will ALWAYS FAIL and return a null value
|
||||
n = prompt("Test> ");
|
||||
if (isnull(n)) {
|
||||
print("got null");
|
||||
} else {
|
||||
print("got " + n);
|
||||
}
|
||||
|
||||
However the following shell script (note the -p before the -f in
|
||||
the 1st line) will be interactive, prompt with "Test> " and print
|
||||
the "got" result as expected:
|
||||
|
||||
#!/usr/bin/calc -q -p -f
|
||||
|
||||
n = prompt("Test> ");
|
||||
if (isnull(n)) {
|
||||
print("got null");
|
||||
} else {
|
||||
print("got " + n);
|
||||
}
|
||||
|
||||
|
||||
EXAMPLE
|
||||
; x = prompt("? ");
|
||||
? 273
|
||||
@@ -35,9 +68,9 @@ LINK LIBRARY
|
||||
none
|
||||
|
||||
SEE ALSO
|
||||
fgetfield, fgetline, fgetstr
|
||||
command, fgetfield, fgetline, fgetstr, unexpected
|
||||
|
||||
## Copyright (C) 1999-2006 Landon Curt Noll
|
||||
## Copyright (C) 1999,2006,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
|
||||
|
@@ -563,6 +563,7 @@ Unexpected
|
||||
; print sin(d2r(30))
|
||||
0.5
|
||||
|
||||
|
||||
* operator has has a higher precedence than <<
|
||||
==============================================
|
||||
|
||||
@@ -570,6 +571,49 @@ Unexpected
|
||||
So 3 << 2*5 evaluates to 3072 in C, whereas 3 << 2*5 evaluates to 60 in calc.
|
||||
|
||||
|
||||
prompt builtin returns null in calc shell scripts unless -p is used
|
||||
===================================================================
|
||||
|
||||
Be careful when using prompt(str) while calc is being used as a
|
||||
shell script. Unless calc is run with the -p command line option,
|
||||
the prompt builtin will fail and return null. This is because when
|
||||
calc is running as a shell script, calc will close stdin run in in
|
||||
a non-interactive mode.
|
||||
|
||||
The following shell script will always print "got null" because
|
||||
stdin will be closed by calc during startup:
|
||||
|
||||
#!/usr/bin/calc -q -f
|
||||
|
||||
n = prompt("Test> ");
|
||||
if (isnull(n)) {
|
||||
print("got null");
|
||||
} else {
|
||||
print("got " + n);
|
||||
}
|
||||
|
||||
However the following shell script (note the -p before the -f in
|
||||
the 1st line) will be interactive, prompt with "Test> " and print
|
||||
the "got" result as expected:
|
||||
|
||||
#!/usr/bin/calc -q -p -f
|
||||
|
||||
n = prompt("Test> ");
|
||||
if (isnull(n)) {
|
||||
print("got null");
|
||||
} else {
|
||||
print("got " + n);
|
||||
}
|
||||
|
||||
Note in the example above, the -p flag must be given before the
|
||||
final -f command line flag.
|
||||
|
||||
A similar problem will occur if the calc shell script attempts
|
||||
to read from standard input (stdin), unless the -p flag is used.
|
||||
|
||||
See "SHELL SCRIPT MODE" in the calc man page for more information
|
||||
about -p and about the "shell script mode".
|
||||
|
||||
## Copyright (C) 1999-2007,2014,2017,2021,2023 Landon Curt Noll
|
||||
##
|
||||
## Calc is open software; you can redistribute it and/or modify it under
|
||||
|
56
hist.c
56
hist.c
@@ -73,6 +73,8 @@
|
||||
#include "banned.h" /* include after system header <> includes */
|
||||
|
||||
|
||||
#define MIN(a,b) (((a) <= (b)) ? (a) : (b))
|
||||
|
||||
#if !defined(USE_READLINE)
|
||||
|
||||
E_FUNC FILE *curstream(void);
|
||||
@@ -1474,18 +1476,24 @@ quit_calc(int UNUSED(ch))
|
||||
* For hist_getline() we have to add a newline that readline removed but
|
||||
* calc expects. For hist_saveline(), we have to undo this. hist_getline()
|
||||
* also has to cope with the different memory management schemes of calc and
|
||||
* readline.
|
||||
* readline (pointer to target buffer passed to hist_getline() vs. returned
|
||||
* malloc()ed buffer from readline()). While doing that, we also split
|
||||
* multi-line strings potentially returned by readline() in case of
|
||||
* bracketed paste mode even though its documentation promises to only return
|
||||
* single lines. For details, see https://github.com/lcn2/calc/issues/138
|
||||
* and https://lists.gnu.org/archive/html/bug-readline/2024-01/msg00000.html
|
||||
*/
|
||||
|
||||
|
||||
size_t
|
||||
hist_getline(char *prompt, char *buf, size_t len)
|
||||
{
|
||||
char *line;
|
||||
STATIC char *rlbuf, *rlcur;
|
||||
|
||||
if (!rlbuf) {
|
||||
rlbuf = rlcur = readline(prompt);
|
||||
if (!rlbuf) {
|
||||
buf[0] = '\0';
|
||||
line = readline(prompt);
|
||||
if (!line) {
|
||||
switch (conf->ctrl_d) {
|
||||
case CTRL_D_NEVER_EOF:
|
||||
return 0;
|
||||
@@ -1496,13 +1504,39 @@ hist_getline(char *prompt, char *buf, size_t len)
|
||||
not_reached();
|
||||
}
|
||||
}
|
||||
strlcpy(buf, line, len);
|
||||
buf[len - 2] = '\0';
|
||||
len = strlen(buf);
|
||||
buf[len] = '\n';
|
||||
buf[len + 1] = '\0';
|
||||
free(line);
|
||||
return len + 1;
|
||||
}
|
||||
|
||||
/* eol: pointer to trailing newline (if there is one) or \0 */
|
||||
char *eol = strchr(rlcur, '\n');
|
||||
if (!eol) {
|
||||
eol = rlcur + strlen(rlcur);
|
||||
}
|
||||
/* len: length of line in target buffer including (possibly added)
|
||||
* newline, truncated if buffer is too small. Note that we reduce
|
||||
* the available buffer size by 1 so that we can safely add the
|
||||
* newline below.
|
||||
*/
|
||||
len = MIN(len - 1, (size_t)(eol - rlcur + 1));
|
||||
strlcpy(buf, rlcur, len);
|
||||
/* make sure we have a newline and NUL */
|
||||
buf[len - 1] = '\n';
|
||||
buf[len] = '\0';
|
||||
|
||||
/* skip over newline in readline buffer */
|
||||
if (*eol) {
|
||||
eol++;
|
||||
}
|
||||
/* prepare for next invocation: point to next line or free readline
|
||||
* buffer if we've reached EOL
|
||||
*/
|
||||
if (*eol) {
|
||||
rlcur = eol;
|
||||
} else {
|
||||
free(rlbuf);
|
||||
rlbuf = rlcur = NULL;
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
|
2
qfunc.c
2
qfunc.c
@@ -1953,7 +1953,7 @@ qispowerof2(NUMBER *q, NUMBER **qlog2)
|
||||
* Set *qlog2 to base 2 logarithm of q, which will be a negative value,
|
||||
* and return true.
|
||||
*/
|
||||
*qlog2 = utoq(log2);
|
||||
**qlog2 = *utoq(log2);
|
||||
(*qlog2)->num.sign = !(*qlog2)->num.sign; /* set *qlog2 to -log2 */
|
||||
return true;
|
||||
}
|
||||
|
33
trailblank
33
trailblank
@@ -182,8 +182,8 @@ PICKY_PHASE_1=$(
|
||||
-name '.git' -o -path './custom/libcustcalc*' -o -path './libcustcalc*' -o \
|
||||
-name 'sample_many-static' -o -name 'sample_rand-static' -o \
|
||||
-name 'codeql-analysis.yml' -o -name tags -o -name '*.out' -o \
|
||||
-name '?' -o -iname '*foo*' -o -iname '*bar*' -o -iname '*baz*' -o \
|
||||
-iname '*curds*' -o -iname '*whey*' -o -iname '*rmme*' \
|
||||
-iname '*foo*' -o -iname '*bar*' -o -iname '*baz*' -o \
|
||||
-name '.lldbinit' -o -iname '*curds*' -o -iname '*whey*' -o -iname '*rmme*' \
|
||||
\) -prune -o -type f -print0 | \
|
||||
if [[ -x /usr/local/bin/picky ]]; then
|
||||
xargs -0 /usr/local/bin/picky -s -v -w132
|
||||
@@ -218,6 +218,35 @@ if [[ -n $BACKUP_MAKEILES ]]; then
|
||||
EXIT_CODE=7
|
||||
fi
|
||||
|
||||
|
||||
# look for ASCII tabs in non-Makefiles
|
||||
#
|
||||
TABS_FOUND=$(
|
||||
find . \( -path './NOTES' -o -path './calc' -o -path './ver_calc' -o \
|
||||
-name '*.o' -o -name '*.a' -o -name '*ptch*' -o -name 'core*' -o \
|
||||
-name '*.orig' -o -name '*.rej' -o -name '*.bak' -o \
|
||||
-name '*.ptch' -o -name 'core.*' -o \
|
||||
-name '*.so*' -o -name 'calc-static' -o -name 'libcalc.*' -o \
|
||||
-name 'sample_many' -o -name 'sample_rand' -o -name 'errcode' -o \
|
||||
-path './help/funclist' -o -path './have_stdvs' -o \
|
||||
-path './endian' -o -path './no_implicit' -o -name 'chk_c' -o \
|
||||
-path './longbits' -o -name '.*.swp' -o -name 'conf.h' -o \
|
||||
-name '.git' -o -path './custom/libcustcalc*' -o -path './libcustcalc*' -o \
|
||||
-name 'sample_many-static' -o -name 'sample_rand-static' -o \
|
||||
-name 'codeql-analysis.yml' -o -name tags -o -name '*.out' -o \
|
||||
-iname '*foo*' -o -iname '*bar*' -o -iname '*baz*' -o \
|
||||
-name '.lldbinit' -o -iname '*curds*' -o -iname '*whey*' -o -iname '*rmme*' -o \
|
||||
-iname 'Makefile*' -o -name rpm.mk -o -name 'trailblank' \
|
||||
\) -prune -o -type f -print0 | \
|
||||
xargs -0 grep -l -E ' '
|
||||
)
|
||||
if [[ -n $TABS_FOUND ]]; then
|
||||
echo
|
||||
echo '# ASCII TABs found in non-Makefiles:'
|
||||
echo "$TABS_FOUND"
|
||||
EXIT_CODE=8
|
||||
fi
|
||||
|
||||
# All Done!!! -- Jessica Noll, Age 2
|
||||
#
|
||||
exit "$EXIT_CODE"
|
||||
|
30
update_ver
30
update_ver
@@ -169,6 +169,7 @@ for i in $MK_SET1; do
|
||||
echo "$i: $VER_STRING"
|
||||
fi
|
||||
done
|
||||
echo
|
||||
if [[ -n $VER_ERR ]]; then
|
||||
echo "$0: FATAL: error in finding calc major version string"
|
||||
echo "$0: FATAL: exit 10"
|
||||
@@ -177,15 +178,36 @@ fi
|
||||
|
||||
# print other useful calc strings
|
||||
#
|
||||
export VER_CALC_OUTPUT=$(./ver_calc)
|
||||
echo 'Begin text strings used to produce this release:'
|
||||
echo 'vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv'
|
||||
echo
|
||||
echo "calc $(./ver_calc) release"
|
||||
echo
|
||||
echo 'calc-*'$(./ver_calc)'*'
|
||||
echo
|
||||
echo "Release v$(./ver_calc)"
|
||||
echo "$VER_CALC_OUTPUT"
|
||||
echo
|
||||
echo "v$VER_CALC_OUTPUT"
|
||||
echo
|
||||
echo "Release v$VER_CALC_OUTPUT"
|
||||
echo
|
||||
echo "calc $VER_CALC_OUTPUT release"
|
||||
echo
|
||||
echo 'For use with sourceforge.net:'
|
||||
echo
|
||||
echo 'cd /home/pfs/project/calc/calc'
|
||||
echo "mkdir $VER_CALC_OUTPUT"
|
||||
echo "cd $VER_CALC_OUTPUT"
|
||||
echo 'mput calc-*'"$VER_CALC_OUTPUT"'*'
|
||||
echo 'put /home/chongo/tmp/README.txt'
|
||||
echo 'ls'
|
||||
echo
|
||||
echo
|
||||
echo
|
||||
echo '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'
|
||||
echo 'End text strings used to produce this release:'
|
||||
echo
|
||||
|
||||
# All Done!!! -- Jessica Noll, Age 2
|
||||
#
|
||||
echo
|
||||
echo "VERSION in Makefile.config is up to date"
|
||||
exit 0
|
||||
|
@@ -80,7 +80,13 @@ char *Copyright = "\n"
|
||||
"\n"
|
||||
"Calc is open software; you can redistribute it and/or modify it under\n"
|
||||
"the terms of the version 2.1 of the GNU Lesser General Public License\n"
|
||||
"as published by the Free Software Foundation.\n";
|
||||
"as published by the Free Software Foundation.\n"
|
||||
"\n"
|
||||
"Please see the file COPYING, or use the calc command:\n"
|
||||
"\n"
|
||||
"\thelp copying\n"
|
||||
"\n"
|
||||
"for important copyright and license information!\n";
|
||||
char *Usability = "\n"
|
||||
"Calc is distributed in the hope that it will be useful, but WITHOUT\n"
|
||||
"ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n"
|
||||
|
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* version - determine the version of calc
|
||||
*
|
||||
* Copyright (C) 2023 David I. Bell and Landon Curt Noll
|
||||
* Copyright (C) 1989-2025 David I. Bell and 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
|
||||
@@ -63,7 +63,7 @@
|
||||
*/
|
||||
#define MAJOR_VER 2 /* level 1: major library version */
|
||||
#define MINOR_VER 15 /* level 2: minor library version */
|
||||
#define MAJOR_PATCH 0 /* level 3: major software version level */
|
||||
#define MAJOR_PATCH 1 /* level 3: major software version level */
|
||||
#define MINOR_PATCH 2 /* level 4: minor software version level */
|
||||
|
||||
|
||||
|
18
zmath.h
18
zmath.h
@@ -79,7 +79,7 @@ typedef USB64 FULL; /* double unit of number storage */
|
||||
typedef SB64 SFULL; /* signed FULL */
|
||||
|
||||
#define SWAP_HALF_IN_B64(dest, src) SWAP_B32_IN_B64(dest, src)
|
||||
#define SWAP_HALF_IN_B32(dest, src) (*(dest) = *(src))
|
||||
#define SWAP_HALF_IN_B32(dest, src) (*((HALF *)(dest)) = *((HALF *)(src)))
|
||||
#define SWAP_HALF_IN_FULL(dest, src) SWAP_B32_IN_B64(dest, src)
|
||||
#define SWAP_HALF_IN_HASH(dest, src) SWAP_B16_IN_HASH(dest, src)
|
||||
#define SWAP_HALF_IN_FLAG(dest, src) SWAP_B16_IN_FLAG(dest, src)
|
||||
@@ -106,9 +106,9 @@ typedef SB32 SFULL; /* signed FULL */
|
||||
#define SWAP_HALF_IN_FLAG(dest, src) SWAP_B16_IN_FLAG(dest, src)
|
||||
#define SWAP_HALF_IN_bool(dest, src) SWAP_B16_IN_bool(dest, src)
|
||||
#define SWAP_HALF_IN_LEN(dest, src) SWAP_B16_IN_LEN(dest, src)
|
||||
#define SWAP_B32_IN_FULL(dest, src) (*(dest) = *(src))
|
||||
#define SWAP_B32_IN_FULL(dest, src) (*((FULL *)(dest)) = *((FULL *)(src)))
|
||||
#define SWAP_B16_IN_FULL(dest, src) SWAP_B16_IN_B32(dest, src)
|
||||
#define SWAP_B16_IN_HALF(dest, src) (*(dest) = *(src))
|
||||
#define SWAP_B16_IN_HALF(dest, src) (*((HALF *)(dest)) = *((HALF *)(src)))
|
||||
#define SWAP_B8_IN_FULL(dest, src) SWAP_B8_IN_B32(dest, src)
|
||||
#define SWAP_B8_IN_HALF(dest, src) SWAP_B8_IN_B16(dest, src)
|
||||
|
||||
@@ -171,19 +171,11 @@ typedef SB32 LEN; /* calc v2 compatible unit of length storage */
|
||||
typedef uintptr_t LEN; /* unit of length storage */
|
||||
#endif /* MAJOR_VER < 3 */
|
||||
|
||||
#define SWAP_B32_IN_HASH(dest, src) (*(dest) = *(src))
|
||||
#define SWAP_B16_IN_HASH(dest, src) SWAP_B16_IN_B32(dest, src)
|
||||
#define SWAP_B8_IN_HASH(dest, src) SWAP_B8_IN_B32(dest, src)
|
||||
|
||||
#define SWAP_B32_IN_FLAG(dest, src) (*(dest) = *(src))
|
||||
#define SWAP_B16_IN_FLAG(dest, src) SWAP_B16_IN_B32(dest, src)
|
||||
#define SWAP_B8_IN_FLAG(dest, src) SWAP_B8_IN_B32(dest, src)
|
||||
|
||||
#define SWAP_B32_IN_bool(dest, src) (*(dest) = *(src))
|
||||
#define SWAP_B32_IN_bool(dest, src) (*((bool *)(dest)) = *((bool *)(src)))
|
||||
#define SWAP_B16_IN_bool(dest, src) SWAP_B16_IN_B32(dest, src)
|
||||
#define SWAP_B8_IN_bool(dest, src) SWAP_B8_IN_B32(dest, src)
|
||||
|
||||
#define SWAP_B32_IN_LEN(dest, src) (*(dest) = *(src))
|
||||
#define SWAP_B32_IN_LEN(dest, src) (*((LEN *)(dest)) = *((LEN *)(src)))
|
||||
#define SWAP_B16_IN_LEN(dest, src) SWAP_B16_IN_B32(dest, src)
|
||||
#define SWAP_B8_IN_LEN(dest, src) SWAP_B8_IN_B32(dest, src)
|
||||
|
||||
|
Reference in New Issue
Block a user