Merge e2f90ed395
into 4c84a88471
This commit is contained in:
commit
8da8960876
18
Makefile.in
18
Makefile.in
|
@ -1,7 +1,7 @@
|
|||
# Makefile.in generated by automake 1.15.1 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.16.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -115,7 +115,7 @@ am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
|||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
depcomp =
|
||||
am__depfiles_maybe =
|
||||
am__maybe_remake_depfiles =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
|
||||
|
@ -138,7 +138,7 @@ am__recursive_targets = \
|
|||
$(RECURSIVE_CLEAN_TARGETS) \
|
||||
$(am__extra_recursive_targets)
|
||||
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
|
||||
cscope distdir dist dist-all distcheck
|
||||
cscope distdir distdir-am dist dist-all distcheck
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
|
||||
$(LISP)config.h.in
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
|
@ -307,6 +307,7 @@ pdfdir = @pdfdir@
|
|||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
|
@ -347,8 +348,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
|
@ -481,7 +482,10 @@ distclean-tags:
|
|||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
test -d "$(distdir)" || mkdir "$(distdir)"
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
|
|
|
@ -159,7 +159,7 @@ The ```make install``` target installs OST to the configured location, and ```ma
|
|||
## License
|
||||
|
||||
The developer of the original code and/or files is Tripwire, Inc.
|
||||
Portions created by Tripwire, Inc. are copyright 2000-2018 Tripwire, Inc.
|
||||
Portions created by Tripwire, Inc. are copyright 2000-2019 Tripwire, Inc.
|
||||
Tripwire is a registered trademark of Tripwire, Inc. All rights reserved.
|
||||
|
||||
This program is free software. The contents of this file are subject to the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. You may redistribute it and/or modify it only in compliance with the GNU General Public License.
|
||||
|
|
|
@ -2,7 +2,7 @@ TRIPWIRE COPYRIGHT & TRADEMARK NOTICE
|
|||
|
||||
COPYRIGHT
|
||||
The developer of the original code and/or files is Tripwire, Inc. Portions
|
||||
created by Tripwire, Inc. are copyright 2000-2018 Tripwire, Inc.
|
||||
created by Tripwire, Inc. are copyright 2000-2019 Tripwire, Inc.
|
||||
|
||||
TRADEMARK
|
||||
Tripwire is a registered trademark (the "Trademark") of Tripwire, Inc. All
|
||||
|
|
102
acinclude.m4
102
acinclude.m4
|
@ -1,24 +1,78 @@
|
|||
# Custom m4 macros for Open Source Tripwire 2.4.3
|
||||
# a non-symlinky variant of AC_PROG_LN_S, via: http://www.opensource.apple.com/source/zsh/zsh-34/zsh/aclocal.m4
|
||||
#
|
||||
AC_DEFUN([AC_PROG_LN],
|
||||
[AC_MSG_CHECKING(whether ln works)
|
||||
AC_CACHE_VAL(ac_cv_prog_LN,
|
||||
[rm -f conftestdata conftestlink
|
||||
echo > conftestdata
|
||||
if ln conftestdata conftestlink 2>/dev/null
|
||||
then
|
||||
rm -f conftestdata conftestlink
|
||||
ac_cv_prog_LN="ln"
|
||||
else
|
||||
rm -f conftestdata
|
||||
ac_cv_prog_LN="cp"
|
||||
fi])dnl
|
||||
LN="$ac_cv_prog_LN"
|
||||
if test "$ac_cv_prog_LN" = "ln"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AC_SUBST(LN)dnl
|
||||
])
|
||||
# Custom m4 macros for Open Source Tripwire 2.4.3
|
||||
|
||||
# a non-symlinky variant of AC_PROG_LN_S, via: http://www.opensource.apple.com/source/zsh/zsh-34/zsh/aclocal.m4
|
||||
#
|
||||
AC_DEFUN([AC_PROG_LN],
|
||||
[AC_MSG_CHECKING(whether ln works)
|
||||
AC_CACHE_VAL(ac_cv_prog_LN,
|
||||
[rm -f conftestdata conftestlink
|
||||
echo > conftestdata
|
||||
if ln conftestdata conftestlink 2>/dev/null
|
||||
then
|
||||
rm -f conftestdata conftestlink
|
||||
ac_cv_prog_LN="ln"
|
||||
else
|
||||
rm -f conftestdata
|
||||
ac_cv_prog_LN="cp"
|
||||
fi])dnl
|
||||
LN="$ac_cv_prog_LN"
|
||||
if test "$ac_cv_prog_LN" = "ln"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AC_SUBST(LN)dnl
|
||||
])
|
||||
|
||||
# ===========================================================================
|
||||
# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
|
||||
# ===========================================================================
|
||||
#
|
||||
# SYNOPSIS
|
||||
#
|
||||
# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
|
||||
#
|
||||
# DESCRIPTION
|
||||
#
|
||||
# Check whether the given FLAG works with the current language's compiler
|
||||
# or gives an error. (Warnings, however, are ignored)
|
||||
#
|
||||
# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
|
||||
# success/failure.
|
||||
#
|
||||
# If EXTRA-FLAGS is defined, it is added to the current language's default
|
||||
# flags (e.g. CFLAGS) when the check is done. The check is thus made with
|
||||
# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
|
||||
# force the compiler to issue an error when a bad flag is given.
|
||||
#
|
||||
# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
|
||||
#
|
||||
# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
|
||||
# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
|
||||
#
|
||||
# LICENSE
|
||||
#
|
||||
# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
|
||||
# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
|
||||
#
|
||||
# Copying and distribution of this file, with or without modification, are
|
||||
# permitted in any medium without royalty provided the copyright notice
|
||||
# and this notice are preserved. This file is offered as-is, without any
|
||||
# warranty.
|
||||
|
||||
AC_DEFUN([AX_CHECK_COMPILE_FLAG],
|
||||
[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
|
||||
AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
|
||||
AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
|
||||
ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
|
||||
_AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
|
||||
AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
|
||||
[AS_VAR_SET(CACHEVAR,[yes])],
|
||||
[AS_VAR_SET(CACHEVAR,[no])])
|
||||
_AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
|
||||
AS_VAR_IF(CACHEVAR,yes,
|
||||
[m4_default([$2], :)],
|
||||
[m4_default([$3], :)])
|
||||
AS_VAR_POPDEF([CACHEVAR])dnl
|
||||
])dnl AX_CHECK_COMPILE_FLAGS
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
|
||||
# generated automatically by aclocal 1.16.1 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
|
||||
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
|
|||
If you have problems, you may need to regenerate the build system entirely.
|
||||
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
|
||||
|
||||
# Copyright (C) 2002-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2002-2018 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
|
|||
# generated from the m4 files accompanying Automake X.Y.
|
||||
# (This private macro should not be called outside this file.)
|
||||
AC_DEFUN([AM_AUTOMAKE_VERSION],
|
||||
[am__api_version='1.15'
|
||||
[am__api_version='1.16'
|
||||
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
|
||||
dnl require some minimum version. Point them to the right macro.
|
||||
m4_if([$1], [1.15.1], [],
|
||||
m4_if([$1], [1.16.1], [],
|
||||
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
|
||||
])
|
||||
|
||||
|
@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
|
|||
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
|
||||
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
|
||||
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
||||
[AM_AUTOMAKE_VERSION([1.15.1])dnl
|
||||
[AM_AUTOMAKE_VERSION([1.16.1])dnl
|
||||
m4_ifndef([AC_AUTOCONF_VERSION],
|
||||
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
|
||||
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
|
||||
|
||||
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -110,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
|
|||
|
||||
# AM_CONDITIONAL -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1997-2018 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -141,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
|
|||
Usually this means the macro was only invoked conditionally.]])
|
||||
fi])])
|
||||
|
||||
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -332,13 +332,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
|
|||
|
||||
# Generate code to set up dependency tracking. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
|
||||
# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
# ------------------------------
|
||||
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
|
@ -346,49 +345,41 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
|
|||
# Older Autoconf quotes --file arguments for eval, but not when files
|
||||
# are listed without --file. Let's play safe and only enable the eval
|
||||
# if we detect the quoting.
|
||||
case $CONFIG_FILES in
|
||||
*\'*) eval set x "$CONFIG_FILES" ;;
|
||||
*) set x $CONFIG_FILES ;;
|
||||
esac
|
||||
# TODO: see whether this extra hack can be removed once we start
|
||||
# requiring Autoconf 2.70 or later.
|
||||
AS_CASE([$CONFIG_FILES],
|
||||
[*\'*], [eval set x "$CONFIG_FILES"],
|
||||
[*], [set x $CONFIG_FILES])
|
||||
shift
|
||||
for mf
|
||||
# Used to flag and report bootstrapping failures.
|
||||
am_rc=0
|
||||
for am_mf
|
||||
do
|
||||
# Strip MF so we end up with the name of the file.
|
||||
mf=`echo "$mf" | sed -e 's/:.*$//'`
|
||||
# Check whether this is an Automake generated Makefile or not.
|
||||
# We used to match only the files named 'Makefile.in', but
|
||||
# some people rename them; so instead we look at the file content.
|
||||
# Grep'ing the first line is not enough: some people post-process
|
||||
# each Makefile.in and add a new line on top of each file to say so.
|
||||
# Grep'ing the whole file is not good either: AIX grep has a line
|
||||
am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
|
||||
# Check whether this is an Automake generated Makefile which includes
|
||||
# dependency-tracking related rules and includes.
|
||||
# Grep'ing the whole file directly is not great: AIX grep has a line
|
||||
# limit of 2048, but all sed's we know have understand at least 4000.
|
||||
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
|
||||
dirpart=`AS_DIRNAME("$mf")`
|
||||
else
|
||||
continue
|
||||
fi
|
||||
# Extract the definition of DEPDIR, am__include, and am__quote
|
||||
# from the Makefile without running 'make'.
|
||||
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
|
||||
test -z "$DEPDIR" && continue
|
||||
am__include=`sed -n 's/^am__include = //p' < "$mf"`
|
||||
test -z "$am__include" && continue
|
||||
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
|
||||
# Find all dependency output files, they are included files with
|
||||
# $(DEPDIR) in their names. We invoke sed twice because it is the
|
||||
# simplest approach to changing $(DEPDIR) to its actual value in the
|
||||
# expansion.
|
||||
for file in `sed -n "
|
||||
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
|
||||
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
|
||||
# Make sure the directory exists.
|
||||
test -f "$dirpart/$file" && continue
|
||||
fdir=`AS_DIRNAME(["$file"])`
|
||||
AS_MKDIR_P([$dirpart/$fdir])
|
||||
# echo "creating $dirpart/$file"
|
||||
echo '# dummy' > "$dirpart/$file"
|
||||
done
|
||||
sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
|
||||
|| continue
|
||||
am_dirpart=`AS_DIRNAME(["$am_mf"])`
|
||||
am_filepart=`AS_BASENAME(["$am_mf"])`
|
||||
AM_RUN_LOG([cd "$am_dirpart" \
|
||||
&& sed -e '/# am--include-marker/d' "$am_filepart" \
|
||||
| $MAKE -f - am--depfiles]) || am_rc=$?
|
||||
done
|
||||
if test $am_rc -ne 0; then
|
||||
AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
|
||||
for automatic dependency tracking. Try re-running configure with the
|
||||
'--disable-dependency-tracking' option to at least be able to build
|
||||
the package (albeit without support for automatic dependency tracking).])
|
||||
fi
|
||||
AS_UNSET([am_dirpart])
|
||||
AS_UNSET([am_filepart])
|
||||
AS_UNSET([am_mf])
|
||||
AS_UNSET([am_rc])
|
||||
rm -f conftest-deps.mk
|
||||
}
|
||||
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
|
||||
|
||||
|
@ -397,18 +388,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
|
|||
# -----------------------------
|
||||
# This macro should only be invoked once -- use via AC_REQUIRE.
|
||||
#
|
||||
# This code is only required when automatic dependency tracking
|
||||
# is enabled. FIXME. This creates each '.P' file that we will
|
||||
# need in order to bootstrap the dependency handling code.
|
||||
# This code is only required when automatic dependency tracking is enabled.
|
||||
# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
|
||||
# order to bootstrap the dependency handling code.
|
||||
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[AC_CONFIG_COMMANDS([depfiles],
|
||||
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
|
||||
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
|
||||
])
|
||||
[AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
|
||||
|
||||
# Do all the work for Automake. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -495,8 +485,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
|
|||
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
|
||||
# For better backward compatibility. To be removed once Automake 1.9.x
|
||||
# dies out for good. For more background, see:
|
||||
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
|
||||
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
|
||||
# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
|
||||
# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
|
||||
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
|
||||
# We need awk for the "check" target (and possibly the TAP driver). The
|
||||
# system "awk" is bad on some platforms.
|
||||
|
@ -563,7 +553,7 @@ END
|
|||
Aborting the configuration process, to ensure you take notice of the issue.
|
||||
|
||||
You can download and install GNU coreutils to get an 'rm' implementation
|
||||
that behaves properly: <http://www.gnu.org/software/coreutils/>.
|
||||
that behaves properly: <https://www.gnu.org/software/coreutils/>.
|
||||
|
||||
If you want to complete the configuration process using your problematic
|
||||
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
|
||||
|
@ -605,7 +595,7 @@ for _am_header in $config_headers :; do
|
|||
done
|
||||
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
|
||||
|
||||
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -626,7 +616,7 @@ if test x"${install_sh+set}" != xset; then
|
|||
fi
|
||||
AC_SUBST([install_sh])])
|
||||
|
||||
# Copyright (C) 2003-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2003-2018 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -647,7 +637,7 @@ AC_SUBST([am__leading_dot])])
|
|||
|
||||
# Check to see how 'make' treats includes. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -655,49 +645,42 @@ AC_SUBST([am__leading_dot])])
|
|||
|
||||
# AM_MAKE_INCLUDE()
|
||||
# -----------------
|
||||
# Check to see how make treats includes.
|
||||
# Check whether make has an 'include' directive that can support all
|
||||
# the idioms we need for our automatic dependency tracking code.
|
||||
AC_DEFUN([AM_MAKE_INCLUDE],
|
||||
[am_make=${MAKE-make}
|
||||
cat > confinc << 'END'
|
||||
[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
|
||||
cat > confinc.mk << 'END'
|
||||
am__doit:
|
||||
@echo this is the am__doit target
|
||||
@echo this is the am__doit target >confinc.out
|
||||
.PHONY: am__doit
|
||||
END
|
||||
# If we don't find an include directive, just comment out the code.
|
||||
AC_MSG_CHECKING([for style of include used by $am_make])
|
||||
am__include="#"
|
||||
am__quote=
|
||||
_am_result=none
|
||||
# First try GNU make style include.
|
||||
echo "include confinc" > confmf
|
||||
# Ignore all kinds of additional output from 'make'.
|
||||
case `$am_make -s -f confmf 2> /dev/null` in #(
|
||||
*the\ am__doit\ target*)
|
||||
am__include=include
|
||||
am__quote=
|
||||
_am_result=GNU
|
||||
;;
|
||||
esac
|
||||
# Now try BSD make style include.
|
||||
if test "$am__include" = "#"; then
|
||||
echo '.include "confinc"' > confmf
|
||||
case `$am_make -s -f confmf 2> /dev/null` in #(
|
||||
*the\ am__doit\ target*)
|
||||
am__include=.include
|
||||
am__quote="\""
|
||||
_am_result=BSD
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
AC_SUBST([am__include])
|
||||
AC_SUBST([am__quote])
|
||||
AC_MSG_RESULT([$_am_result])
|
||||
rm -f confinc confmf
|
||||
])
|
||||
# BSD make does it like this.
|
||||
echo '.include "confinc.mk" # ignored' > confmf.BSD
|
||||
# Other make implementations (GNU, Solaris 10, AIX) do it like this.
|
||||
echo 'include confinc.mk # ignored' > confmf.GNU
|
||||
_am_result=no
|
||||
for s in GNU BSD; do
|
||||
AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
|
||||
AS_CASE([$?:`cat confinc.out 2>/dev/null`],
|
||||
['0:this is the am__doit target'],
|
||||
[AS_CASE([$s],
|
||||
[BSD], [am__include='.include' am__quote='"'],
|
||||
[am__include='include' am__quote=''])])
|
||||
if test "$am__include" != "#"; then
|
||||
_am_result="yes ($s style)"
|
||||
break
|
||||
fi
|
||||
done
|
||||
rm -f confinc.* confmf.*
|
||||
AC_MSG_RESULT([${_am_result}])
|
||||
AC_SUBST([am__include])])
|
||||
AC_SUBST([am__quote])])
|
||||
|
||||
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1997-2018 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -738,7 +721,7 @@ fi
|
|||
# Obsolete and "removed" macros, that must however still report explicit
|
||||
# error messages when used, to smooth transition.
|
||||
#
|
||||
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -765,7 +748,7 @@ AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
|
|||
|
||||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -794,7 +777,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
|
|||
AC_DEFUN([_AM_IF_OPTION],
|
||||
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
|
||||
|
||||
# Copyright (C) 1999-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1999-2018 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -841,7 +824,7 @@ AC_LANG_POP([C])])
|
|||
# For backward compatibility.
|
||||
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
|
||||
|
||||
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -860,7 +843,7 @@ AC_DEFUN([AM_RUN_LOG],
|
|||
|
||||
# Check to make sure that the build environment is sane. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -941,7 +924,7 @@ AC_CONFIG_COMMANDS_PRE(
|
|||
rm -f conftest.file
|
||||
])
|
||||
|
||||
# Copyright (C) 2009-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2009-2018 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -1001,7 +984,7 @@ AC_SUBST([AM_BACKSLASH])dnl
|
|||
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
|
||||
])
|
||||
|
||||
# Copyright (C) 2001-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2001-2018 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -1029,7 +1012,7 @@ fi
|
|||
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
|
||||
AC_SUBST([INSTALL_STRIP_PROGRAM])])
|
||||
|
||||
# Copyright (C) 2006-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2006-2018 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -1048,7 +1031,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
|
|||
|
||||
# Check how to create a tarball. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2004-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2004-2018 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
|
386
config.h.in
386
config.h.in
|
@ -3,6 +3,15 @@
|
|||
/* Define if building universal (internal helper macro) */
|
||||
#undef AC_APPLE_UNIVERSAL_BUILD
|
||||
|
||||
/* The normal alignment of `int', in bytes. */
|
||||
#undef ALIGNOF_INT
|
||||
|
||||
/* The normal alignment of `long', in bytes. */
|
||||
#undef ALIGNOF_LONG
|
||||
|
||||
/* The normal alignment of `long long', in bytes. */
|
||||
#undef ALIGNOF_LONG_LONG
|
||||
|
||||
/* Compile with debug code */
|
||||
#undef DEBUG
|
||||
|
||||
|
@ -12,20 +21,51 @@
|
|||
/* this is the prefix for STL exception functions */
|
||||
#undef EXCEPTION_NAMESPACE
|
||||
|
||||
/* Define to 1 if you have the `bind' function. */
|
||||
#undef HAVE_BIND
|
||||
|
||||
/* Define to 1 if you have the <bits/signum.h> header file. */
|
||||
#undef HAVE_BITS_SIGNUM_H
|
||||
|
||||
/* Define to 1 if you have the `broken_ac_check_func' function. */
|
||||
#undef HAVE_BROKEN_AC_CHECK_FUNC
|
||||
|
||||
/* Define to 1 if you have the <bsdsocket/socketbasetags.h> header file. */
|
||||
#undef HAVE_BSDSOCKET_SOCKETBASETAGS_H
|
||||
|
||||
/* Define to 1 if you have the `chmod' function. */
|
||||
#undef HAVE_CHMOD
|
||||
|
||||
/* Define to 1 if you have the `chown' function. */
|
||||
#undef HAVE_CHOWN
|
||||
|
||||
/* Uses the Clang compiler */
|
||||
#undef HAVE_CLANG
|
||||
|
||||
/* Define to 1 if you have the `close' function. */
|
||||
#undef HAVE_CLOSE
|
||||
|
||||
/* Define to 1 if you have the `closedir' function. */
|
||||
#undef HAVE_CLOSEDIR
|
||||
|
||||
/* Define to 1 if you have the `closelog' function. */
|
||||
#undef HAVE_CLOSELOG
|
||||
|
||||
/* Define to 1 if you have the <CommonCrypto/CommonDigest.h> header file. */
|
||||
#undef HAVE_COMMONCRYPTO_COMMONDIGEST_H
|
||||
|
||||
/* Has /dev/arandom */
|
||||
#undef HAVE_DEV_ARANDOM
|
||||
/* Define to 1 if you have the `connect' function. */
|
||||
#undef HAVE_CONNECT
|
||||
|
||||
/* Has /dev/random */
|
||||
#undef HAVE_DEV_RANDOM
|
||||
/* Define to 1 if you have the <ctype.h> header file. */
|
||||
#undef HAVE_CTYPE_H
|
||||
|
||||
/* Has /dev/urandom */
|
||||
#undef HAVE_DEV_URANDOM
|
||||
/* Define to 1 if you have the `directio' function. */
|
||||
#undef HAVE_DIRECTIO
|
||||
|
||||
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
|
||||
*/
|
||||
#undef HAVE_DIRENT_H
|
||||
|
||||
/* Define to 1 if you have the `door_create' function. */
|
||||
#undef HAVE_DOOR_CREATE
|
||||
|
@ -33,45 +73,165 @@
|
|||
/* Define to 1 if you have the <door.h> header file. */
|
||||
#undef HAVE_DOOR_H
|
||||
|
||||
/* Define to 1 if you have the `execve' function. */
|
||||
#undef HAVE_EXECVE
|
||||
|
||||
/* Define to 1 if you have the `fclose' function. */
|
||||
#undef HAVE_FCLOSE
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Uses the GNU gcc compiler */
|
||||
/* Define to 1 if you have the <features.h> header file. */
|
||||
#undef HAVE_FEATURES_H
|
||||
|
||||
/* Define to 1 if you have the `fopen' function. */
|
||||
#undef HAVE_FOPEN
|
||||
|
||||
/* Define to 1 if you have the `fork' function. */
|
||||
#undef HAVE_FORK
|
||||
|
||||
/* Define to 1 if you have the `fread' function. */
|
||||
#undef HAVE_FREAD
|
||||
|
||||
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
|
||||
#undef HAVE_FSEEKO
|
||||
|
||||
/* Define to 1 if you have the `fstatat' function. */
|
||||
#undef HAVE_FSTATAT
|
||||
|
||||
/* Define to 1 if you have the `ftruncate' function. */
|
||||
#undef HAVE_FTRUNCATE
|
||||
|
||||
/* Uses the GNU g++ compiler */
|
||||
#undef HAVE_GCC
|
||||
|
||||
/* Define to 1 if you have the `getaddrinfo' function. */
|
||||
#undef HAVE_GETADDRINFO
|
||||
|
||||
/* Define to 1 if you have the `getgid' function. */
|
||||
#undef HAVE_GETGID
|
||||
|
||||
/* Define to 1 if you have the `getgrgid' function. */
|
||||
#undef HAVE_GETGRGID
|
||||
|
||||
/* Define to 1 if you have the `gethostbyname' function. */
|
||||
#undef HAVE_GETHOSTBYNAME
|
||||
|
||||
/* Define to 1 if you have the `gethostid' function. */
|
||||
#undef HAVE_GETHOSTID
|
||||
|
||||
/* Define to 1 if you have the `gethostname' function. */
|
||||
#undef HAVE_GETHOSTNAME
|
||||
|
||||
/* Define to 1 if you have the `getuid' function. */
|
||||
#undef HAVE_GETUID
|
||||
|
||||
/* Compiler supports GNU C++ dialect & args */
|
||||
#undef HAVE_GNUC
|
||||
|
||||
/* Define to 1 if you have the <grp.h> header file. */
|
||||
#undef HAVE_GRP_H
|
||||
|
||||
/* Uses the aCC compiler */
|
||||
#undef HAVE_HP_ACC
|
||||
|
||||
/* Uses the gxlc++ compiler */
|
||||
#undef HAVE_IBM_GXLC
|
||||
|
||||
/* Uses the IBM XL C++ compiler */
|
||||
#undef HAVE_IBM_XLC
|
||||
|
||||
/* Define to 1 if you have the <iconv.h> header file. */
|
||||
#undef HAVE_ICONV_H
|
||||
|
||||
/* Uses the Intel ICC compiler */
|
||||
#undef HAVE_INTEL_ICC
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the `isprint' function. */
|
||||
#undef HAVE_ISPRINT
|
||||
|
||||
/* Define to 1 if you have the <langinfo.h> header file. */
|
||||
#undef HAVE_LANGINFO_H
|
||||
|
||||
/* Define to 1 if you have the <limits> header file. */
|
||||
#undef HAVE_LIMITS
|
||||
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#undef HAVE_LIMITS_H
|
||||
|
||||
/* Define to 1 if you have the `link' function. */
|
||||
#undef HAVE_LINK
|
||||
|
||||
/* Define to 1 if you have the <locale> header file. */
|
||||
#undef HAVE_LOCALE
|
||||
|
||||
/* Define to 1 if you have the <locale.h> header file. */
|
||||
#undef HAVE_LOCALE_H
|
||||
|
||||
/* Define to 1 if you have the `lstat' function. */
|
||||
#undef HAVE_LSTAT
|
||||
|
||||
/* Define to 1 if you have the <malloc.h> header file. */
|
||||
#undef HAVE_MALLOC_H
|
||||
|
||||
/* Define to 1 if you have the `mblen' function. */
|
||||
#undef HAVE_MBLEN
|
||||
|
||||
/* Define to 1 if you have the `mbtowc' function. */
|
||||
#undef HAVE_MBTOWC
|
||||
|
||||
/* Define to 1 if you have the `memcpy_s' function. */
|
||||
#undef HAVE_MEMCPY_S
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the `mkfifo' function. */
|
||||
#undef HAVE_MKFIFO
|
||||
|
||||
/* Define to 1 if you have the `mknod' function. */
|
||||
#undef HAVE_MKNOD
|
||||
|
||||
/* Define to 1 if you have the `mkstemp' function. */
|
||||
#undef HAVE_MKSTEMP
|
||||
|
||||
/* Define to 1 if you have the `mktemp' function. */
|
||||
#undef HAVE_MKTEMP
|
||||
|
||||
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
|
||||
#undef HAVE_NDIR_H
|
||||
|
||||
/* Define to 1 if you have the `open' function. */
|
||||
#undef HAVE_OPEN
|
||||
|
||||
/* Define to 1 if you have the `openat' function. */
|
||||
#undef HAVE_OPENAT
|
||||
|
||||
/* Define to 1 if you have the `opendir' function. */
|
||||
#undef HAVE_OPENDIR
|
||||
|
||||
/* Define to 1 if you have the `openlog' function. */
|
||||
#undef HAVE_OPENLOG
|
||||
|
||||
/* Define to 1 if you have the <openssl/md5.h> header file. */
|
||||
#undef HAVE_OPENSSL_MD5_H
|
||||
|
||||
/* Define to 1 if you have the <openssl/sha.h> header file. */
|
||||
#undef HAVE_OPENSSL_SHA_H
|
||||
|
||||
/* Uses the OpenWatcom compiler */
|
||||
#undef HAVE_OPENWATCOM
|
||||
|
||||
/* Uses the sunCC compiler */
|
||||
#undef HAVE_ORACLE_SUNCC
|
||||
|
||||
/* Define to 1 if you have the `popen' function. */
|
||||
#undef HAVE_POPEN
|
||||
|
||||
/* Define to 1 if you have the `port_create' function. */
|
||||
#undef HAVE_PORT_CREATE
|
||||
|
||||
|
@ -81,9 +241,60 @@
|
|||
/* Define to 1 if you have the `posix_fadvise' function. */
|
||||
#undef HAVE_POSIX_FADVISE
|
||||
|
||||
/* Define to 1 if you have the `posix_spawn' function. */
|
||||
#undef HAVE_POSIX_SPAWN
|
||||
|
||||
/* Define to 1 if you have the <proto/bsdsocket.h> header file. */
|
||||
#undef HAVE_PROTO_BSDSOCKET_H
|
||||
|
||||
/* Define to 1 if you have the <proto/exec.h> header file. */
|
||||
#undef HAVE_PROTO_EXEC_H
|
||||
|
||||
/* Define to 1 if you have the <pthread.h> header file. */
|
||||
#undef HAVE_PTHREAD_H
|
||||
|
||||
/* Define to 1 if you have the <pwd.h> header file. */
|
||||
#undef HAVE_PWD_H
|
||||
|
||||
/* Define to 1 if you have the `read' function. */
|
||||
#undef HAVE_READ
|
||||
|
||||
/* Define to 1 if you have the `readdir' function. */
|
||||
#undef HAVE_READDIR
|
||||
|
||||
/* Define to 1 if you have the `readlink' function. */
|
||||
#undef HAVE_READLINK
|
||||
|
||||
/* Define to 1 if you have the `readlinkat' function. */
|
||||
#undef HAVE_READLINKAT
|
||||
|
||||
/* Define to 1 if you have the `rename' function. */
|
||||
#undef HAVE_RENAME
|
||||
|
||||
/* Define to 1 if you have the `setgid' function. */
|
||||
#undef HAVE_SETGID
|
||||
|
||||
/* Define to 1 if you have the `setlocale' function. */
|
||||
#undef HAVE_SETLOCALE
|
||||
|
||||
/* Define to 1 if you have the `setuid' function. */
|
||||
#undef HAVE_SETUID
|
||||
|
||||
/* Define to 1 if you have the <signum.h> header file. */
|
||||
#undef HAVE_SIGNUM_H
|
||||
|
||||
/* Define to 1 if you have the `socket' function. */
|
||||
#undef HAVE_SOCKET
|
||||
|
||||
/* Define to 1 if you have the <sstream> header file. */
|
||||
#undef HAVE_SSTREAM
|
||||
|
||||
/* Define to 1 if you have the `stat' function. */
|
||||
#undef HAVE_STAT
|
||||
|
||||
/* Define to 1 if you have the `statx' function. */
|
||||
#undef HAVE_STATX
|
||||
|
||||
/* Define to 1 if you have the <stdarg.h> header file. */
|
||||
#undef HAVE_STDARG_H
|
||||
|
||||
|
@ -93,6 +304,9 @@
|
|||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define if STLport library is used */
|
||||
#undef HAVE_STLPORT
|
||||
|
||||
/* Define to 1 if you have the `strftime' function. */
|
||||
#undef HAVE_STRFTIME
|
||||
|
||||
|
@ -102,24 +316,59 @@
|
|||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the <strstream> header file. */
|
||||
#undef HAVE_STRSTREAM
|
||||
|
||||
/* Define to 1 if `st_attrib' is a member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_ATTRIB
|
||||
|
||||
/* Define to 1 if `st_blksize' is a member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_BLKSIZE
|
||||
|
||||
/* Define to 1 if `st_blocks' is a member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_BLOCKS
|
||||
|
||||
/* Define to 1 if `st_flag' is a member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_FLAG
|
||||
|
||||
/* Define to 1 if `st_flags' is a member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_FLAGS
|
||||
|
||||
/* Define to 1 if `st_gen' is a member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_GEN
|
||||
|
||||
/* Define to 1 if `st_rdev' is a member of `struct stat'. */
|
||||
#undef HAVE_STRUCT_STAT_ST_RDEV
|
||||
|
||||
/* Define to 1 if you have the `swab' function. */
|
||||
#undef HAVE_SWAB
|
||||
|
||||
/* Define to 1 if you have the `symlink' function. */
|
||||
#undef HAVE_SYMLINK
|
||||
|
||||
/* Define to 1 if you have the `syslog' function. */
|
||||
#undef HAVE_SYSLOG
|
||||
|
||||
/* Define to 1 if you have the <syslog.h> header file. */
|
||||
#undef HAVE_SYSLOG_H
|
||||
|
||||
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
|
||||
*/
|
||||
#undef HAVE_SYS_DIR_H
|
||||
|
||||
/* Define to 1 if you have the <sys/file.h> header file. */
|
||||
#undef HAVE_SYS_FILE_H
|
||||
|
||||
/* Define to 1 if you have the <sys/fs/vx_ioctl.h> header file. */
|
||||
#undef HAVE_SYS_FS_VX_IOCTL_H
|
||||
|
||||
/* Define to 1 if you have the <sys/mount.h> header file. */
|
||||
#undef HAVE_SYS_MOUNT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
|
||||
*/
|
||||
#undef HAVE_SYS_NDIR_H
|
||||
|
||||
/* Define to 1 if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
|
@ -141,6 +390,9 @@
|
|||
/* Define to 1 if you have the <sys/sysmacros.h> header file. */
|
||||
#undef HAVE_SYS_SYSMACROS_H
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
|
@ -153,22 +405,52 @@
|
|||
/* Define to 1 if you have the <sys/utsname.h> header file. */
|
||||
#undef HAVE_SYS_UTSNAME_H
|
||||
|
||||
/* Define to 1 if you have the <sys/wait.h> header file. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define to 1 if you have the <termios.h> header file. */
|
||||
#undef HAVE_TERMIOS_H
|
||||
|
||||
/* Define to 1 if you have the `tmpnam' function. */
|
||||
#undef HAVE_TMPNAM
|
||||
|
||||
/* Define to 1 if you have the `tzset' function. */
|
||||
#undef HAVE_TZSET
|
||||
|
||||
/* Define to 1 if the system has the type `uintptr_t'. */
|
||||
#undef HAVE_UINTPTR_T
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to 1 if you have the <unixlib/local.h> header file. */
|
||||
#undef HAVE_UNIXLIB_LOCAL_H
|
||||
|
||||
/* Define to 1 if you have the `unlink' function. */
|
||||
#undef HAVE_UNLINK
|
||||
|
||||
/* Define to 1 if you have the <varargs.h> header file. */
|
||||
#undef HAVE_VARARGS_H
|
||||
|
||||
/* Define to 1 if you have the `vfork' function. */
|
||||
#undef HAVE_VFORK
|
||||
|
||||
/* Define to 1 if you have the <wchar.h> header file. */
|
||||
#undef HAVE_WCHAR_H
|
||||
|
||||
/* Is byte aligned */
|
||||
#undef IS_BYTE_ALIGNED
|
||||
/* Define to 1 if you have the file `/dev/arandom'. */
|
||||
#undef HAVE__DEV_ARANDOM
|
||||
|
||||
/* Is a unix type platform */
|
||||
#undef IS_UNIX
|
||||
/* Define to 1 if you have the file `/dev/random'. */
|
||||
#undef HAVE__DEV_RANDOM
|
||||
|
||||
/* don't generate debuging code */
|
||||
/* Define to 1 if you have the file `/dev/urandom'. */
|
||||
#undef HAVE__DEV_URANDOM
|
||||
|
||||
/* Define to 1 if you have the `_exit' function. */
|
||||
#undef HAVE__EXIT
|
||||
|
||||
/* Compile without debug code */
|
||||
#undef NDEBUG
|
||||
|
||||
/* Name of package */
|
||||
|
@ -204,6 +486,9 @@
|
|||
/* The size of `time_t', as computed by sizeof. */
|
||||
#undef SIZEOF_TIME_T
|
||||
|
||||
/* The size of `wchar_t', as computed by sizeof. */
|
||||
#undef SIZEOF_WCHAR_T
|
||||
|
||||
/* Don't use gethostbyname() on Solaris */
|
||||
#undef SOLARIS_NO_GETHOSTBYNAME
|
||||
|
||||
|
@ -225,6 +510,28 @@
|
|||
/* Uses signed magnitute */
|
||||
#undef USES_SIGNED_MAGNITUDE
|
||||
|
||||
/* Enable extensions on AIX 3, Interix. */
|
||||
#ifndef _ALL_SOURCE
|
||||
# undef _ALL_SOURCE
|
||||
#endif
|
||||
/* Enable GNU extensions on systems that have them. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# undef _GNU_SOURCE
|
||||
#endif
|
||||
/* Enable threading extensions on Solaris. */
|
||||
#ifndef _POSIX_PTHREAD_SEMANTICS
|
||||
# undef _POSIX_PTHREAD_SEMANTICS
|
||||
#endif
|
||||
/* Enable extensions on HP NonStop. */
|
||||
#ifndef _TANDEM_SOURCE
|
||||
# undef _TANDEM_SOURCE
|
||||
#endif
|
||||
/* Enable general extensions on Solaris. */
|
||||
#ifndef __EXTENSIONS__
|
||||
# undef __EXTENSIONS__
|
||||
#endif
|
||||
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
|
@ -240,8 +547,63 @@
|
|||
# endif
|
||||
#endif
|
||||
|
||||
/* Enable large inode numbers on Mac OS X 10.5. */
|
||||
#ifndef _DARWIN_USE_64_BIT_INODE
|
||||
# define _DARWIN_USE_64_BIT_INODE 1
|
||||
#endif
|
||||
|
||||
/* Number of bits in a file offset, on hosts where this is settable. */
|
||||
#undef _FILE_OFFSET_BITS
|
||||
|
||||
/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
|
||||
#undef _LARGEFILE_SOURCE
|
||||
|
||||
/* Define for large files, on AIX-style hosts. */
|
||||
#undef _LARGE_FILES
|
||||
|
||||
/* Define to 1 if on MINIX. */
|
||||
#undef _MINIX
|
||||
|
||||
/* Define to 2 if the system does not provide POSIX.1 features except with
|
||||
this defined. */
|
||||
#undef _POSIX_1_SOURCE
|
||||
|
||||
/* Define to 1 if you need to in order for `stat' and other things to work. */
|
||||
#undef _POSIX_SOURCE
|
||||
|
||||
/* Define to 1 if type `char' is unsigned and you are not using gcc. */
|
||||
#ifndef __CHAR_UNSIGNED__
|
||||
# undef __CHAR_UNSIGNED__
|
||||
#endif
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef gid_t
|
||||
|
||||
/* Define to the equivalent of the C99 'restrict' keyword, or to
|
||||
nothing if this is not supported. Do not define if restrict is
|
||||
supported directly. */
|
||||
#undef restrict
|
||||
/* Work around a bug in Sun C++: it does not support _Restrict or
|
||||
__restrict__, even though the corresponding Sun C compiler ends up with
|
||||
"#define restrict _Restrict" or "#define restrict __restrict__" in the
|
||||
previous line. Perhaps some future version of Sun C++ will work with
|
||||
restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
|
||||
#if defined __SUNPRO_CC && !defined __RESTRICT
|
||||
# define _Restrict
|
||||
# define __restrict__
|
||||
#endif
|
||||
|
||||
/* Define to `unsigned int' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef uid_t
|
||||
|
||||
/* Define to the type of an unsigned integer type wide enough to hold a
|
||||
pointer, if such a type exists, and if the system does not define it. */
|
||||
#undef uintptr_t
|
||||
|
||||
#include "core/fixups.h"
|
||||
|
|
414
configure.ac
414
configure.ac
|
@ -2,75 +2,39 @@ dnl Process this file with autoconf to produce a configure script.
|
|||
dnl
|
||||
dnl
|
||||
|
||||
AC_INIT([tripwire], [2.4.3.7], [https://github.com/Tripwire/tripwire-open-source/issues], [tripwire], [https://github.com/Tripwire/tripwire-open-source])
|
||||
AC_INIT([tripwire], [2.4.3.8], [https://github.com/Tripwire/tripwire-open-source/issues], [tripwire], [https://github.com/Tripwire/tripwire-open-source])
|
||||
AC_CONFIG_SRCDIR([src/tw/tw.cpp])
|
||||
AC_CANONICAL_HOST([])
|
||||
AC_CANONICAL_TARGET([])
|
||||
AM_INIT_AUTOMAKE
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
AC_COPYRIGHT([The developer of the original code and/or files is Tripwire, Inc. Portions created by Tripwire, Inc. are copyright 2000-2018 Tripwire, Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights reserved.])
|
||||
AC_REVISION([$Revision: 2.4.3.7 $])
|
||||
AC_COPYRIGHT([The developer of the original code and/or files is Tripwire, Inc. Portions created by Tripwire, Inc. are copyright 2000-2019 Tripwire, Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights reserved.])
|
||||
AC_REVISION([$Revision: 2.4.3.8 $])
|
||||
|
||||
dnl ###############
|
||||
dnl Setup defaults
|
||||
dnl ###############
|
||||
CFLAGS=${CFLAGS:-"-O -pipe -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"}
|
||||
CXXFLAGS=${CXXFLAGS:-"-O -pipe -Wall -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"}
|
||||
dnl ensure that things like _GNU_SOURCE are enabled, since we use a handful of extended
|
||||
dnl things like O_NOATIME when they're available. autotools wants this to happen early
|
||||
dnl before it tries to compile anything
|
||||
AC_USE_SYSTEM_EXTENSIONS
|
||||
|
||||
dnl #####################
|
||||
dnl Configuration options
|
||||
dnl #####################
|
||||
dnl AC_LANG_CPLUSPLUS wants to set CXXFLAGS to include '-g -O2', but we probably don't want to
|
||||
dnl include debug symbols by default, so save off the previous value & restore it afterward
|
||||
tmp_cxxflags=${CXXFLAGS}
|
||||
AC_LANG_CPLUSPLUS
|
||||
CXXFLAGS=${tmp_cxxflags}
|
||||
|
||||
# This is primarily to support old compilers that don’t understand -Wextra
|
||||
AC_ARG_ENABLE(extrawarnings, [ —-disable-extrawarnings do not compile with -Wextra warnings enabled])
|
||||
if test "x$enable_extrawarnings" != "xno"
|
||||
then
|
||||
CFLAGS="${CFLAGS} -Wextra -Wno-unused-parameter"
|
||||
CXXFLAGS="${CXXFLAGS} -Wextra -Wno-unused-parameter"
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(static, [ --enable-static compile static binaries])
|
||||
if test "x$enable_static" = xyes
|
||||
then LDFLAGS="${LDFLAGS} -static"
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(debug, [ --enable-debug compile with debuging enabled])
|
||||
if test "x$enable_debug" = xyes
|
||||
then
|
||||
CFLAGS="${CFLAGS} -g"
|
||||
CXXFLAGS="${CXXFLAGS} -g"
|
||||
AC_DEFINE(DEBUG, 1, [Compile with debug code])
|
||||
else
|
||||
AC_DEFINE(NDEBUG, 1, [Compile without debug code])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(coverage, [ --enable-coverage enable code coverage])
|
||||
if test "x$enable_coverage" = xyes
|
||||
then
|
||||
CFLAGS="${CFLAGS} --coverage"
|
||||
CXXFLAGS="${CXXFLAGS} --coverage"
|
||||
LDFLAGS="${LDFLAGS} --coverage"
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(profiling, [ --enable-profiling enable profiling])
|
||||
if test "x$enable_profiling" = xyes
|
||||
then
|
||||
CFLAGS="${CFLAGS} -pg"
|
||||
CXXFLAGS="${CXXFLAGS} -pg"
|
||||
LDFLAGS="${LDFLAGS} -pg"
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(urandom, [ --enable-urandom use /dev/urandom])
|
||||
if test "x$enable_urandom" = xyes
|
||||
then
|
||||
AC_DEFINE(ENABLE_DEV_URANDOM, 1, [Enable use of /dev/urandom])
|
||||
fi
|
||||
dnl *******************************************************
|
||||
dnl Append an include to config.h for a handcrafted header
|
||||
dnl that sets things back to (hopefully) correct values
|
||||
dnl for known cases where autoconf does the Wrong Thing
|
||||
dnl *******************************************************
|
||||
AH_BOTTOM([#include "core/fixups.h"])
|
||||
|
||||
dnl ###################
|
||||
dnl Checks for programs
|
||||
dnl ###################
|
||||
AC_PROG_CC([gcc clang suncc aCC xlC_r xlC cl.exe])
|
||||
AC_PROG_CXX([g++ c++ clang++ sunCC aCC xlC_r xlC cl.exe])
|
||||
dnl AC_PROG_CC([gcc clang suncc aCC xlc_r gxlc cl])
|
||||
AC_PROG_CXX([g++ clang++ sunCC aCC xlc++_r gxlc++ ixlc icpc owcc cl KCC cfront c++])
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_YACC
|
||||
AC_PROG_LN_S
|
||||
|
@ -82,31 +46,171 @@ AC_PROG_AR
|
|||
AC_PATH_PROG(path_to_vi, vi)
|
||||
AC_PATH_PROG(path_to_sendmail, sendmail, "", [$PATH:/usr/libexec])
|
||||
|
||||
|
||||
dnl #########################################
|
||||
dnl Set up per-compiler constants & base args
|
||||
dnl #########################################
|
||||
|
||||
dnl first look at compilers that define __GNUC__
|
||||
dnl since automake is good at that.
|
||||
dnl
|
||||
if test "x${GXX}" != "x"; then
|
||||
AC_DEFINE(HAVE_GCC, 1, [Uses the GNU gcc compiler])
|
||||
|
||||
CXXFLAGS=${CXXFLAGS:-"-O -pipe"}
|
||||
|
||||
AC_DEFINE(HAVE_GNUC, 1, [Compiler supports GNU C++ dialect & args])
|
||||
|
||||
case "${CXX}" in
|
||||
*clang++*)
|
||||
AC_DEFINE(HAVE_CLANG, 1, [Uses the Clang++ compiler])
|
||||
;;
|
||||
icpc)
|
||||
AC_DEFINE(HAVE_INTEL_ICC, 1, [Uses the Intel ICC compiler])
|
||||
;;
|
||||
*)
|
||||
AC_DEFINE(HAVE_GCC, 1, [Uses the GNU g++ compiler])
|
||||
;;
|
||||
esac
|
||||
|
||||
else
|
||||
AC_DEFINE(HAVE_GCC, 0, [Uses the GNU gcc compiler])
|
||||
dnl in case Clang stops defining __GNUC__ or user undefines it
|
||||
if test "x${CXX}" = "xclang++"; then
|
||||
AC_DEFINE(HAVE_CLANG, 1, [Uses the Clang compiler])
|
||||
CXXFLAGS=${CXXFLAGS:-"-O -pipe"}
|
||||
fi
|
||||
|
||||
if test "x${CXX}" = "xgxlc++"; then
|
||||
AC_DEFINE(HAVE_IBM_GXLC, 1, [Uses the gxlc++ compiler])
|
||||
|
||||
dnl OBJECT_MODE needs to be set while compiling
|
||||
export OBJECT_MODE=64
|
||||
CXXFLAGS=${CXXFLAGS:-"-O -maix64 -Wx,-qinfo=all"}
|
||||
ARFLAGS=${ARFLAGS:-"-X 64"}
|
||||
fi
|
||||
|
||||
if test "x${CXX}" = "xxlc++_r"; then
|
||||
AC_DEFINE(HAVE_IBM_XLC, 1, [Uses the IBM XL C++ compiler])
|
||||
|
||||
dnl OBJECT_MODE needs to be set while compiling
|
||||
export OBJECT_MODE=64
|
||||
CXXFLAGS=${CXXFLAGS:-"-O -q64 -qinfo=all -qsuppress=1540-5311:1540-5337:1540-5341"}
|
||||
ARFLAGS=${ARFLAGS:-"-X 64"}
|
||||
fi
|
||||
|
||||
dnl *** TODO these compilers need work on default args ****
|
||||
|
||||
if test "x${CXX}" = "xsunCC"; then
|
||||
AC_DEFINE(HAVE_ORACLE_SUNCC, 1, [Uses the sunCC compiler])
|
||||
fi
|
||||
|
||||
if test "x${CXX}" = "xaCC"; then
|
||||
AC_DEFINE(HAVE_HP_ACC, 1, [Uses the aCC compiler])
|
||||
fi
|
||||
|
||||
if test "x${CXX}" = "xowcc"; then
|
||||
AC_DEFINE(HAVE_OPENWATCOM, 1, [Uses the OpenWatcom compiler])
|
||||
CXXFLAGS=${CXXFLAGS:-"-xs"}
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
|
||||
dnl ######################
|
||||
dnl Enable various warnings
|
||||
dnl #####################
|
||||
|
||||
AX_CHECK_COMPILE_FLAG([-Wall], [CXXFLAGS="$CXXFLAGS -Wall"])
|
||||
AX_CHECK_COMPILE_FLAG([-Wextra], [CXXFLAGS="$CXXFLAGS -Wextra"])
|
||||
dnl OpenWatcom compiler understands -Wextra but not -Wno-unused-parameter, so detect it separately
|
||||
AX_CHECK_COMPILE_FLAG([-Wno-unused-parameter], [CXXFLAGS="$CXXFLAGS -Wno-unused-parameter"])
|
||||
|
||||
dnl AX_CHECK_COMPILE_FLAG([-Weverything], [CXXFLAGS="$CXXFLAGS -Weverything"])
|
||||
|
||||
dnl #####################
|
||||
dnl Configuration options
|
||||
dnl #####################
|
||||
dnl
|
||||
dnl These options generally expect a compiler+linker
|
||||
dnl that understand gcc-like command line options.
|
||||
|
||||
AC_ARG_ENABLE(static, [ --enable-static compile static binaries])
|
||||
if test "x$enable_static" = xyes
|
||||
then LDFLAGS="${LDFLAGS} -static"
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(debug, [ --enable-debug compile with debuging enabled])
|
||||
if test "x$enable_debug" = xyes
|
||||
then
|
||||
CXXFLAGS="${CXXFLAGS} -g"
|
||||
AC_DEFINE(DEBUG, 1, [Compile with debug code])
|
||||
else
|
||||
AC_DEFINE(NDEBUG, 1, [Compile without debug code])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(coverage, [ --enable-coverage enable code coverage])
|
||||
if test "x$enable_coverage" = xyes
|
||||
then
|
||||
CXXFLAGS="${CXXFLAGS} --coverage"
|
||||
LDFLAGS="${LDFLAGS} --coverage"
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(profiling, [ --enable-profiling enable profiling])
|
||||
if test "x$enable_profiling" = xyes
|
||||
then
|
||||
CXXFLAGS="${CXXFLAGS} -pg"
|
||||
LDFLAGS="${LDFLAGS} -pg"
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(urandom, [ --enable-urandom use /dev/urandom])
|
||||
if test "x$enable_urandom" = xyes
|
||||
then
|
||||
AC_DEFINE(ENABLE_DEV_URANDOM, 1, [Enable use of /dev/urandom])
|
||||
fi
|
||||
|
||||
|
||||
|
||||
dnl #######################
|
||||
dnl Checks for header files
|
||||
dnl #######################
|
||||
AC_HEADER_STDC
|
||||
AC_HEADER_DIRENT
|
||||
|
||||
AC_CHECK_HEADERS(grp.h)
|
||||
AC_CHECK_HEADERS(langinfo.h)
|
||||
AC_CHECK_HEADERS(memory.h)
|
||||
AC_CHECK_HEADERS(pthread.h)
|
||||
AC_CHECK_HEADERS(pwd.h)
|
||||
AC_CHECK_HEADERS(signum.h bits/signum.h, break)
|
||||
AC_CHECK_HEADERS(stdarg.h varargs.h, break)
|
||||
AC_CHECK_HEADERS(stdint.h)
|
||||
AC_CHECK_HEADERS(syslog.h sys/syslog.h, break)
|
||||
AC_CHECK_HEADERS(termios.h)
|
||||
AC_CHECK_HEADERS(unistd.h sys/unistd.h, break)
|
||||
AC_CHECK_HEADERS(features.h)
|
||||
AC_CHECK_HEADERS(sys/file.h)
|
||||
AC_CHECK_HEADERS(sys/param.h)
|
||||
AC_CHECK_HEADERS(sys/mount.h,,,
|
||||
[[#if defined(HAVE_SYS_PARAM_H)
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
]])
|
||||
AC_CHECK_HEADERS(sys/ustat.h sys/sysmacros.h sys/syslog.h sys/socket.h)
|
||||
AC_CHECK_HEADERS(unistd.h sys/unistd.h)
|
||||
AC_CHECK_HEADERS(syslog.h langinfo.h sys/statfs.h sys/select.h)
|
||||
AC_CHECK_HEADERS(signum.h bits/signum.h, break )
|
||||
AC_CHECK_HEADERS(stdarg.h varargs.h, break )
|
||||
AC_CHECK_HEADERS(sys/utsname.h memory.h)
|
||||
AC_CHECK_HEADERS(sys/fs/vx_ioctl.h)
|
||||
|
||||
dnl # Special case for malloc.h, because it's depreciated on most systems.
|
||||
AC_CHECK_HEADERS(sys/select.h)
|
||||
AC_CHECK_HEADERS(sys/socket.h)
|
||||
AC_CHECK_HEADERS(sys/statfs.h)
|
||||
AC_CHECK_HEADERS(sys/sysmacros.h)
|
||||
AC_CHECK_HEADERS(sys/time.h)
|
||||
AC_CHECK_HEADERS(sys/ustat.h)
|
||||
AC_CHECK_HEADERS(sys/utsname.h)
|
||||
AC_CHECK_HEADERS(sys/wait.h)
|
||||
|
||||
AC_CHECK_HEADERS(sys/fs/vx_ioctl.h)
|
||||
AC_CHECK_HEADERS(unixlib/local.h)
|
||||
AC_CHECK_HEADERS(proto/bsdsocket.h)
|
||||
AC_CHECK_HEADERS(proto/exec.h)
|
||||
AC_CHECK_HEADERS(bsdsocket/socketbasetags.h)
|
||||
|
||||
dnl # Special case for malloc.h, because it's deprecated on most systems.
|
||||
CPPFLAGS_SAVE="${CPPFLAGS}"
|
||||
CPPFLAGS="${CPPFLAGS} -Werror"
|
||||
AC_CHECK_HEADERS(malloc.h)
|
||||
|
@ -117,61 +221,124 @@ dnl Checks for typedefs, structures, and compiler characteristics
|
|||
dnl #############################################################
|
||||
AC_C_CONST
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_UID_T
|
||||
AC_TYPE_UINTPTR_T
|
||||
AC_HEADER_TIME
|
||||
AC_C_BIGENDIAN
|
||||
AC_C_CHAR_UNSIGNED
|
||||
|
||||
AC_CHECK_SIZEOF(int)
|
||||
AC_CHECK_SIZEOF(long)
|
||||
AC_CHECK_SIZEOF(long long)
|
||||
AC_CHECK_SIZEOF(time_t)
|
||||
AC_CHECK_SIZEOF(wchar_t)
|
||||
|
||||
dnl All platforms we support use 2's complement, are byte aligned, etc...
|
||||
AC_CHECK_ALIGNOF(int)
|
||||
AC_CHECK_ALIGNOF(long)
|
||||
AC_CHECK_ALIGNOF(long long)
|
||||
|
||||
dnl TODO: These could be replaced with actual detection logic, for the few
|
||||
dnl remaining platforms that have non-2s complement signed ints
|
||||
AC_DEFINE(USES_1S_COMPLEMENT, 0, [Uses one's complement])
|
||||
AC_DEFINE(USES_2S_COMPLEMENT, 1, [Uses two's complement])
|
||||
AC_DEFINE(USES_SIGNED_MAGNITUDE, 0, [Uses signed magnitute])
|
||||
AC_DEFINE(IS_BYTE_ALIGNED, 1, [Is byte aligned])
|
||||
|
||||
AC_DEFINE(EXCEPTION_NAMESPACE, std::, [this is the prefix for STL exception functions])
|
||||
|
||||
dnl We used to check for UNIX or Unix-like target platforms,
|
||||
dnl but that is a little extreme, so just assume that the
|
||||
dnl target is unix. This can still be changed in config.h
|
||||
AC_DEFINE(IS_UNIX, 1, [Is a unix type platform])
|
||||
|
||||
dnl whether or not to generate debuging code?
|
||||
AC_DEFINE(NDEBUG, 1, [don't generate debuging code])
|
||||
dnl this gets defined elsewhere based on config args AC_DEFINE(NDEBUG, 1, [don't generate debuging code])
|
||||
|
||||
dnl look for struct stat members that aren't always there
|
||||
AC_CHECK_MEMBERS([struct stat.st_rdev, struct stat.st_blocks])
|
||||
dnl look for struct stat members that aren't always there:
|
||||
dnl st_rdev, st_blksize, & st_blocks are standard but a few platforms don't have them.
|
||||
dnl st_flags & st_gen are BSD-isms & are mostly seen there, including macOS
|
||||
dnl st_flag (singular) is AIX-only, while st_attrib holds DOS attribute bits on VxWorks
|
||||
AC_CHECK_MEMBERS([struct stat.st_rdev, struct stat.st_blksize, struct stat.st_blocks, struct stat.st_flags, struct stat.st_gen, struct stat.st_flag, struct stat.st_attrib])
|
||||
|
||||
dnl detect large file support & use it where available
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
dnl detect whether Posix termios is available.
|
||||
dnl we use termios to turn echo off when user is entering a passphrase
|
||||
AC_SYS_POSIX_TERMIOS
|
||||
|
||||
dnl detect whether C++ compiler supports any variant of 'restrict' keyword
|
||||
dnl (the macro says 'C' but works for both C & C++)
|
||||
AC_C_RESTRICT
|
||||
|
||||
dnl ******************************************
|
||||
dnl Check whether AC_CHECK_FUNC(S) lies to us
|
||||
dnl ******************************************
|
||||
AC_CHECK_FUNCS(broken_ac_check_func)
|
||||
|
||||
dnl #############################
|
||||
dnl Checks for standard functions
|
||||
dnl #############################
|
||||
AC_CHECK_FUNCS(strftime gethostname gethostid)
|
||||
AC_CHECK_FUNCS(mkstemp mktemp, break)
|
||||
AC_CHECK_FUNCS(swab)
|
||||
AC_CHECK_FUNCS(strftime)
|
||||
AC_CHECK_FUNCS(getaddrinfo gethostname gethostbyname gethostid)
|
||||
AC_CHECK_FUNCS(getuid getgid)
|
||||
dnl various ways of creating/naming temp files
|
||||
AC_CHECK_FUNCS(mkstemp mktemp tmpnam, break)
|
||||
dnl i18n string fns
|
||||
AC_CHECK_FUNCS(mblen mbtowc)
|
||||
dnl misc assorted
|
||||
AC_CHECK_FUNCS(swab tzset _exit popen memcpy_s)
|
||||
|
||||
dnl posix way to read files
|
||||
AC_CHECK_FUNCS(openat open read close)
|
||||
dnl standard libc way to read files
|
||||
AC_CHECK_FUNCS(fopen fread fclose)
|
||||
dnl only standard way to read dir contents
|
||||
AC_CHECK_FUNCS(opendir readdir closedir)
|
||||
dnl posix (and extended) ways to get file attributes
|
||||
AC_CHECK_FUNCS(statx fstatat lstat stat)
|
||||
dnl posix way to get symlink contents
|
||||
AC_CHECK_FUNCS(readlinkat readlink)
|
||||
|
||||
dnl posix fns that make filesystem changes
|
||||
AC_CHECK_FUNCS(chown chmod link symlink mknod mkfifo)
|
||||
dnl more posix fns that make fs changes
|
||||
AC_CHECK_FUNCS(unlink rename ftruncate)
|
||||
dnl posix syslog fns
|
||||
AC_CHECK_FUNCS(openlog syslog closelog)
|
||||
dnl posix process fns
|
||||
AC_CHECK_FUNCS(fork vfork execve posix_spawn)
|
||||
dnl bsd socket fns
|
||||
AC_CHECK_FUNCS(socket connect bind)
|
||||
dnl posix user & group stuff
|
||||
AC_CHECK_FUNCS(setuid setgid getgrgid)
|
||||
|
||||
dnl check for posix_fadvise
|
||||
AC_CHECK_HEADERS(fcntl.h, [AC_CHECK_FUNCS(posix_fadvise)])
|
||||
|
||||
dnl check for setlocale
|
||||
AC_CHECK_HEADERS(locale.h, [AC_CHECK_FUNCS(setlocale)])
|
||||
dnl check for a C isprint
|
||||
AC_CHECK_HEADERS(ctype.h, [AC_CHECK_FUNCS(isprint)])
|
||||
|
||||
dnl check for OSX builtin hash algorithms
|
||||
AC_ARG_ENABLE(commoncrypto,
|
||||
[ --disable-commoncrypto Don't use CommonCrypto hash implementations (OSX only)])
|
||||
[ --disable-commoncrypto Don't use CommonCrypto hash implementations (OSX only)])
|
||||
|
||||
if test "x${enable_commoncrypto}" != "xno"
|
||||
then
|
||||
AC_CHECK_HEADERS(CommonCrypto/CommonDigest.h)
|
||||
AC_CHECK_HEADERS(CommonCrypto/CommonDigest.h)
|
||||
fi
|
||||
|
||||
dnl check for door support (Solaris)
|
||||
AC_CHECK_HEADERS(door.h, [AC_CHECK_FUNCS(door_create)])
|
||||
|
||||
dnl check for event port support (Solaris)
|
||||
AC_CHECK_HEADERS(port.h, [AC_CHECK_FUNCS(port_create)])
|
||||
dnl check for directio syscall (Solaris)
|
||||
AC_CHECK_FUNCS(directio)
|
||||
|
||||
dnl check for existence of fseeko() as well as ftello()
|
||||
AC_FUNC_FSEEKO
|
||||
|
||||
|
||||
dnl ##############################################
|
||||
dnl check for various RNG/PRNG devices
|
||||
dnl ##############################################
|
||||
|
||||
UNAME=`uname`
|
||||
|
||||
dnl ##############################################
|
||||
dnl AROS pops up a "Please insert disk" dialog for /dev
|
||||
|
@ -179,21 +346,15 @@ dnl if script looks for devices (which don't exist)
|
|||
dnl so don't even try looking.
|
||||
dnl ##############################################
|
||||
|
||||
if [[ $UNAME != "AROS" ]]; then
|
||||
|
||||
if test -c "/dev/random"; then
|
||||
AC_DEFINE(HAVE_DEV_RANDOM, [1], [Has /dev/random])
|
||||
fi
|
||||
|
||||
if test -c "/dev/urandom"; then
|
||||
AC_DEFINE(HAVE_DEV_URANDOM, [1], [Has /dev/urandom])
|
||||
fi
|
||||
|
||||
if test -c "/dev/arandom"; then
|
||||
AC_DEFINE(HAVE_DEV_ARANDOM, [1], [Has /dev/arandom])
|
||||
fi
|
||||
|
||||
fi
|
||||
case $host_os in
|
||||
aros*)
|
||||
;;
|
||||
*)
|
||||
if test "$cross_compiling" != yes; then
|
||||
AC_CHECK_FILES(/dev/random /dev/urandom /dev/arandom)
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
dnl ##############################################
|
||||
dnl Checks for various platform specific libraries
|
||||
|
@ -229,21 +390,32 @@ then
|
|||
], [:]) ])
|
||||
fi
|
||||
|
||||
dnl check for stl library
|
||||
AC_LANG_SAVE
|
||||
AC_LANG_CPLUSPLUS
|
||||
dnl Check for STL support, either native or STLport
|
||||
|
||||
dnl
|
||||
dnl Check for STL headers
|
||||
dnl
|
||||
AC_CHECK_HEADER(locale,, [
|
||||
|
||||
if test -z "${STLPORT}"; then
|
||||
STLPORT="."
|
||||
fi
|
||||
|
||||
stlport_include="${STLPORT}/stlport"
|
||||
stlport_lib="${STLPORT}/lib"
|
||||
|
||||
AC_CHECK_HEADERS(limits limits.h)
|
||||
|
||||
dnl Use <locale> as a proxy for C++98-compliant-ish STL
|
||||
dnl and look for STLport if file isn't found immediately
|
||||
AC_CHECK_HEADERS(locale,,[
|
||||
dnl Don't have native STL headers, look in other places
|
||||
AC_CACHE_CHECK([for STLport directory], ac_cv_stlportdir, [
|
||||
echo "Native <locale> header not found; checking if STLport is available"
|
||||
found_locale=""
|
||||
for inclpath in /usr/local/include /usr/local/include/stlport
|
||||
for inclpath in ${stlport_include} /usr/local/include /usr/local/include/stlport
|
||||
do
|
||||
CPPFLAGS_save=${CPPFLAGS}
|
||||
CPPFLAGS="${CPPFLAGS} -I${inclpath}"
|
||||
CPPFLAGS="${CPPFLAGS} -I${inclpath} -nostdinc++"
|
||||
AC_TRY_COMPILE([
|
||||
#include <locale>
|
||||
]
|
||||
|
@ -265,10 +437,12 @@ AC_CHECK_HEADER(locale,, [
|
|||
fi
|
||||
])
|
||||
])
|
||||
|
||||
if test "x${ac_cv_stlportdir}" != "x"
|
||||
then
|
||||
CPPFLAGS="${CPPFLAGS} -I${ac_cv_stlportdir}"
|
||||
CPPFLAGS="${CPPFLAGS} -I ${ac_cv_stlportdir} -nostdinc++"
|
||||
fi
|
||||
|
||||
AC_TRY_LINK([#include <locale>],,,[
|
||||
dnl Don't have native STL library, look in other places
|
||||
dnl First check for POSIX threads if we compile STLport, because it needs it
|
||||
|
@ -276,6 +450,7 @@ AC_CHECK_HEADER(locale,, [
|
|||
|
||||
LDFLAGS_TEMP="${LDFLAGS}"
|
||||
LDFLAGS="${LDFLAGS_TEMP} -pthread"
|
||||
|
||||
unset ac_cv_func_pthread_getspecific
|
||||
AC_CHECK_FUNC(pthread_getspecific, [:], [
|
||||
|
||||
|
@ -283,26 +458,31 @@ AC_CHECK_HEADER(locale,, [
|
|||
unset ac_cv_func_pthread_getspecific
|
||||
AC_CHECK_FUNC(pthread_getspecific, [:], [
|
||||
LDFLAGS="${LDFLAGS_TEMP}"
|
||||
AC_MSG_ERROR([No posix threads detected, cannot continue.]) ])
|
||||
AC_MSG_WARN([No posix threads detected; OST may not link.]) ])
|
||||
])
|
||||
])
|
||||
|
||||
AC_CACHE_CHECK([for STLport library directory], ac_cv_stlportlib, [
|
||||
found_lib=""
|
||||
for inclpath in /usr/local/lib /usr/local/lib/stlport
|
||||
for inclpath in ${stlport_lib} /usr/local/lib /usr/local/lib/stlport
|
||||
do
|
||||
for stllib in stlport stlport_gcc
|
||||
do
|
||||
LDFLAGS_save=${LDFLAGS}
|
||||
LIBS_save=${LIBS}
|
||||
LD_LIBRARY_PATH_save=${LD_LIBRARY_PATH}
|
||||
|
||||
LDFLAGS="${LDFLAGS} -L${inclpath}"
|
||||
LIBS="${LIBS} -l${stllib}"
|
||||
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+:LD_LIBRARY_PATH}${inclpath}"
|
||||
|
||||
AC_TRY_LINK([
|
||||
#include <locale>
|
||||
]
|
||||
, , [ found_lib="1" ], )
|
||||
LDFLAGS=${LDFLAGS_save}
|
||||
LIBS=${LIBS_save}
|
||||
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH_save}"
|
||||
if test "x${found_lib}" = "x1"
|
||||
then
|
||||
ac_cv_stlportlib=${inclpath}
|
||||
|
@ -325,22 +505,27 @@ AC_CHECK_HEADER(locale,, [
|
|||
])
|
||||
if test "x${ac_cv_stlportdir}" != "x"
|
||||
then
|
||||
LDFLAGS="${LDFLAGS} -L${ac_cv_stlportlib}"
|
||||
LDFLAGS="${LDFLAGS} -L ${ac_cv_stlportlib}"
|
||||
LIBS="${LIBS} -l${stllib}"
|
||||
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+:LD_LIBRARY_PATH}${ac_cv_stlportlib}"
|
||||
|
||||
AC_DEFINE(HAVE_LOCALE, 1, [Define to 1 if you have the <locale> header file.])
|
||||
AC_DEFINE(HAVE_STLPORT, 1, [Define if STLport library is used])
|
||||
fi
|
||||
])
|
||||
AC_LANG_RESTORE
|
||||
|
||||
|
||||
dnl #####################
|
||||
dnl STL specific headers
|
||||
dnl #####################
|
||||
AC_CHECK_HEADERS(wchar.h)
|
||||
AC_CHECK_HEADERS(sstream strstream)
|
||||
|
||||
dnl #######################################################################
|
||||
dnl Local checks/hacks. The goal is to make this part as short as possible
|
||||
dnl #######################################################################
|
||||
AC_DEFINE_UNQUOTED(TARGET_OS, "${target}", [Target OS])
|
||||
case $target in
|
||||
AC_DEFINE_UNQUOTED(TARGET_OS, "${host}", [Target OS])
|
||||
case $host in
|
||||
i386-*-freebsd*)
|
||||
;;
|
||||
alpha-*-freebsd*)
|
||||
|
@ -361,7 +546,7 @@ case $target in
|
|||
then
|
||||
AC_MSG_WARN( [
|
||||
|
||||
Sorry, tripwire will not properly link staticaly under Solaris.
|
||||
Sorry, tripwire will not properly link statically under Solaris.
|
||||
This is due to tripwire's extensive use of gethostbyname(),
|
||||
which can only be linked dynamicaly. Please rerun configure
|
||||
without the --enable-static option.
|
||||
|
@ -391,6 +576,7 @@ if you are trying to compile a static binary.
|
|||
dnl Check for OpenSSL, now that we have a working compiler
|
||||
AC_ARG_ENABLE(openssl,
|
||||
[ --disable-openssl Don't link against OpenSSL libraries])
|
||||
|
||||
AC_ARG_WITH(ssl-dir,
|
||||
[ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
|
||||
[
|
||||
|
@ -447,7 +633,7 @@ then
|
|||
|
||||
# Basic test to check for compatible library and
|
||||
# correct linking
|
||||
if test "$cross_compiling" = yes; then
|
||||
if test "x$cross_compiling" = "xyes"; then
|
||||
found_crypto=1
|
||||
else
|
||||
AC_TRY_RUN(
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Makefile.in generated by automake 1.15.1 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.16.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -112,7 +112,7 @@ am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
|||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
depcomp =
|
||||
am__depfiles_maybe =
|
||||
am__maybe_remake_depfiles =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
|
||||
|
@ -135,7 +135,7 @@ am__recursive_targets = \
|
|||
$(RECURSIVE_CLEAN_TARGETS) \
|
||||
$(am__extra_recursive_targets)
|
||||
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
|
||||
distdir
|
||||
distdir distdir-am
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
|
@ -284,6 +284,7 @@ pdfdir = @pdfdir@
|
|||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
|
@ -318,8 +319,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
|
@ -430,7 +431,10 @@ cscopelist-am: $(am__tagged_files)
|
|||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Makefile.in generated by automake 1.15.1 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.16.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -112,7 +112,7 @@ am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
|||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
depcomp =
|
||||
am__depfiles_maybe =
|
||||
am__maybe_remake_depfiles =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__can_run_installinfo = \
|
||||
|
@ -256,6 +256,7 @@ pdfdir = @pdfdir@
|
|||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
|
@ -290,8 +291,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
|
@ -352,7 +353,10 @@ ctags CTAGS:
|
|||
cscope cscopelist:
|
||||
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
|
|
|
@ -311,7 +311,7 @@ Permission is granted to copy and distribute modified versions of this man page
|
|||
.PP
|
||||
Permission is granted to copy and distribute translations of this man page into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Tripwire, Inc.
|
||||
.PP
|
||||
Copyright 2000-2018 Tripwire, Inc. Tripwire is a registered trademark of Tripwire, Inc. in the United States and other countries. All rights reserved.
|
||||
Copyright 2000-2019 Tripwire, Inc. Tripwire is a registered trademark of Tripwire, Inc. in the United States and other countries. All rights reserved.
|
||||
.SH SEE ALSO
|
||||
.BR twintro (8),
|
||||
.BR tripwire (8),
|
||||
|
|
|
@ -537,7 +537,7 @@ Permission is granted to copy and distribute modified versions of this man page
|
|||
.PP
|
||||
Permission is granted to copy and distribute translations of this man page into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Tripwire, Inc.
|
||||
.PP
|
||||
Copyright 2000-2018 Tripwire, Inc. Tripwire is a registered trademark of Tripwire, Inc. in the United States and other countries. All rights reserved.
|
||||
Copyright 2000-2019 Tripwire, Inc. Tripwire is a registered trademark of Tripwire, Inc. in the United States and other countries. All rights reserved.
|
||||
.SH SEE ALSO
|
||||
.BR twintro (8),
|
||||
.BR tripwire (8),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Makefile.in generated by automake 1.15.1 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.16.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -112,7 +112,7 @@ am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
|||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
depcomp =
|
||||
am__depfiles_maybe =
|
||||
am__maybe_remake_depfiles =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__can_run_installinfo = \
|
||||
|
@ -256,6 +256,7 @@ pdfdir = @pdfdir@
|
|||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
|
@ -290,8 +291,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
|
@ -352,7 +353,10 @@ ctags CTAGS:
|
|||
cscope cscopelist:
|
||||
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
|
|
|
@ -112,7 +112,7 @@ Permission is granted to copy and distribute modified versions of this man page
|
|||
.PP
|
||||
Permission is granted to copy and distribute translations of this man page into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Tripwire, Inc.
|
||||
.PP
|
||||
Copyright 2000-2018 Tripwire, Inc. Tripwire is a registered trademark of Tripwire, Inc. in the United States and other countries. All rights reserved.
|
||||
Copyright 2000-2019 Tripwire, Inc. Tripwire is a registered trademark of Tripwire, Inc. in the United States and other countries. All rights reserved.
|
||||
.SH SEE ALSO
|
||||
.BR twintro (8),
|
||||
.BR tripwire (8),
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Makefile.in generated by automake 1.15.1 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.16.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -112,7 +112,7 @@ am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
|
|||
am__v_at_0 = @
|
||||
am__v_at_1 =
|
||||
depcomp =
|
||||
am__depfiles_maybe =
|
||||
am__maybe_remake_depfiles =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
am__can_run_installinfo = \
|
||||
|
@ -256,6 +256,7 @@ pdfdir = @pdfdir@
|
|||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
|
@ -290,8 +291,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
|
@ -352,7 +353,10 @@ ctags CTAGS:
|
|||
cscope cscopelist:
|
||||
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
|
|
|
@ -69,7 +69,7 @@ Permission is granted to copy and distribute modified versions of this man page
|
|||
.PP
|
||||
Permission is granted to copy and distribute translations of this man page into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Tripwire, Inc.
|
||||
.PP
|
||||
Copyright 2000-2018 Tripwire, Inc. Tripwire is a registered trademark of Tripwire, Inc. in the United States and other countries. All rights reserved.
|
||||
Copyright 2000-2019 Tripwire, Inc. Tripwire is a registered trademark of Tripwire, Inc. in the United States and other countries. All rights reserved.
|
||||
.SH SEE ALSO
|
||||
.BR twintro (8),
|
||||
.BR tripwire (8),
|
||||
|
|
|
@ -580,7 +580,7 @@ Permission is granted to copy and distribute modified versions of this man page
|
|||
.PP
|
||||
Permission is granted to copy and distribute translations of this man page into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Tripwire, Inc.
|
||||
.PP
|
||||
Copyright 2000-2018 Tripwire, Inc. Tripwire is a registered trademark of Tripwire, Inc. in the United States and other countries. All rights reserved.
|
||||
Copyright 2000-2019 Tripwire, Inc. Tripwire is a registered trademark of Tripwire, Inc. in the United States and other countries. All rights reserved.
|
||||
.SH SEE ALSO
|
||||
.BR twintro (8),
|
||||
.BR twadmin (8),
|
||||
|
|
|
@ -553,7 +553,7 @@ Permission is granted to copy and distribute modified versions of this man page
|
|||
.PP
|
||||
Permission is granted to copy and distribute translations of this man page into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Tripwire, Inc.
|
||||
.PP
|
||||
Copyright 2000-2018 Tripwire, Inc. Tripwire is a registered trademark of Tripwire, Inc. in the United States and other countries. All rights reserved.
|
||||
Copyright 2000-2019 Tripwire, Inc. Tripwire is a registered trademark of Tripwire, Inc. in the United States and other countries. All rights reserved.
|
||||
.SH SEE ALSO
|
||||
.BR twintro (8),
|
||||
.BR tripwire (8),
|
||||
|
|
|
@ -99,7 +99,7 @@ Permission is granted to copy and distribute modified versions of this man page
|
|||
.PP
|
||||
Permission is granted to copy and distribute translations of this man page into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Tripwire, Inc.
|
||||
.PP
|
||||
Copyright 2000-2018 Tripwire, Inc. Tripwire is a registered trademark of Tripwire, Inc. in the United States and other countries. All rights reserved.
|
||||
Copyright 2000-2019 Tripwire, Inc. Tripwire is a registered trademark of Tripwire, Inc. in the United States and other countries. All rights reserved.
|
||||
.SH SEE ALSO
|
||||
.BR tripwire (8),
|
||||
.BR twadmin (8),
|
||||
|
|
|
@ -162,7 +162,7 @@ Permission is granted to copy and distribute modified versions of this man page
|
|||
.PP
|
||||
Permission is granted to copy and distribute translations of this man page into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by Tripwire, Inc.
|
||||
.PP
|
||||
Copyright 2000-2018 Tripwire, Inc. Tripwire is a registered trademark of Tripwire, Inc. in the United States and other countries. All rights reserved.
|
||||
Copyright 2000-2019 Tripwire, Inc. Tripwire is a registered trademark of Tripwire, Inc. in the United States and other countries. All rights reserved.
|
||||
.SH SEE ALSO
|
||||
.BR twintro (8),
|
||||
.BR tripwire (8),
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Configures a minimal OST setup in the build directory, as a dev/test aid.
|
||||
# This script isn't meant for use in production, and intentionally uses
|
||||
# terrible hardcoded passphrases to try to discourage that.
|
||||
|
||||
cp src/mini-setup/twcfg.txt bin/twcfg.txt
|
||||
cp src/mini-setup/twpol.txt bin/twpol.txt
|
||||
cd bin
|
||||
|
||||
if [ ! -f "l" ] || [ ! -f "s" ]; then
|
||||
echo "***** Generating Keys *****"
|
||||
if ./twadmin --generate-keys --site-keyfile s --local-keyfile l --site-passphrase s --local-passphrase l --verbose
|
||||
then
|
||||
echo "***** Keys Generated *****"
|
||||
else
|
||||
echo "***** Key Generation Failed *****"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "***** Keys already generated, skipping this step *****"
|
||||
fi
|
||||
|
||||
if [ ! -f "tw.cfg" ]; then
|
||||
echo "***** Creating Config File *****"
|
||||
if ./twadmin --create-cfgfile --site-keyfile s --site-passphrase s --verbose --cfgfile ./tw.cfg ./twcfg.txt
|
||||
then
|
||||
echo "***** Config File Created *****"
|
||||
else
|
||||
echo "***** Config File Creation Failed *****"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "***** Config file already exists, skipping this step *****"
|
||||
fi
|
||||
|
||||
if [ ! -f "test.pol" ]; then
|
||||
echo "***** Creating Policy File *****"
|
||||
if ./twadmin --create-polfile --site-passphrase s --verbose --cfgfile ./tw.cfg ./twpol.txt
|
||||
then
|
||||
echo "***** Policy File Created *****"
|
||||
else
|
||||
echo "***** Policy File Creation Failed *****"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "***** Policy file already exists, skipping this step *****"
|
||||
fi
|
||||
|
||||
if [ ! -d "/tmp/tw-test" ]; then
|
||||
mkdir /tmp/tw-test
|
||||
fi
|
||||
|
||||
if [ ! -f "test.twd" ]; then
|
||||
echo "***** Initializing Database *****"
|
||||
if ./tripwire --init --local-passphrase l --verbose --cfgfile ./tw.cfg
|
||||
then
|
||||
echo "***** Database Initialized *****"
|
||||
else
|
||||
echo "***** Database Initialization Failed *****"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "***** Database already initialized, skipping this step *****"
|
||||
fi
|
||||
|
||||
touch /tmp/tw-test/hello.txt
|
||||
|
||||
echo "***** Running a Check *****"
|
||||
./tripwire --check --verbose --cfgfile ./tw.cfg
|
||||
|
||||
echo "***** Setup Completed *****"
|
|
@ -191,7 +191,7 @@ $(DIR1) -> $(param1); # It is also possible to do a
|
|||
|
||||
#=============================================================================
|
||||
#
|
||||
# Copyright 2000-2018 Tripwire, Inc. Tripwire is a registered trademark of Tripwire,
|
||||
# Copyright 2000-2019 Tripwire, Inc. Tripwire is a registered trademark of Tripwire,
|
||||
# Inc. All rights reserved.
|
||||
#
|
||||
# Linux is a registered trademark of Linus Torvalds.
|
||||
|
|
|
@ -638,7 +638,7 @@ SIG_HI = 100 ; # Critical files that are significant p
|
|||
|
||||
#=============================================================================
|
||||
#
|
||||
# Copyright 2000-2018 Tripwire, Inc. Tripwire is a registered trademark of Tripwire,
|
||||
# Copyright 2000-2019 Tripwire, Inc. Tripwire is a registered trademark of Tripwire,
|
||||
# Inc. in the United States and other countries. All rights reserved.
|
||||
#
|
||||
# FreeBSD is a registered trademark of the FreeBSD Project Inc.
|
||||
|
|
|
@ -637,7 +637,7 @@ SIG_HI = 100 ; # Critical files that are significant p
|
|||
|
||||
#=============================================================================
|
||||
#
|
||||
# Copyright 2000-2018 Tripwire, Inc. Tripwire is a registered trademark of Tripwire,
|
||||
# Copyright 2000-2019 Tripwire, Inc. Tripwire is a registered trademark of Tripwire,
|
||||
# Inc. in the United States and other countries. All rights reserved.
|
||||
#
|
||||
# FreeBSD is a registered trademark of the FreeBSD Project Inc.
|
||||
|
|
|
@ -1037,7 +1037,7 @@ SIG_HI = 100 ; # Critical files that are significant p
|
|||
|
||||
#=============================================================================
|
||||
#
|
||||
# Copyright 2000-2018 Tripwire, Inc. Tripwire is a registered trademark of Tripwire,
|
||||
# Copyright 2000-2019 Tripwire, Inc. Tripwire is a registered trademark of Tripwire,
|
||||
# Inc. in the United States and other countries. All rights reserved.
|
||||
#
|
||||
# Linux is a registered trademark of Linus Torvalds.
|
||||
|
|
|
@ -1077,7 +1077,7 @@ SIG_HI = 100 ; # Critical files that are significant point
|
|||
|
||||
#=============================================================================
|
||||
#
|
||||
# Copyright 2000-2018 Tripwire, Inc. Tripwire is a registered trademark of Tripwire,
|
||||
# Copyright 2000-2019 Tripwire, Inc. Tripwire is a registered trademark of Tripwire,
|
||||
# Inc. in the United States and other countries. All rights reserved.
|
||||
#
|
||||
# Linux is a registered trademark of Linus Torvalds.
|
||||
|
|
|
@ -638,7 +638,7 @@ SIG_HI = 100 ; # Critical files that are significant p
|
|||
|
||||
#=============================================================================
|
||||
#
|
||||
# Copyright 2000-2018 Tripwire, Inc. Tripwire is a registered trademark of Tripwire,
|
||||
# Copyright 2000-2019 Tripwire, Inc. Tripwire is a registered trademark of Tripwire,
|
||||
# Inc. in the United States and other countries. All rights reserved.
|
||||
#
|
||||
# FreeBSD is a registered trademark of the FreeBSD Project Inc.
|
||||
|
|
|
@ -638,7 +638,7 @@ SIG_HI = 100 ; # Critical files that are significant p
|
|||
|
||||
#=============================================================================
|
||||
#
|
||||
# Copyright 2000-2018 Tripwire, Inc. Tripwire is a registered trademark of Tripwire,
|
||||
# Copyright 2000-2019 Tripwire, Inc. Tripwire is a registered trademark of Tripwire,
|
||||
# Inc. in the United States and other countries. All rights reserved.
|
||||
#
|
||||
# FreeBSD is a registered trademark of the FreeBSD Project Inc.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Makefile.in generated by automake 1.15.1 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.16.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -133,7 +133,7 @@ am__recursive_targets = \
|
|||
$(RECURSIVE_CLEAN_TARGETS) \
|
||||
$(am__extra_recursive_targets)
|
||||
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
|
||||
distdir
|
||||
distdir distdir-am
|
||||
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
|
||||
# Read a list of newline-separated strings from the standard input,
|
||||
# and print each of them once, without duplicates. Input order is
|
||||
|
@ -282,6 +282,7 @@ pdfdir = @pdfdir@
|
|||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
|
@ -317,8 +318,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
|
@ -429,7 +430,10 @@ cscopelist-am: $(am__tagged_files)
|
|||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
|
|
|
@ -23,7 +23,7 @@ libcore_a_HEADERS = archive.h charutil.h cmdlineparser.h codeconvert.h \
|
|||
core.h coreerrors.h corestrings.h crc32.h debug.h displayencoder.h \
|
||||
displayutil.h epoch.h error.h errorbucket.h errorbucketimpl.h errorgeneral.h \
|
||||
errortable.h errorutil.h file.h fileerror.h fileheader.h fixedfilebuf.h \
|
||||
fsservices.h growheap.h hashtable.h haval.h md5.h msystem.h ntdbs.h \
|
||||
fixups.h fsservices.h growheap.h hashtable.h haval.h md5.h msystem.h ntdbs.h \
|
||||
ntmbs.h package.h platform.h refcountobj.h resources.h \
|
||||
serializable.h serializer.h serializerimpl.h serializerutil.h serstring.h \
|
||||
sha.h srefcountobj.h srefcounttbl.h stdcore.h stringutil.h tasktimer.h \
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Makefile.in generated by automake 1.15.1 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.16.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994-2018 Free Software Foundation, Inc.
|
||||
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -141,7 +141,7 @@ am__v_at_0 = @
|
|||
am__v_at_1 =
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp =
|
||||
am__depfiles_maybe =
|
||||
am__maybe_remake_depfiles =
|
||||
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
|
||||
AM_V_CXX = $(am__v_CXX_@AM_V@)
|
||||
|
@ -313,6 +313,7 @@ pdfdir = @pdfdir@
|
|||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
runstatedir = @runstatedir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
|
@ -348,7 +349,7 @@ libcore_a_HEADERS = archive.h charutil.h cmdlineparser.h codeconvert.h \
|
|||
core.h coreerrors.h corestrings.h crc32.h debug.h displayencoder.h \
|
||||
displayutil.h epoch.h error.h errorbucket.h errorbucketimpl.h errorgeneral.h \
|
||||
errortable.h errorutil.h file.h fileerror.h fileheader.h fixedfilebuf.h \
|
||||
fsservices.h growheap.h hashtable.h haval.h md5.h msystem.h ntdbs.h \
|
||||
fixups.h fsservices.h growheap.h hashtable.h haval.h md5.h msystem.h ntdbs.h \
|
||||
ntmbs.h package.h platform.h refcountobj.h resources.h \
|
||||
serializable.h serializer.h serializerimpl.h serializerutil.h serstring.h \
|
||||
sha.h srefcountobj.h srefcounttbl.h stdcore.h stringutil.h tasktimer.h \
|
||||
|
@ -380,8 +381,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
|||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
|
@ -486,7 +487,10 @@ cscopelist-am: $(am__tagged_files)
|
|||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
distdir: $(BUILT_SOURCES)
|
||||
$(MAKE) $(AM_MAKEFLAGS) distdir-am
|
||||
|
||||
distdir-am: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
|
||||
list='$(DISTFILES)'; \
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -80,25 +80,25 @@ TSTRING eArchiveCrypto::GetMsg() const
|
|||
// running out of memory or disk space.
|
||||
//
|
||||
|
||||
void cArchive::ReadInt16(int16& ret) // throw(eArchive)
|
||||
void cArchive::ReadInt16(int16_t& ret) // throw(eArchive)
|
||||
{
|
||||
if (ReadBlob(&ret, sizeof(int16)) != sizeof(int16))
|
||||
if (ReadBlob(&ret, sizeof(int16_t)) != sizeof(int16_t))
|
||||
throw eArchiveEOF();
|
||||
|
||||
ret = tw_ntohs(ret);
|
||||
}
|
||||
|
||||
void cArchive::ReadInt32(int32& ret) // throw(eArchive)
|
||||
void cArchive::ReadInt32(int32_t& ret) // throw(eArchive)
|
||||
{
|
||||
if (ReadBlob(&ret, sizeof(int32)) != sizeof(int32))
|
||||
if (ReadBlob(&ret, sizeof(int32_t)) != sizeof(int32_t))
|
||||
throw eArchiveEOF();
|
||||
|
||||
ret = tw_ntohl(ret);
|
||||
}
|
||||
|
||||
void cArchive::ReadInt64(int64& ret) // throw(eArchive)
|
||||
void cArchive::ReadInt64(int64_t& ret) // throw(eArchive)
|
||||
{
|
||||
if (ReadBlob(&ret, sizeof(int64)) != sizeof(int64))
|
||||
if (ReadBlob(&ret, sizeof(int64_t)) != sizeof(int64_t))
|
||||
throw eArchiveEOF();
|
||||
|
||||
ret = tw_ntohll(ret);
|
||||
|
@ -112,7 +112,7 @@ void cArchive::ReadInt64(int64& ret) // throw(eArchive)
|
|||
void cArchive::ReadString(TSTRING& ret) // throw(eArchive)
|
||||
{
|
||||
// read in size of string
|
||||
int16 size;
|
||||
int16_t size;
|
||||
ReadInt16(size);
|
||||
|
||||
// create buffer for WCHAR16 string
|
||||
|
@ -122,7 +122,7 @@ void cArchive::ReadString(TSTRING& ret) // throw(eArchive)
|
|||
|
||||
for (int n = 0; n < size; n++)
|
||||
{
|
||||
int16 i16;
|
||||
int16_t i16;
|
||||
ReadInt16(i16);
|
||||
*pwc++ = i16;
|
||||
}
|
||||
|
@ -136,22 +136,22 @@ int cArchive::ReadBlob(void* pBlob, int count)
|
|||
return Read(pBlob, count);
|
||||
}
|
||||
|
||||
void cArchive::WriteInt16(int16 i) // throw(eArchive)
|
||||
void cArchive::WriteInt16(int16_t i) // throw(eArchive)
|
||||
{
|
||||
i = tw_htons(i);
|
||||
WriteBlob(&i, sizeof(int16));
|
||||
WriteBlob(&i, sizeof(int16_t));
|
||||
}
|
||||
|
||||
void cArchive::WriteInt32(int32 i) // throw(eArchive)
|
||||
void cArchive::WriteInt32(int32_t i) // throw(eArchive)
|
||||
{
|
||||
i = tw_htonl(i);
|
||||
WriteBlob(&i, sizeof(int32));
|
||||
WriteBlob(&i, sizeof(int32_t));
|
||||
}
|
||||
|
||||
void cArchive::WriteInt64(int64 i) // throw(eArchive)
|
||||
void cArchive::WriteInt64(int64_t i) // throw(eArchive)
|
||||
{
|
||||
i = tw_htonll(i);
|
||||
WriteBlob(&i, sizeof(int64));
|
||||
WriteBlob(&i, sizeof(int64_t));
|
||||
}
|
||||
|
||||
// NOTE:BAM 10/11/99 -- we store unsigned size, but it really only works with
|
||||
|
@ -159,7 +159,7 @@ void cArchive::WriteInt64(int64 i) // throw(eArchive)
|
|||
// resize() in ReadString().
|
||||
// format for written string: 16-bit unsigned size, then a list of 16-bit UCS2 (Unicode) characters
|
||||
// not including terminating NULL
|
||||
void cArchive::WriteString(TSTRING s) // throw(eArchive)
|
||||
void cArchive::WriteString(const TSTRING& s) // throw(eArchive)
|
||||
{
|
||||
// convert string to a UCS2 string
|
||||
wc16_string ws;
|
||||
|
@ -170,7 +170,7 @@ void cArchive::WriteString(TSTRING s) // throw(eArchive)
|
|||
if (ws.length() > TSS_INT16_MAX)
|
||||
ThrowAndAssert(eArchiveStringTooLong());
|
||||
|
||||
WriteInt16(static_cast<int16>(ws.length()));
|
||||
WriteInt16(static_cast<int16_t>(ws.length()));
|
||||
|
||||
// write out each 16 bit character
|
||||
// RAD:09/03/99 -- Optimized for performance with "const"
|
||||
|
@ -186,9 +186,9 @@ void cArchive::WriteBlob(const void* pBlob, int count) // throw(eArchive)
|
|||
ThrowAndAssert(eArchiveWrite());
|
||||
}
|
||||
|
||||
int32 cArchive::GetStorageSize(const TSTRING& str)
|
||||
int32_t cArchive::GetStorageSize(const TSTRING& str)
|
||||
{
|
||||
int32 size = sizeof(int32); // the length is always stored
|
||||
int32_t size = sizeof(int32_t); // the length is always stored
|
||||
//
|
||||
// after the length, all of the characters in the string are written as 16-bit values,
|
||||
// except for the null character
|
||||
|
@ -198,19 +198,19 @@ int32 cArchive::GetStorageSize(const TSTRING& str)
|
|||
return size;
|
||||
}
|
||||
|
||||
int64 cArchive::Copy(cArchive* pFrom, int64 amt)
|
||||
int64_t cArchive::Copy(cArchive* pFrom, int64_t amt)
|
||||
{
|
||||
enum
|
||||
{
|
||||
BUF_SIZE = 2048
|
||||
};
|
||||
int8 buf[BUF_SIZE];
|
||||
int64 amtLeft = amt;
|
||||
int8_t buf[BUF_SIZE];
|
||||
int64_t amtLeft = amt;
|
||||
|
||||
while (amtLeft > 0)
|
||||
{
|
||||
int64 amtToRead = amtLeft > (int64)BUF_SIZE ? (int64)BUF_SIZE : amtLeft;
|
||||
int64 amtRead = pFrom->ReadBlob(buf, static_cast<int>(amtToRead));
|
||||
int64_t amtToRead = amtLeft > (int64_t)BUF_SIZE ? (int64_t)BUF_SIZE : amtLeft;
|
||||
int64_t amtRead = pFrom->ReadBlob(buf, static_cast<int>(amtToRead));
|
||||
amtLeft -= amtRead;
|
||||
WriteBlob(buf, static_cast<int>(amtRead));
|
||||
if (amtRead < amtToRead)
|
||||
|
@ -236,7 +236,7 @@ cMemMappedArchive::~cMemMappedArchive()
|
|||
{
|
||||
}
|
||||
|
||||
int64 cMemMappedArchive::GetMappedOffset() const // throw(eArchive)
|
||||
int64_t cMemMappedArchive::GetMappedOffset() const // throw(eArchive)
|
||||
{
|
||||
if (mpMappedMem == 0)
|
||||
ThrowAndAssert(eArchiveMemmap());
|
||||
|
@ -244,7 +244,7 @@ int64 cMemMappedArchive::GetMappedOffset() const // throw(eArchive)
|
|||
return mMappedOffset;
|
||||
}
|
||||
|
||||
int64 cMemMappedArchive::GetMappedLength() const // throw(eArchive)
|
||||
int64_t cMemMappedArchive::GetMappedLength() const // throw(eArchive)
|
||||
{
|
||||
if (mpMappedMem == 0)
|
||||
ThrowAndAssert(eArchiveMemmap());
|
||||
|
@ -268,7 +268,7 @@ void* cMemMappedArchive::GetMap() // throw(eArchive)
|
|||
return mpMappedMem;
|
||||
}
|
||||
|
||||
void cMemMappedArchive::SetNewMap(void* pMap, int64 offset, int64 length) const
|
||||
void cMemMappedArchive::SetNewMap(void* pMap, int64_t offset, int64_t length) const
|
||||
{
|
||||
if (pMap == 0)
|
||||
{
|
||||
|
@ -310,7 +310,7 @@ bool cMemoryArchive::EndOfFile()
|
|||
return mReadHead >= mLogicalSize;
|
||||
}
|
||||
|
||||
void cMemoryArchive::Seek(int64 offset, SeekFrom from) // throw(eArchive)
|
||||
void cMemoryArchive::Seek(int64_t offset, SeekFrom from) // throw(eArchive)
|
||||
{
|
||||
switch (from)
|
||||
{
|
||||
|
@ -334,12 +334,12 @@ void cMemoryArchive::Seek(int64 offset, SeekFrom from) // throw(eArchive)
|
|||
mReadHead = static_cast<int>(offset);
|
||||
}
|
||||
|
||||
int64 cMemoryArchive::CurrentPos() const
|
||||
int64_t cMemoryArchive::CurrentPos() const
|
||||
{
|
||||
return mReadHead;
|
||||
}
|
||||
|
||||
int64 cMemoryArchive::Length() const
|
||||
int64_t cMemoryArchive::Length() const
|
||||
{
|
||||
return mLogicalSize;
|
||||
}
|
||||
|
@ -352,7 +352,7 @@ void cMemoryArchive::Truncate()
|
|||
AllocateMemory(mLogicalSize);
|
||||
}
|
||||
|
||||
void cMemoryArchive::MapArchive(int64 offset, int64 len) // throw(eArchive)
|
||||
void cMemoryArchive::MapArchive(int64_t offset, int64_t len) // throw(eArchive)
|
||||
{
|
||||
if (offset + (int)len > mLogicalSize)
|
||||
AllocateMemory(static_cast<int>(offset + len));
|
||||
|
@ -360,7 +360,7 @@ void cMemoryArchive::MapArchive(int64 offset, int64 len) // throw(eArchive)
|
|||
SetNewMap(mpMemory + offset, offset, len);
|
||||
}
|
||||
|
||||
void cMemoryArchive::MapArchive(int64 offset, int64 len) const // throw(eArchive)
|
||||
void cMemoryArchive::MapArchive(int64_t offset, int64_t len) const // throw(eArchive)
|
||||
{
|
||||
if (offset + (int)len > mLogicalSize)
|
||||
ThrowAndAssert(eArchiveMemmap());
|
||||
|
@ -414,7 +414,7 @@ void cMemoryArchive::AllocateMemory(int len) // throw(eArchive)
|
|||
while (mAllocatedLen < len)
|
||||
mAllocatedLen *= 2;
|
||||
|
||||
int8* pNewMem = new int8[mAllocatedLen];
|
||||
int8_t* pNewMem = new int8_t[mAllocatedLen];
|
||||
if (mpMemory != 0)
|
||||
{
|
||||
memcpy(pNewMem, mpMemory, mLogicalSize);
|
||||
|
@ -436,7 +436,7 @@ void cMemoryArchive::AllocateMemory(int len) // throw(eArchive)
|
|||
if (len < (mAllocatedLen >> 1) && mAllocatedLen > MIN_ALLOCATED_SIZE)
|
||||
{
|
||||
// shrink the buffer
|
||||
int8* pNewMem = new int8[len];
|
||||
int8_t* pNewMem = new int8_t[len];
|
||||
ASSERT(mpMemory);
|
||||
memcpy(pNewMem, mpMemory, len);
|
||||
delete [] mpMemory;
|
||||
|
@ -459,9 +459,9 @@ class cFixedMemArchive : public cBidirArchive
|
|||
{
|
||||
public:
|
||||
|
||||
int8* mpMemory;
|
||||
int32 mSize;
|
||||
int32 mReadHead;
|
||||
int8_t* mpMemory;
|
||||
int32_t mSize;
|
||||
int32_t mReadHead;
|
||||
};
|
||||
*/
|
||||
|
||||
|
@ -472,7 +472,7 @@ cFixedMemArchive::cFixedMemArchive() : mpMemory(0), mSize(0), mReadHead(0)
|
|||
{
|
||||
}
|
||||
|
||||
cFixedMemArchive::cFixedMemArchive(int8* pMem, int32 size) : mpMemory(0), mSize(0), mReadHead(0)
|
||||
cFixedMemArchive::cFixedMemArchive(int8_t* pMem, int32_t size) : mpMemory(0), mSize(0), mReadHead(0)
|
||||
{
|
||||
Attach(pMem, size);
|
||||
}
|
||||
|
@ -481,14 +481,14 @@ cFixedMemArchive::~cFixedMemArchive()
|
|||
{
|
||||
}
|
||||
|
||||
void cFixedMemArchive::Attach(int8* pMem, int32 size)
|
||||
void cFixedMemArchive::Attach(int8_t* pMem, int32_t size)
|
||||
{
|
||||
mpMemory = pMem;
|
||||
mSize = size;
|
||||
mReadHead = 0;
|
||||
}
|
||||
|
||||
void cFixedMemArchive::Seek(int64 offset, SeekFrom from) // throw(eArchive)
|
||||
void cFixedMemArchive::Seek(int64_t offset, SeekFrom from) // throw(eArchive)
|
||||
{
|
||||
switch (from)
|
||||
{
|
||||
|
@ -509,15 +509,15 @@ void cFixedMemArchive::Seek(int64 offset, SeekFrom from) // throw(eArchive)
|
|||
ThrowAndAssert(eArchiveSeek(TSS_GetString(cCore, core::STR_MEMARCHIVE_FILENAME),
|
||||
TSS_GetString(cCore, core::STR_MEMARCHIVE_ERRSTR)));
|
||||
|
||||
mReadHead = static_cast<int32>(offset);
|
||||
mReadHead = static_cast<int32_t>(offset);
|
||||
}
|
||||
|
||||
int64 cFixedMemArchive::CurrentPos() const
|
||||
int64_t cFixedMemArchive::CurrentPos() const
|
||||
{
|
||||
return mReadHead;
|
||||
}
|
||||
|
||||
int64 cFixedMemArchive::Length() const
|
||||
int64_t cFixedMemArchive::Length() const
|
||||
{
|
||||
return mSize;
|
||||
}
|
||||
|
@ -583,7 +583,7 @@ bool cFileArchive::EndOfFile()
|
|||
// Seek -- This is where the actual offset is performed. The default
|
||||
// for each archive will be 0.
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
void cFileArchive::Seek(int64 offset, SeekFrom from) // throw(eArchive)
|
||||
void cFileArchive::Seek(int64_t offset, SeekFrom from) // throw(eArchive)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -614,7 +614,7 @@ void cFileArchive::Seek(int64 offset, SeekFrom from) // throw(eArchive)
|
|||
}
|
||||
}
|
||||
|
||||
int64 cFileArchive::CurrentPos(void) const
|
||||
int64_t cFileArchive::CurrentPos(void) const
|
||||
{
|
||||
return mReadHead;
|
||||
}
|
||||
|
@ -622,7 +622,7 @@ int64 cFileArchive::CurrentPos(void) const
|
|||
/////////////////////////////////////////////////////////////////////////
|
||||
// Length -- Returns the size of the current file archive.
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
int64 cFileArchive::Length(void) const
|
||||
int64_t cFileArchive::Length(void) const
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -637,12 +637,12 @@ int64 cFileArchive::Length(void) const
|
|||
/////////////////////////////////////////////////////////////////////////
|
||||
// OpenRead -- Opens the file to be read only.
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
void cFileArchive::OpenRead(const TCHAR* filename, uint32 openFlags)
|
||||
void cFileArchive::OpenRead(const TCHAR* filename, uint32_t openFlags)
|
||||
{
|
||||
try
|
||||
{
|
||||
// set up open flags
|
||||
uint32 flags = cFile::OPEN_READ;
|
||||
uint32_t flags = cFile::OPEN_READ;
|
||||
flags |= ((openFlags & FA_OPEN_TRUNCATE) ? cFile::OPEN_TRUNCATE : 0);
|
||||
flags |= ((openFlags & FA_OPEN_TEXT) ? cFile::OPEN_TEXT : 0);
|
||||
flags |= ((openFlags & FA_SCANNING) ? cFile::OPEN_SCANNING : 0);
|
||||
|
@ -665,12 +665,12 @@ void cFileArchive::OpenRead(const TCHAR* filename, uint32 openFlags)
|
|||
/////////////////////////////////////////////////////////////////////////
|
||||
// OpenReadWrite -- Opens the file to be read or written to
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
void cFileArchive::OpenReadWrite(const TCHAR* filename, uint32 openFlags)
|
||||
void cFileArchive::OpenReadWrite(const TCHAR* filename, uint32_t openFlags)
|
||||
{
|
||||
try
|
||||
{
|
||||
// set up open flags
|
||||
uint32 flags = cFile::OPEN_WRITE;
|
||||
uint32_t flags = cFile::OPEN_WRITE;
|
||||
flags |= ((openFlags & FA_OPEN_TRUNCATE) ? cFile::OPEN_TRUNCATE : 0);
|
||||
flags |= ((openFlags & FA_OPEN_TEXT) ? cFile::OPEN_TEXT : 0);
|
||||
flags |= ((openFlags & FA_SCANNING) ? cFile::OPEN_SCANNING : 0);
|
||||
|
@ -743,10 +743,10 @@ int cFileArchive::Read(void* pDest, int count)
|
|||
else
|
||||
{
|
||||
int i;
|
||||
int32 dummy;
|
||||
for (i = count;; i -= sizeof(int32))
|
||||
int32_t dummy;
|
||||
for (i = count;; i -= sizeof(int32_t))
|
||||
{
|
||||
if (i < (int)sizeof(int32))
|
||||
if (i < (int)sizeof(int32_t))
|
||||
{
|
||||
if (i > 0)
|
||||
mCurrentFile.Read(&dummy, i);
|
||||
|
@ -773,7 +773,7 @@ int cFileArchive::Write(const void* pDest, int count) // throw(eArchive)
|
|||
{
|
||||
try
|
||||
{
|
||||
int64 actual_count = 0;
|
||||
int64_t actual_count = 0;
|
||||
ASSERT(mCurrentFile.isWritable);
|
||||
|
||||
actual_count = mCurrentFile.Write(pDest, count);
|
||||
|
@ -790,7 +790,7 @@ int cFileArchive::Write(const void* pDest, int count) // throw(eArchive)
|
|||
// increase the size, if needed
|
||||
if (mReadHead > mFileSize)
|
||||
{
|
||||
#if 0 // IS_SUNPRO \
|
||||
#if 0 // IS_SUNPRO
|
||||
// These two lines seem to be all there is between code that crashes and code that works for sunpro
|
||||
cDebug d("cFileArchive::Write()");
|
||||
d.TraceDebug(_T("file(%s) adjusted mFileSize = %d mReadHead = %d\n"), mCurrentFilename.c_str(), (int)mFileSize, (int)mReadHead);
|
||||
|
@ -834,7 +834,7 @@ void cFileArchive::Truncate() // throw(eArchive)
|
|||
//
|
||||
// since we'll never open an existing file, the truncateFile flag is unnecessary.
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
void cLockedTemporaryFileArchive::OpenReadWrite(const TCHAR* filename, uint32 openFlags)
|
||||
void cLockedTemporaryFileArchive::OpenReadWrite(const TCHAR* filename, uint32_t openFlags)
|
||||
{
|
||||
TSTRING strTempFile;
|
||||
|
||||
|
@ -868,7 +868,7 @@ void cLockedTemporaryFileArchive::OpenReadWrite(const TCHAR* filename, uint32 op
|
|||
// create file
|
||||
|
||||
// set up flags
|
||||
uint32 flags = cFile::OPEN_WRITE | cFile::OPEN_LOCKED_TEMP | cFile::OPEN_CREATE | cFile::OPEN_EXCLUSIVE;
|
||||
uint32_t flags = cFile::OPEN_WRITE | cFile::OPEN_LOCKED_TEMP | cFile::OPEN_CREATE | cFile::OPEN_EXCLUSIVE;
|
||||
if (openFlags & FA_OPEN_TRUNCATE)
|
||||
flags |= cFile::OPEN_TRUNCATE;
|
||||
if (openFlags & FA_OPEN_TEXT)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -103,24 +103,24 @@ public:
|
|||
// All write functions throw exceptions for unexpected events like
|
||||
// running out of memory or disk space.
|
||||
//
|
||||
void ReadInt16(int16& ret); // throw(eArchive)
|
||||
void ReadInt32(int32& ret); // throw(eArchive)
|
||||
void ReadInt64(int64& ret); // throw(eArchive)
|
||||
void ReadInt16(int16_t& ret); // throw(eArchive)
|
||||
void ReadInt32(int32_t& ret); // throw(eArchive)
|
||||
void ReadInt64(int64_t& ret); // throw(eArchive)
|
||||
void ReadString(TSTRING& ret); // throw(eArchive)
|
||||
int ReadBlob(void* pBlob, int count);
|
||||
void WriteInt16(int16 i); // throw(eArchive)
|
||||
void WriteInt32(int32 i); // throw(eArchive)
|
||||
void WriteInt64(int64 i); // throw(eArchive)
|
||||
void WriteString(TSTRING s); // throw(eArchive)
|
||||
void WriteInt16(int16_t i); // throw(eArchive)
|
||||
void WriteInt32(int32_t i); // throw(eArchive)
|
||||
void WriteInt64(int64_t i); // throw(eArchive)
|
||||
void WriteString(const TSTRING& s); // throw(eArchive)
|
||||
void WriteBlob(const void* pBlob, int count); // throw(eArchive)
|
||||
|
||||
static int32 GetStorageSize(const TSTRING& str);
|
||||
static int32_t GetStorageSize(const TSTRING& str);
|
||||
// this method calculates how many bytes the given string will take up in the archive and returns
|
||||
// that value
|
||||
// NOTE -- if the implementation of ReadString() or WriteString() ever changes, this method will also
|
||||
// need to change.
|
||||
|
||||
int64 Copy(cArchive* pFrom, int64 amt); // throw(eArchive)
|
||||
int64_t Copy(cArchive* pFrom, int64_t amt); // throw(eArchive)
|
||||
// this method copies amt bytes from pFrom to itself, throwing an eArchive if anything goes wrong.
|
||||
|
||||
// only makes sense to call for reading archives
|
||||
|
@ -146,9 +146,9 @@ public:
|
|||
END = -1
|
||||
};
|
||||
|
||||
virtual void Seek(int64 offset, SeekFrom from) = 0; // throw(eArchive);
|
||||
virtual int64 CurrentPos() const = 0;
|
||||
virtual int64 Length() const = 0;
|
||||
virtual void Seek(int64_t offset, SeekFrom from) = 0; // throw(eArchive);
|
||||
virtual int64_t CurrentPos() const = 0;
|
||||
virtual int64_t Length() const = 0;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -166,22 +166,22 @@ public:
|
|||
cMemMappedArchive();
|
||||
virtual ~cMemMappedArchive();
|
||||
|
||||
virtual void MapArchive(int64 offset, int64 len) = 0; // throw(eArchive);
|
||||
virtual void MapArchive(int64 offset, int64 len) const = 0; // throw(eArchive);
|
||||
virtual void MapArchive(int64_t offset, int64_t len) = 0; // throw(eArchive);
|
||||
virtual void MapArchive(int64_t offset, int64_t len) const = 0; // throw(eArchive);
|
||||
// the const version of MapArchive() does not allow the archive to grow in size
|
||||
|
||||
int64 GetMappedOffset() const; // throw(eArchive)
|
||||
int64 GetMappedLength() const; // throw(eArchive)
|
||||
int64_t GetMappedOffset() const; // throw(eArchive)
|
||||
int64_t GetMappedLength() const; // throw(eArchive)
|
||||
void* GetMap(); // throw(eArchive)
|
||||
const void* GetMap() const;
|
||||
|
||||
protected:
|
||||
mutable void* mpMappedMem;
|
||||
mutable int64 mMappedOffset;
|
||||
mutable int64 mMappedLength;
|
||||
mutable void* mpMappedMem;
|
||||
mutable int64_t mMappedOffset;
|
||||
mutable int64_t mMappedLength;
|
||||
|
||||
// call in derived class to set above vars
|
||||
void SetNewMap(void* pMap, int64 offset, int64 length) const;
|
||||
void SetNewMap(void* pMap, int64_t offset, int64_t length) const;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -198,25 +198,25 @@ public:
|
|||
~cMemoryArchive();
|
||||
|
||||
virtual bool EndOfFile();
|
||||
virtual void Seek(int64 offset, SeekFrom from); // throw(eArchive)
|
||||
virtual int64 CurrentPos() const;
|
||||
virtual int64 Length() const;
|
||||
virtual void MapArchive(int64 offset, int64 len); // throw(eArchive)
|
||||
virtual void MapArchive(int64 offset, int64 len) const; // throw(eArchive)
|
||||
virtual void Seek(int64_t offset, SeekFrom from); // throw(eArchive)
|
||||
virtual int64_t CurrentPos() const;
|
||||
virtual int64_t Length() const;
|
||||
virtual void MapArchive(int64_t offset, int64_t len); // throw(eArchive)
|
||||
virtual void MapArchive(int64_t offset, int64_t len) const; // throw(eArchive)
|
||||
|
||||
void Truncate(); // set the length to the current pos
|
||||
|
||||
int8* GetMemory() const
|
||||
int8_t* GetMemory() const
|
||||
{
|
||||
return mpMemory;
|
||||
}
|
||||
|
||||
protected:
|
||||
int8* mpMemory;
|
||||
int mAllocatedLen;
|
||||
int mMaxAllocatedLen;
|
||||
int mLogicalSize;
|
||||
int mReadHead;
|
||||
int8_t* mpMemory;
|
||||
int mAllocatedLen;
|
||||
int mMaxAllocatedLen;
|
||||
int mLogicalSize;
|
||||
int mReadHead;
|
||||
|
||||
virtual int Read(void* pDest, int count);
|
||||
virtual int Write(const void* pDest, int count); // throw(eArchive)
|
||||
|
@ -231,19 +231,19 @@ class cFixedMemArchive : public cBidirArchive
|
|||
{
|
||||
public:
|
||||
cFixedMemArchive();
|
||||
cFixedMemArchive(int8* pMem, int32 size);
|
||||
cFixedMemArchive(int8_t* pMem, int32_t size);
|
||||
virtual ~cFixedMemArchive();
|
||||
|
||||
void Attach(int8* pMem, int32 size);
|
||||
void Attach(int8_t* pMem, int32_t size);
|
||||
// this method associates the archive with pMem and sets the size of the
|
||||
// archive. Unlike cMemoryArchive, this may never grow or shrink in size.
|
||||
|
||||
//-----------------------------------
|
||||
// cBidirArchive interface
|
||||
//-----------------------------------
|
||||
virtual void Seek(int64 offset, SeekFrom from); // throw(eArchive);
|
||||
virtual int64 CurrentPos() const;
|
||||
virtual int64 Length() const;
|
||||
virtual void Seek(int64_t offset, SeekFrom from); // throw(eArchive);
|
||||
virtual int64_t CurrentPos() const;
|
||||
virtual int64_t Length() const;
|
||||
virtual bool EndOfFile();
|
||||
|
||||
protected:
|
||||
|
@ -253,9 +253,9 @@ protected:
|
|||
virtual int Read(void* pDest, int count); // throw(eArchive)
|
||||
virtual int Write(const void* pDest, int count); // throw(eArchive)
|
||||
|
||||
int8* mpMemory;
|
||||
int32 mSize;
|
||||
int32 mReadHead;
|
||||
int8_t* mpMemory;
|
||||
int32_t mSize;
|
||||
int32_t mReadHead;
|
||||
};
|
||||
|
||||
class cFileArchive : public cBidirArchive
|
||||
|
@ -273,8 +273,8 @@ public:
|
|||
};
|
||||
|
||||
// TODO: Open should throw
|
||||
virtual void OpenRead(const TCHAR* filename, uint32 openFlags = 0);
|
||||
virtual void OpenReadWrite(const TCHAR* filename, uint32 openFlags = FA_OPEN_TRUNCATE);
|
||||
virtual void OpenRead(const TCHAR* filename, uint32_t openFlags = 0);
|
||||
virtual void OpenReadWrite(const TCHAR* filename, uint32_t openFlags = FA_OPEN_TRUNCATE);
|
||||
// opens a file for reading or writing; the file is always created if it doesn't exist,
|
||||
// and is truncated to zero length if truncateFile is set to true;
|
||||
TSTRING GetCurrentFilename(void) const;
|
||||
|
@ -285,14 +285,14 @@ public:
|
|||
// cBidirArchive interface
|
||||
//-----------------------------------
|
||||
virtual bool EndOfFile();
|
||||
virtual void Seek(int64 offset, SeekFrom from); // throw(eArchive)
|
||||
virtual int64 CurrentPos() const;
|
||||
virtual int64 Length() const;
|
||||
virtual void Seek(int64_t offset, SeekFrom from); // throw(eArchive)
|
||||
virtual int64_t CurrentPos() const;
|
||||
virtual int64_t Length() const;
|
||||
|
||||
|
||||
protected:
|
||||
int64 mFileSize; //Size of FileArchive
|
||||
int64 mReadHead; //Current position of read/write head
|
||||
int64_t mFileSize; //Size of FileArchive
|
||||
int64_t mReadHead; //Current position of read/write head
|
||||
//-----------------------------------
|
||||
// cArchive interface
|
||||
//-----------------------------------
|
||||
|
@ -301,7 +301,7 @@ protected:
|
|||
bool isWritable;
|
||||
cFile mCurrentFile;
|
||||
TSTRING mCurrentFilename; //current file
|
||||
uint32 mOpenFlags;
|
||||
uint32_t mOpenFlags;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
|
@ -315,7 +315,7 @@ protected:
|
|||
class cLockedTemporaryFileArchive : public cFileArchive
|
||||
{
|
||||
public:
|
||||
virtual void OpenReadWrite(const TCHAR* filename = NULL, uint32 openFlags = FA_OPEN_TRUNCATE);
|
||||
virtual void OpenReadWrite(const TCHAR* filename = NULL, uint32_t openFlags = FA_OPEN_TRUNCATE);
|
||||
// creates the file. filename must not exist on the file system.
|
||||
// if filename is NULL, the class will create and use a temporary file.
|
||||
// truncateFile has no meaning
|
||||
|
@ -328,7 +328,7 @@ public:
|
|||
private:
|
||||
// open for read only makes no sense if we're always creating the file,
|
||||
// so disallow read only file opens
|
||||
virtual void OpenRead(const TCHAR*, uint32 openFlags = 0)
|
||||
virtual void OpenRead(const TCHAR*, uint32_t openFlags = 0)
|
||||
{
|
||||
ASSERT(false);
|
||||
THROW_INTERNAL("archive.h");
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -41,7 +41,8 @@
|
|||
#include "charutil.h"
|
||||
#include "ntmbs.h"
|
||||
|
||||
#if IS_ANDROID
|
||||
#if !HAVE_MBLEN && HAVE_MBTOWC
|
||||
// Musl libc & Android NDK implement mblen just like this
|
||||
int mblen(const char* s, size_t n)
|
||||
{
|
||||
return mbtowc(0, s, n);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -80,17 +80,18 @@ iCodeConverter* iCodeConverter::m_pInst = NULL;
|
|||
// has a maximum of 512 chars of output
|
||||
std::string util_output_bytes(void* p, size_t n)
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss.imbue(std::locale::classic());
|
||||
ss.setf(std::ios_base::hex, std::ios_base::basefield);
|
||||
|
||||
TOSTRINGSTREAM ss;
|
||||
tss_classic_locale(ss);
|
||||
ss.setf(std::ios::hex, std::ios::basefield);
|
||||
|
||||
for (size_t i = 0; i < n; i++)
|
||||
{
|
||||
ss.width(2);
|
||||
ss << toupper(tss::util::char_to_size(((char*)p)[i])) << " ";
|
||||
}
|
||||
|
||||
std::string s = ss.str();
|
||||
tss_mkstr(s, ss);
|
||||
|
||||
if (s.length() > 512)
|
||||
{
|
||||
s = "truncated output: " + s;
|
||||
|
@ -1243,7 +1244,9 @@ int tss_wcstombs(ntmbs_t pbz, const_ntwcs_t pwz, size_t nCount)
|
|||
int tss_mbstowcs(ntwcs_t pwz, const_ntmbs_t pbz, size_t nBytes)
|
||||
{
|
||||
cDebug d("tss_mbstowcs");
|
||||
|
||||
if (!pbz)
|
||||
return 0;
|
||||
|
||||
size_t N;
|
||||
size_t nConv;
|
||||
const_ntmbs_t end = &pbz[nBytes];
|
||||
|
@ -1433,7 +1436,7 @@ int cGoodEnoughConverterer::Convert(ntdbs_t pwz, size_t nCount, const_ntmbs_t pb
|
|||
}
|
||||
else
|
||||
{
|
||||
*dat = (uint16)(unsigned char)*at;
|
||||
*dat = (uint16_t)(unsigned char)*at;
|
||||
}
|
||||
|
||||
dat++;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -82,9 +82,9 @@
|
|||
#include "archive.h"
|
||||
#endif
|
||||
|
||||
#define BUFSIZE 4096
|
||||
#define BUFFER_SIZE 4096
|
||||
|
||||
static uint32 crctab[] = {
|
||||
static uint32_t crctab[] = {
|
||||
0x0,
|
||||
0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b,
|
||||
0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6,
|
||||
|
@ -154,7 +154,7 @@ void crcInit( CRC_INFO& crcInfo )
|
|||
crcInfo.crc = 0;
|
||||
}
|
||||
|
||||
void crcUpdate( CRC_INFO& crcInfo, const uint8* pbData, int cbDataLen )
|
||||
void crcUpdate( CRC_INFO& crcInfo, const uint8_t* pbData, int cbDataLen )
|
||||
{
|
||||
for( int i = 0; i < cbDataLen; i++, pbData++ )
|
||||
{
|
||||
|
@ -168,7 +168,7 @@ void crcFinit( CRC_INFO& crcInfo )
|
|||
{
|
||||
// include the length
|
||||
//
|
||||
uint32 len = crcInfo.cbTotalLen;
|
||||
uint32_t len = crcInfo.cbTotalLen;
|
||||
for(; len != 0; len >>= 8)
|
||||
COMPUTE( crcInfo.crc, len & 0xff );
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -37,14 +37,14 @@ class cArchive;
|
|||
|
||||
typedef struct
|
||||
{
|
||||
uint32 crc;
|
||||
uint32 cbTotalLen;
|
||||
uint32_t crc;
|
||||
uint32_t cbTotalLen;
|
||||
}
|
||||
CRC_INFO;
|
||||
|
||||
// must have 8-bit bytes
|
||||
void crcInit ( CRC_INFO& crcInfo );
|
||||
void crcUpdate( CRC_INFO& crcInfo, const uint8* pbData, int cbDataLen );
|
||||
void crcUpdate( CRC_INFO& crcInfo, const uint8_t* pbData, int cbDataLen );
|
||||
void crcFinit ( CRC_INFO& crcInfo );
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -45,7 +45,7 @@
|
|||
#include <cstdio>
|
||||
|
||||
int cDebug::mDebugLevel(10);
|
||||
uint32 cDebug::mOutMask(cDebug::OUT_TRACE);
|
||||
uint32_t cDebug::mOutMask(cDebug::OUT_TRACE);
|
||||
std::ofstream cDebug::logfile;
|
||||
//mDebugLevel default == 10, mOutMask default == OUT_TRACE.
|
||||
|
||||
|
@ -106,13 +106,13 @@ void cDebug::DoTrace(const char* format, va_list& args)
|
|||
ASSERT(guard1 == 0xBABABABA && guard2 == 0xBABABABA); // string was too long
|
||||
ASSERT(strlen(out) < 1024);
|
||||
|
||||
std::ostringstream ostr;
|
||||
TOSTRINGSTREAM ostr;
|
||||
ostr.setf(std::ios::left);
|
||||
ostr.width(40);
|
||||
ostr << mLabel;
|
||||
ostr.width(0);
|
||||
ostr << out;
|
||||
|
||||
tss_end(ostr);
|
||||
|
||||
if ((mOutMask & OUT_STDOUT) != 0)
|
||||
{
|
||||
|
@ -120,6 +120,8 @@ void cDebug::DoTrace(const char* format, va_list& args)
|
|||
std::cout.flush();
|
||||
}
|
||||
|
||||
tss_free(ostr);
|
||||
|
||||
//
|
||||
//make it output to log file!
|
||||
//
|
||||
|
@ -280,9 +282,9 @@ bool cDebug::SetOutputFile(const char* filename)
|
|||
// already open!
|
||||
// TODO -- make this work with wide chars
|
||||
if (!logfile)
|
||||
logfile.open(filename, std::ios_base::out | std::ios_base::ate | std::ios_base::app);
|
||||
logfile.open(filename, std::ios::out | std::ios::ate | std::ios::app);
|
||||
else
|
||||
logfile.setf(std::ios_base::hex, std::ios_base::basefield);
|
||||
logfile.setf(std::ios::hex, std::ios::basefield);
|
||||
//make sure info. will not be clobbered.
|
||||
|
||||
//Should be open now- if not, abort.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -147,7 +147,7 @@ private:
|
|||
};
|
||||
|
||||
static int mDebugLevel;
|
||||
static uint32 mOutMask;
|
||||
static uint32_t mOutMask;
|
||||
static std::ofstream logfile;
|
||||
char mLabel[MAX_LABEL];
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -479,7 +479,7 @@ TSTRING cCharEncoderUtil::CharStringToHexValue(const TSTRING& str)
|
|||
|
||||
for (at = str.begin(); at < str.end(); at++)
|
||||
{
|
||||
strOut += char_to_hex(*at);
|
||||
strOut += char_to_hex(*at);
|
||||
}
|
||||
|
||||
return strOut;
|
||||
|
@ -501,25 +501,38 @@ TSTRING cCharEncoderUtil::HexValueToCharString(const TSTRING& str)
|
|||
|
||||
TCHAR cCharEncoderUtil::hex_to_char(TSTRING::const_iterator first, TSTRING::const_iterator last)
|
||||
{
|
||||
static const TCHAR max_char = std::numeric_limits<TCHAR>::max();
|
||||
static const TCHAR min_char = std::numeric_limits<TCHAR>::min();
|
||||
|
||||
static const TCHAR max_char = TSS_TCHAR_MAX;
|
||||
static const TCHAR min_char = TSS_TCHAR_MIN;
|
||||
|
||||
if (first + TCHAR_AS_HEX__IN_TCHARS != last)
|
||||
ThrowAndAssert(eBadHexConversion());
|
||||
{
|
||||
ThrowAndAssert(eBadHexConversion(TSTRING(first,last)));
|
||||
}
|
||||
|
||||
TISTRINGSTREAM ss(TSTRING(first, last));
|
||||
ss.imbue(std::locale::classic());
|
||||
#if ARCHAIC_STL
|
||||
TSTRING in(first, last);
|
||||
TISTRINGSTREAM ss(in.c_str());
|
||||
#else
|
||||
TISTRINGSTREAM ss(TSTRING(first,last));
|
||||
#endif
|
||||
|
||||
tss_classic_locale(ss);
|
||||
|
||||
ss.fill(_T('0'));
|
||||
ss.setf(std::ios_base::hex, std::ios_base::basefield);
|
||||
|
||||
ss.setf(std::ios::hex, std::ios::basefield);
|
||||
|
||||
unsigned long ch;
|
||||
ss >> ch;
|
||||
|
||||
if (ss.bad() || ss.fail())
|
||||
{
|
||||
ThrowAndAssert(eBadHexConversion(TSTRING(first, last)));
|
||||
if ((TCHAR)ch > max_char || (TCHAR)ch < min_char)
|
||||
}
|
||||
if ((TCHAR)ch > TSS_TCHAR_MAX || (TCHAR)ch < TSS_TCHAR_MIN)
|
||||
{
|
||||
ThrowAndAssert(eBadHexConversion(TSTRING(first, last)));
|
||||
|
||||
}
|
||||
|
||||
return (TCHAR)ch;
|
||||
}
|
||||
|
||||
|
@ -527,17 +540,21 @@ TCHAR cCharEncoderUtil::hex_to_char(TSTRING::const_iterator first, TSTRING::cons
|
|||
TSTRING cCharEncoderUtil::char_to_hex(TCHAR ch)
|
||||
{
|
||||
TOSTRINGSTREAM ss;
|
||||
|
||||
ss.imbue(std::locale::classic());
|
||||
tss_classic_locale(ss);
|
||||
ss.setf(std::ios::hex, std::ios::basefield);
|
||||
|
||||
ss.fill(_T('0'));
|
||||
ss.width(TCHAR_AS_HEX__IN_TCHARS);
|
||||
ss.setf(std::ios_base::hex, std::ios_base::basefield);
|
||||
|
||||
ss << tss::util::char_to_size(ch);
|
||||
|
||||
if (ss.bad() || ss.fail() || ss.str().length() != TCHAR_AS_HEX__IN_TCHARS)
|
||||
tss_mkstr(out, ss);
|
||||
|
||||
if (ss.bad() || ss.fail() || out.length() != TCHAR_AS_HEX__IN_TCHARS)
|
||||
{
|
||||
ThrowAndAssert(eBadHexConversion(TSTRING(1, ch)));
|
||||
return ss.str();
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
TSTRING cCharEncoderUtil::DecodeHexToChar(TSTRING::const_iterator* pcur, const TSTRING::const_iterator end)
|
||||
|
@ -551,8 +568,10 @@ TSTRING cCharEncoderUtil::DecodeHexToChar(TSTRING::const_iterator* pcur, const T
|
|||
}
|
||||
|
||||
if (n != TCHAR_AS_HEX__IN_TCHARS)
|
||||
ThrowAndAssert(eBadDecoderInput());
|
||||
|
||||
{
|
||||
ThrowAndAssert(eBadDecoderInput());
|
||||
}
|
||||
|
||||
// convert hex numbers
|
||||
return HexValueToCharString(str);
|
||||
}
|
||||
|
@ -734,10 +753,10 @@ void cEncoder::ValidateSchema() const
|
|||
bool cEncoder::OnlyOneCatagoryPerChar() const
|
||||
{
|
||||
// TODO:BAM - man, is there a better way to do this?
|
||||
TCHAR ch = std::numeric_limits<TCHAR>::min();
|
||||
TCHAR ch = TSS_TCHAR_MIN;
|
||||
TSTRING ach(1, ch);
|
||||
|
||||
if (ch != std::numeric_limits<TCHAR>::max())
|
||||
if (ch != TSS_TCHAR_MAX)
|
||||
{
|
||||
do
|
||||
{
|
||||
|
@ -755,7 +774,7 @@ bool cEncoder::OnlyOneCatagoryPerChar() const
|
|||
}
|
||||
}
|
||||
ch++;
|
||||
} while (ch != std::numeric_limits<TCHAR>::max());
|
||||
} while (ch != TSS_TCHAR_MAX);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -94,5 +94,5 @@ TSTRING cDisplayUtil::FormatMultiLineString(const TSTRING& str, int nOffset, int
|
|||
// now add last string
|
||||
sstr << strT;
|
||||
|
||||
return (sstr.str());
|
||||
tss_return_stream(sstr, out);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -51,7 +51,7 @@ bool CheckEpoch()
|
|||
time_struct.tm_mday = 1;
|
||||
time_struct.tm_mon = 0;
|
||||
time_struct.tm_year = 138;
|
||||
int64 endoftime = cTimeUtil::DateToTime(&time_struct);
|
||||
int64_t endoftime = cTimeUtil::DateToTime(&time_struct);
|
||||
|
||||
if (time(0) > endoftime)
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -39,11 +39,11 @@
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// CalcHash
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
uint32 eError::CalcHash(const char* name)
|
||||
uint32_t eError::CalcHash(const char* name)
|
||||
{
|
||||
CRC_INFO crc;
|
||||
crcInit(crc);
|
||||
crcUpdate(crc, (const uint8*)name, strlen(name));
|
||||
crcUpdate(crc, (const uint8_t*)name, strlen(name));
|
||||
crcFinit(crc);
|
||||
return crc.crc;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -45,7 +45,7 @@ public:
|
|||
//-------------------------------------------------------------------------
|
||||
// Construction and Assignment
|
||||
//-------------------------------------------------------------------------
|
||||
eError(const TSTRING& msg, uint32 flags = 0);
|
||||
eError(const TSTRING& msg, uint32_t flags = 0);
|
||||
explicit eError(const eError& rhs);
|
||||
explicit eError();
|
||||
void operator=(const eError& rhs);
|
||||
|
@ -58,7 +58,7 @@ public:
|
|||
//-------------------------------------------------------------------------
|
||||
// Data Access
|
||||
//-------------------------------------------------------------------------
|
||||
virtual uint32 GetID() const = 0;
|
||||
virtual uint32_t GetID() const = 0;
|
||||
// returns a system wide unique identifier for this exception. See the
|
||||
// macro below for the typical implementation of this method.
|
||||
// This is used to associate the error with a string description of the
|
||||
|
@ -73,7 +73,7 @@ public:
|
|||
// be displayed as the "Second" part of an error message, or the derived
|
||||
// class should override GetMsg() and return a string appropriate for display.
|
||||
|
||||
uint32 GetFlags() const;
|
||||
uint32_t GetFlags() const;
|
||||
// Flags are defined below. Currently, these only have an impact on how errors are
|
||||
// displayed.
|
||||
|
||||
|
@ -86,7 +86,7 @@ public:
|
|||
SUPRESS_THIRD_MSG = 0x00000002 // supresses the "continuing" or "exiting" message
|
||||
};
|
||||
|
||||
void SetFlags(uint32 flags);
|
||||
void SetFlags(uint32_t flags);
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
// Flag Convenience Methods
|
||||
|
@ -103,7 +103,7 @@ public:
|
|||
//-------------------------------------------------------------------------
|
||||
// Utility Methods
|
||||
//-------------------------------------------------------------------------
|
||||
static uint32 CalcHash(const char* name);
|
||||
static uint32_t CalcHash(const char* name);
|
||||
// calculates the CRC32 of the string passed in as name. This methods
|
||||
// asserts that name is non null. This is used to generate unique IDs
|
||||
// for errors.
|
||||
|
@ -112,8 +112,8 @@ public:
|
|||
// Private Implementation
|
||||
//-------------------------------------------------------------------------
|
||||
protected:
|
||||
TSTRING mMsg;
|
||||
uint32 mFlags;
|
||||
TSTRING mMsg;
|
||||
uint32_t mFlags;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -127,7 +127,9 @@ protected:
|
|||
// to be added to the exception class.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if HAVE_GCC
|
||||
// TODO: make use of 'explicit' more portable here, and/or figure out why
|
||||
// this doesn't work on so many compilers
|
||||
#if 1 //HAVE_GCC || HAVE_CLANG || HAVE_IBM_XLC || HAVE_IBM_GXLC || HAVE_ORACLE_SUNCC
|
||||
# define TSS_BEGIN_EXCEPTION_EXPLICIT
|
||||
#else
|
||||
# define TSS_BEGIN_EXCEPTION_EXPLICIT explicit
|
||||
|
@ -137,7 +139,7 @@ protected:
|
|||
class except : public base \
|
||||
{ \
|
||||
public: \
|
||||
except(const TSTRING& msg, uint32 flags = 0) : base(msg, flags) \
|
||||
except(const TSTRING& msg, uint32_t flags = 0) : base(msg, flags) \
|
||||
{ \
|
||||
} \
|
||||
TSS_BEGIN_EXCEPTION_EXPLICIT except(const except& rhs) : base(rhs) \
|
||||
|
@ -147,7 +149,7 @@ protected:
|
|||
{ \
|
||||
} \
|
||||
\
|
||||
virtual uint32 GetID() const \
|
||||
virtual uint32_t GetID() const \
|
||||
{ \
|
||||
return CalcHash(#except); \
|
||||
}
|
||||
|
@ -169,7 +171,7 @@ protected:
|
|||
{ \
|
||||
} \
|
||||
\
|
||||
virtual uint32 GetID() const \
|
||||
virtual uint32_t GetID() const \
|
||||
{ \
|
||||
return CalcHash(#except); \
|
||||
}
|
||||
|
@ -195,7 +197,7 @@ protected:
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// eError
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
inline eError::eError(const TSTRING& msg, uint32 flags) : mMsg(msg), mFlags(flags)
|
||||
inline eError::eError(const TSTRING& msg, uint32_t flags) : mMsg(msg), mFlags(flags)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -241,7 +243,7 @@ inline TSTRING eError::GetMsg() const
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// GetFlags
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
inline uint32 eError::GetFlags() const
|
||||
inline uint32_t eError::GetFlags() const
|
||||
{
|
||||
return mFlags;
|
||||
}
|
||||
|
@ -249,7 +251,7 @@ inline uint32 eError::GetFlags() const
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// SetFlags
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
inline void eError::SetFlags(uint32 flags)
|
||||
inline void eError::SetFlags(uint32_t flags)
|
||||
{
|
||||
mFlags = flags;
|
||||
}
|
||||
|
@ -260,9 +262,9 @@ inline void eError::SetFlags(uint32 flags)
|
|||
inline void eError::SetFatality(bool fatal)
|
||||
{
|
||||
if (fatal)
|
||||
mFlags &= ~(uint32)NON_FATAL;
|
||||
mFlags &= ~(uint32_t)NON_FATAL;
|
||||
else
|
||||
mFlags |= (uint32)NON_FATAL;
|
||||
mFlags |= (uint32_t)NON_FATAL;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -270,7 +272,7 @@ inline void eError::SetFatality(bool fatal)
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
inline bool eError::IsFatal() const
|
||||
{
|
||||
return (mFlags & (uint32)NON_FATAL) == 0;
|
||||
return (mFlags & (uint32_t)NON_FATAL) == 0;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -279,9 +281,9 @@ inline bool eError::IsFatal() const
|
|||
inline void eError::SetSupressThird(bool supressThird)
|
||||
{
|
||||
if (supressThird)
|
||||
mFlags |= (uint32)SUPRESS_THIRD_MSG;
|
||||
mFlags |= (uint32_t)SUPRESS_THIRD_MSG;
|
||||
else
|
||||
mFlags &= ~(uint32)SUPRESS_THIRD_MSG;
|
||||
mFlags &= ~(uint32_t)SUPRESS_THIRD_MSG;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -289,7 +291,7 @@ inline void eError::SetSupressThird(bool supressThird)
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
inline bool eError::SupressThird() const
|
||||
{
|
||||
return (mFlags & (uint32)SUPRESS_THIRD_MSG) == 0;
|
||||
return (mFlags & (uint32_t)SUPRESS_THIRD_MSG) == 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -77,9 +77,9 @@ void cErrorReporter::PrintErrorMsg(const eError& error, const TSTRING& strExtra)
|
|||
if (errStr.empty())
|
||||
{
|
||||
TOSTRINGSTREAM strm;
|
||||
ASSERT(sizeof(uint32) == sizeof(unsigned int)); // for cast on next line
|
||||
ASSERT(sizeof(uint32_t) == sizeof(unsigned int)); // for cast on next line
|
||||
strm << _T("Unknown Error ID ") << (unsigned int)error.GetID();
|
||||
errStr = strm.str();
|
||||
tss_stream_to_string(strm, errStr);
|
||||
}
|
||||
|
||||
//int len = errStr.length(); // save for later
|
||||
|
@ -103,7 +103,7 @@ void cErrorReporter::PrintErrorMsg(const eError& error, const TSTRING& strExtra)
|
|||
errStr.erase(firstLF);
|
||||
}
|
||||
|
||||
ASSERT(errStr.length() + len + 6 < 80); // line too big for terminal?
|
||||
ASSERT(errStr.length() + 6 < 80); // line too big for terminal?
|
||||
// Add 6 to account for "### ' and ': '
|
||||
TCERR << TSS_GetString(cCore, core::STR_ERROR_COLON) << _T(" ") << errStr;
|
||||
TCERR << std::endl;
|
||||
|
@ -189,7 +189,7 @@ void cErrorQueue::Clear()
|
|||
mList.clear();
|
||||
}
|
||||
|
||||
int cErrorQueue::GetNumErrors() const
|
||||
cErrorQueue::ListType::size_type cErrorQueue::GetNumErrors() const
|
||||
{
|
||||
return mList.size();
|
||||
}
|
||||
|
@ -234,19 +234,19 @@ const ePoly& cErrorQueueIter::GetError() const
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Read
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void cErrorQueue::Read(iSerializer* pSerializer, int32 version)
|
||||
void cErrorQueue::Read(iSerializer* pSerializer, int32_t version)
|
||||
{
|
||||
if (version > Version())
|
||||
ThrowAndAssert(eSerializerVersionMismatch(_T("ErrorQueue Read")));
|
||||
|
||||
int32 size;
|
||||
int32_t size;
|
||||
mList.clear();
|
||||
pSerializer->ReadInt32(size);
|
||||
for (int i = 0; i < size; ++i)
|
||||
{
|
||||
int32 errorNumber;
|
||||
int32_t errorNumber;
|
||||
TSTRING errorString;
|
||||
int32 flags;
|
||||
int32_t flags;
|
||||
|
||||
pSerializer->ReadInt32(errorNumber);
|
||||
pSerializer->ReadString(errorString);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -102,15 +102,17 @@ class cErrorQueue : public cErrorBucket, public iTypedSerializable
|
|||
friend class cErrorQueueIter;
|
||||
|
||||
public:
|
||||
typedef std::list<ePoly> ListType;
|
||||
|
||||
void Clear();
|
||||
// remove all errors from the queue
|
||||
int GetNumErrors() const;
|
||||
ListType::size_type GetNumErrors() const;
|
||||
// returns how many errors are in the queue
|
||||
|
||||
//
|
||||
// iSerializable interface
|
||||
//
|
||||
virtual void Read(iSerializer* pSerializer, int32 version = 0); // throw (eSerializer, eArchive)
|
||||
virtual void Read(iSerializer* pSerializer, int32_t version = 0); // throw (eSerializer, eArchive)
|
||||
virtual void Write(iSerializer* pSerializer) const; // throw (eSerializer, eArchive)
|
||||
|
||||
//
|
||||
|
@ -122,7 +124,6 @@ protected:
|
|||
virtual void HandleError(const eError& error);
|
||||
|
||||
private:
|
||||
typedef std::list<ePoly> ListType;
|
||||
ListType mList;
|
||||
|
||||
DECLARE_TYPEDSERIALIZABLE()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -51,10 +51,10 @@ class eError;
|
|||
//-----------------------------------------------------------------------------
|
||||
// cErrorTable
|
||||
//-----------------------------------------------------------------------------
|
||||
class cErrorTable : public cMessages_<uint32, TCHAR>
|
||||
class cErrorTable : public cMessages_<uint32_t, TCHAR>
|
||||
{
|
||||
public:
|
||||
typedef cMessages_<uint32, TCHAR> inherited;
|
||||
typedef cMessages_<uint32_t, TCHAR> inherited;
|
||||
|
||||
//
|
||||
// Convenience Methods
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -58,7 +58,7 @@ public:
|
|||
//-------------------------------------------------------------------------
|
||||
// Construction and Assignment
|
||||
//-------------------------------------------------------------------------
|
||||
ePoly(uint32 id, const TSTRING& msg, uint32 flags = 0);
|
||||
ePoly(uint32_t id, const TSTRING& msg, uint32_t flags = 0);
|
||||
explicit ePoly(const eError& rhs);
|
||||
explicit ePoly();
|
||||
void operator=(const eError& rhs);
|
||||
|
@ -66,11 +66,11 @@ public:
|
|||
//-------------------------------------------------------------------------
|
||||
// ID manipulation
|
||||
//-------------------------------------------------------------------------
|
||||
virtual uint32 GetID() const;
|
||||
void SetID(uint32 id);
|
||||
virtual uint32_t GetID() const;
|
||||
void SetID(uint32_t id);
|
||||
|
||||
private:
|
||||
uint32 mID;
|
||||
uint32_t mID;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -122,7 +122,7 @@ public:
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// ePoly
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
inline ePoly::ePoly(uint32 id, const TSTRING& msg, uint32 flags) : eError(msg, flags), mID(id)
|
||||
inline ePoly::ePoly(uint32_t id, const TSTRING& msg, uint32_t flags) : eError(msg, flags), mID(id)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -154,7 +154,7 @@ inline void ePoly::operator=(const eError& rhs)
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// GetID
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
inline uint32 ePoly::GetID() const
|
||||
inline uint32_t ePoly::GetID() const
|
||||
{
|
||||
return mID;
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ inline uint32 ePoly::GetID() const
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// SetID
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
inline void ePoly::SetID(uint32 id)
|
||||
inline void ePoly::SetID(uint32_t id)
|
||||
{
|
||||
mID = id;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -47,7 +47,7 @@
|
|||
#include "fileerror.h"
|
||||
#endif
|
||||
|
||||
#if IS_MINT // for off_t
|
||||
#if HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
|
@ -106,7 +106,7 @@ public:
|
|||
/************ User Interface **************************/
|
||||
|
||||
// Both Open methods ALWAYS open files in BINARY mode!
|
||||
void Open(const TSTRING& sFileName, uint32 flags = OPEN_READ); //throw(eFile)
|
||||
void Open(const TSTRING& sFileName, uint32_t flags = OPEN_READ); //throw(eFile)
|
||||
void Close(void); //throw(eFile)
|
||||
bool IsOpen(void) const;
|
||||
|
||||
|
@ -173,7 +173,7 @@ public:
|
|||
static bool IsAbsolutePath(const TSTRING& in);
|
||||
};
|
||||
|
||||
# if IS_DOS_DJGPP
|
||||
# if USES_DOS_DEVICE_PATH
|
||||
# define cDevicePath cDosPath
|
||||
# elif IS_AROS
|
||||
# define cDevicePath cArosPath
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -31,27 +31,15 @@
|
|||
//
|
||||
// file_unix.cpp : Specific implementation of file operations for Unix.
|
||||
|
||||
|
||||
/* On GNU/Hurd, need to define _GNU_SOURCE in order to use O_NOATIME
|
||||
which technically is still a nonstandard extension to open() */
|
||||
#if IS_HURD
|
||||
# define _GNU_SOURCE
|
||||
#endif
|
||||
|
||||
#include "core/stdcore.h"
|
||||
|
||||
#if !IS_UNIX
|
||||
# error Need to be unix to use unixfsservices
|
||||
#endif
|
||||
|
||||
#include "core/file.h"
|
||||
|
||||
#include <stdio.h>
|
||||
//#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
//#include <sys/types.h>
|
||||
//#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
//#include <errno.h>
|
||||
|
||||
#if HAVE_SYS_FS_VX_IOCTL_H
|
||||
#include <sys/fs/vx_ioctl.h>
|
||||
|
@ -62,7 +50,7 @@
|
|||
#include "core/fsservices.h"
|
||||
#include "core/errorutil.h"
|
||||
|
||||
#if IS_RISCOS
|
||||
#if HAVE_UNIXLIB_LOCAL_H
|
||||
#include <unixlib/local.h>
|
||||
#endif
|
||||
|
||||
|
@ -78,7 +66,7 @@ struct cFile_i
|
|||
int m_fd; //underlying file descriptor
|
||||
FILE* mpCurrStream; //currently defined file stream
|
||||
TSTRING mFileName; //the name of the file we are currently referencing.
|
||||
uint32 mFlags; //Flags used to open the file
|
||||
uint32_t mFlags; //Flags used to open the file
|
||||
};
|
||||
|
||||
//Ctor
|
||||
|
@ -132,10 +120,10 @@ cFile::~cFile()
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !USES_DEVICE_PATH
|
||||
void cFile::Open(const TSTRING& sFileName, uint32 flags)
|
||||
void cFile::Open(const TSTRING& sFileName, uint32_t flags)
|
||||
{
|
||||
#else
|
||||
void cFile::Open(const TSTRING& sFileNameC, uint32 flags)
|
||||
void cFile::Open(const TSTRING& sFileNameC, uint32_t flags)
|
||||
{
|
||||
TSTRING sFileName = cDevicePath::AsNative(sFileNameC);
|
||||
#endif
|
||||
|
@ -236,16 +224,21 @@ void cFile::Open(const TSTRING& sFileNameC, uint32 flags)
|
|||
fcntl(fh, F_NOCACHE, 1);
|
||||
#endif
|
||||
|
||||
#if IS_SOLARIS
|
||||
#if HAVE_DIRECTIO // Solaris
|
||||
if ((flags & OPEN_DIRECT) && (flags & OPEN_SCANNING))
|
||||
directio(fh, DIRECTIO_ON);
|
||||
#endif
|
||||
|
||||
#if HAVE_POSIX_FADVISE
|
||||
#if SUPPORTS_POSIX_FADVISE
|
||||
if (flags & OPEN_SCANNING && !(flags & OPEN_DIRECT))
|
||||
{
|
||||
#ifdef POSIX_FADV_SEQUENTIAL
|
||||
posix_fadvise(fh, 0, 0, POSIX_FADV_SEQUENTIAL);
|
||||
#endif
|
||||
|
||||
#ifdef POSIX_FADV_NOREUSE
|
||||
posix_fadvise(fh, 0, 0, POSIX_FADV_NOREUSE);
|
||||
#endif
|
||||
}
|
||||
|
||||
#elif HAVE_SYS_FS_VX_IOCTL_H
|
||||
|
@ -267,7 +260,7 @@ void cFile::Close() //throw(eFile)
|
|||
{
|
||||
if (mpData->mpCurrStream != NULL)
|
||||
{
|
||||
#ifdef HAVE_POSIX_FADVISE
|
||||
#if (SUPPORTS_POSIX_FADVISE && defined(POSIX_FADV_DONTNEED))
|
||||
posix_fadvise(fileno(mpData->mpCurrStream), 0, 0, POSIX_FADV_DONTNEED);
|
||||
#endif
|
||||
|
||||
|
@ -275,8 +268,7 @@ void cFile::Close() //throw(eFile)
|
|||
mpData->mpCurrStream = NULL;
|
||||
}
|
||||
|
||||
|
||||
mpData->mFileName.empty();
|
||||
//mpData->mFileName.clear();
|
||||
}
|
||||
|
||||
bool cFile::IsOpen(void) const
|
||||
|
@ -284,6 +276,15 @@ bool cFile::IsOpen(void) const
|
|||
return (mpData->mpCurrStream != NULL);
|
||||
}
|
||||
|
||||
// Autoconf docs say HAVE_FSEEKO applies to both fseeko & ftello
|
||||
#if HAVE_FSEEKO
|
||||
#define tss_fseek fseeko
|
||||
#define tss_ftell ftello
|
||||
#else
|
||||
#define tss_fseek fseek
|
||||
#define tss_ftell ftell
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// Seek -- Positions the read/write offset in mpCurrStream. Returns the
|
||||
// current offset upon completion. Returns 0 if no stream is defined.
|
||||
|
@ -323,7 +324,9 @@ cFile::File_t cFile::Seek(File_t offset, SeekFrom From) const //throw(eFile)
|
|||
fprintf(stderr, "%d\n", blowupCount);
|
||||
#endif
|
||||
|
||||
if (fseeko(mpData->mpCurrStream, offset, apiFrom) != 0)
|
||||
|
||||
|
||||
if (tss_fseek(mpData->mpCurrStream, offset, apiFrom) != 0)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
cDebug d("cFile::Seek");
|
||||
|
@ -332,7 +335,7 @@ cFile::File_t cFile::Seek(File_t offset, SeekFrom From) const //throw(eFile)
|
|||
throw eFileSeek();
|
||||
}
|
||||
|
||||
return ftello(mpData->mpCurrStream);
|
||||
return tss_ftell(mpData->mpCurrStream);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
@ -352,7 +355,11 @@ cFile::File_t cFile::Read(void* buffer, File_t nBytes) const //throw(eFile)
|
|||
|
||||
if (mpData->mFlags & OPEN_DIRECT)
|
||||
{
|
||||
#if READ_TAKES_CHAR_PTR
|
||||
iBytesRead = read(mpData->m_fd, (char*)buffer, nBytes);
|
||||
#else
|
||||
iBytesRead = read(mpData->m_fd, buffer, nBytes);
|
||||
#endif
|
||||
if (iBytesRead < 0)
|
||||
{
|
||||
throw eFileRead(mpData->mFileName, iFSServices::GetInstance()->GetErrString());
|
||||
|
@ -360,7 +367,7 @@ cFile::File_t cFile::Read(void* buffer, File_t nBytes) const //throw(eFile)
|
|||
}
|
||||
else
|
||||
{
|
||||
iBytesRead = fread(buffer, sizeof(byte), nBytes, mpData->mpCurrStream);
|
||||
iBytesRead = fread(buffer, sizeof(uint8_t), nBytes, mpData->mpCurrStream);
|
||||
if (ferror(mpData->mpCurrStream) != 0)
|
||||
{
|
||||
throw eFileRead(mpData->mFileName, iFSServices::GetInstance()->GetErrString());
|
||||
|
@ -382,7 +389,7 @@ cFile::File_t cFile::Write(const void* buffer, File_t nBytes) //throw(eFile)
|
|||
ASSERT(mpData->mpCurrStream != NULL);
|
||||
ASSERT(isWritable);
|
||||
|
||||
if ((actual_count = fwrite(buffer, sizeof(byte), nBytes, mpData->mpCurrStream)) < nBytes)
|
||||
if ((actual_count = fwrite(buffer, sizeof(uint8_t), nBytes, mpData->mpCurrStream)) < nBytes)
|
||||
throw eFileWrite(mpData->mFileName, iFSServices::GetInstance()->GetErrString());
|
||||
else
|
||||
return actual_count;
|
||||
|
@ -478,6 +485,9 @@ bool cDosPath::IsAbsolutePath(const TSTRING& in)
|
|||
// For paths of type C:\DOS
|
||||
TSTRING cDosPath::AsPosix(const TSTRING& in)
|
||||
{
|
||||
#if (defined(__MINGW32__) || defined(__OS2__))
|
||||
return in;
|
||||
#else
|
||||
if (in[0] == '/')
|
||||
{
|
||||
return in;
|
||||
|
@ -488,6 +498,7 @@ TSTRING cDosPath::AsPosix(const TSTRING& in)
|
|||
out.erase(std::remove(out.begin(), out.end(), ':'), out.end());
|
||||
|
||||
return out;
|
||||
#endif
|
||||
}
|
||||
|
||||
TSTRING cDosPath::AsNative(const TSTRING& in)
|
||||
|
@ -591,7 +602,7 @@ bool cRiscosPath::IsAbsolutePath(const TSTRING& in)
|
|||
// For paths of type SDFS::Volume.$.dir.file
|
||||
TSTRING cRiscosPath::AsPosix(const TSTRING& in)
|
||||
{
|
||||
#if IS_RISCOS
|
||||
#if HAVE_UNIXLIB_LOCAL_H
|
||||
if (in[0] == '/')
|
||||
{
|
||||
return in;
|
||||
|
@ -614,7 +625,7 @@ TSTRING cRiscosPath::AsPosix(const TSTRING& in)
|
|||
|
||||
TSTRING cRiscosPath::AsNative(const TSTRING& in)
|
||||
{
|
||||
#if IS_RISCOS
|
||||
#if HAVE_UNIXLIB_LOCAL_H
|
||||
if (in[0] != '/')
|
||||
{
|
||||
return in;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -37,7 +37,7 @@
|
|||
#include "corestrings.h"
|
||||
|
||||
// TODO: Make this use MakeFileError() for consistency
|
||||
eFileError::eFileError(const TSTRING& filename, const TSTRING& description, uint32 flags) : eError(_T(""), flags)
|
||||
eFileError::eFileError(const TSTRING& filename, const TSTRING& description, uint32_t flags) : eError(_T(""), flags)
|
||||
{
|
||||
mFilename = filename;
|
||||
mMsg = description;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -56,13 +56,13 @@ private:
|
|||
TSTRING mFilename;
|
||||
|
||||
public:
|
||||
eFileError(const TSTRING& filename, const TSTRING& description, uint32 flags = 0);
|
||||
eFileError(const TSTRING& filename, const TSTRING& description, uint32_t flags = 0);
|
||||
|
||||
explicit eFileError(const eFileError& rhs) : eError(rhs)
|
||||
{
|
||||
mFilename = rhs.mFilename;
|
||||
}
|
||||
eFileError(const TSTRING& msg, uint32 flags = 0) : eError(msg, flags)
|
||||
eFileError(const TSTRING& msg, uint32_t flags = 0) : eError(msg, flags)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ TSS_END_EXCEPTION()
|
|||
|
||||
# define TSS_FILE_EXCEPTION(except, base) \
|
||||
TSS_BEGIN_EXCEPTION(except, base) \
|
||||
except(const TSTRING& filename, const TSTRING& msg, uint32 flags = 0) : base(filename, msg, flags) \
|
||||
except(const TSTRING& filename, const TSTRING& msg, uint32_t flags = 0) : base(filename, msg, flags) \
|
||||
{ \
|
||||
} \
|
||||
TSS_END_EXCEPTION()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -41,7 +41,7 @@
|
|||
// I changed this magic number in 2.1 since we now support versioning in the file header.
|
||||
// (the old magic number was 0x00202039)
|
||||
// I generated the random number using the random.org web site.
|
||||
const uint32 FILE_HEADER_MAGIC_NUMBER = 0x78f9beb3;
|
||||
const uint32_t FILE_HEADER_MAGIC_NUMBER = 0x78f9beb3;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// class cFileHeaderID
|
||||
|
@ -66,7 +66,7 @@ void cFileHeaderID::operator=(const TCHAR* pszId)
|
|||
if (!(N < cFileHeaderID::MAXBYTES))
|
||||
throw eCharacter(TSS_GetString(cCore, core::STR_ERR_OVERFLOW));
|
||||
|
||||
mIDLen = static_cast<int16>(N); // know len is less than MAXBYTES
|
||||
mIDLen = static_cast<int16_t>(N); // know len is less than MAXBYTES
|
||||
::memcpy(mID, pszId, N * sizeof(char));
|
||||
}
|
||||
|
||||
|
@ -82,9 +82,9 @@ int cFileHeaderID::operator==(const cFileHeaderID& rhs) const
|
|||
return (mIDLen == rhs.mIDLen) && (::memcmp(mID, rhs.mID, mIDLen * sizeof(char)) == 0);
|
||||
}
|
||||
|
||||
void cFileHeaderID::Read(iSerializer* pSerializer, int32 /*version*/) // throw (eSerializer, eArchive)
|
||||
void cFileHeaderID::Read(iSerializer* pSerializer, int32_t /*version*/) // throw (eSerializer, eArchive)
|
||||
{
|
||||
int16 len;
|
||||
int16_t len;
|
||||
pSerializer->ReadInt16(len);
|
||||
if ((len < 0) || (len >= cFileHeaderID::MAXBYTES))
|
||||
{
|
||||
|
@ -139,7 +139,7 @@ void cFileHeader::SetID(const cFileHeaderID& id)
|
|||
mID = id;
|
||||
}
|
||||
|
||||
void cFileHeader::SetVersion(uint32 v)
|
||||
void cFileHeader::SetVersion(uint32_t v)
|
||||
{
|
||||
mVersion = v;
|
||||
}
|
||||
|
@ -149,12 +149,12 @@ void cFileHeader::SetEncoding(Encoding e)
|
|||
mEncoding = e;
|
||||
}
|
||||
|
||||
void cFileHeader::Read(iSerializer* pSerializer, int32 /*version*/) // throw (eSerializer, eArchive)
|
||||
void cFileHeader::Read(iSerializer* pSerializer, int32_t /*version*/) // throw (eSerializer, eArchive)
|
||||
{
|
||||
int16 e;
|
||||
int32 len;
|
||||
int32 magicNumber;
|
||||
int32 version;
|
||||
int16_t e;
|
||||
int32_t len;
|
||||
int32_t magicNumber;
|
||||
int32_t version;
|
||||
|
||||
cDebug d("cFileHeader::Read");
|
||||
|
||||
|
@ -224,9 +224,9 @@ void cFileHeader::Write(iSerializer* pSerializer) const // throw (eSerializer, e
|
|||
|
||||
pSerializer->WriteInt32(mVersion);
|
||||
|
||||
pSerializer->WriteInt16(static_cast<int16>(mEncoding));
|
||||
pSerializer->WriteInt16(static_cast<int16_t>(mEncoding));
|
||||
|
||||
int32 len = static_cast<int32>(mBaggage.Length());
|
||||
int32_t len = static_cast<int32_t>(mBaggage.Length());
|
||||
|
||||
ASSERT(len >= 0);
|
||||
ASSERT(len <= 0xFFFF);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -59,7 +59,7 @@ public:
|
|||
int operator==(const cFileHeaderID& rhs) const;
|
||||
int operator!=(const cFileHeaderID& rhs) const;
|
||||
|
||||
virtual void Read(iSerializer* pSerializer, int32 version = 0); // throw (eSerializer, eArchive)
|
||||
virtual void Read(iSerializer* pSerializer, int32_t version = 0); // throw (eSerializer, eArchive)
|
||||
virtual void Write(iSerializer* pSerializer) const; // throw (eSerializer, eArchive)
|
||||
|
||||
private:
|
||||
|
@ -68,7 +68,7 @@ private:
|
|||
// the way we implemented cFCONames.
|
||||
// Note: We store the string as narrow chars, since
|
||||
// the program is the only person who will see them.
|
||||
int16 mIDLen;
|
||||
int16_t mIDLen;
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -119,8 +119,8 @@ public:
|
|||
void SetID(const cFileHeaderID& id);
|
||||
const cFileHeaderID& GetID() const;
|
||||
|
||||
void SetVersion(uint32 v);
|
||||
uint32 GetVersion() const;
|
||||
void SetVersion(uint32_t v);
|
||||
uint32_t GetVersion() const;
|
||||
|
||||
void SetEncoding(Encoding e);
|
||||
Encoding GetEncoding() const;
|
||||
|
@ -128,12 +128,12 @@ public:
|
|||
cMemoryArchive& GetBaggage();
|
||||
const cMemoryArchive& GetBaggage() const;
|
||||
|
||||
virtual void Read(iSerializer* pSerializer, int32 version = 0); // throw (eSerializer, eArchive)
|
||||
virtual void Write(iSerializer* pSerializer) const; // throw (eSerializer, eArchive)
|
||||
virtual void Read(iSerializer* pSerializer, int32_t version = 0); // throw (eSerializer, eArchive)
|
||||
virtual void Write(iSerializer* pSerializer) const; // throw (eSerializer, eArchive)
|
||||
|
||||
protected:
|
||||
cFileHeaderID mID;
|
||||
uint32 mVersion;
|
||||
uint32_t mVersion;
|
||||
Encoding mEncoding;
|
||||
cMemoryArchive mBaggage; // items that have been serialized to this object
|
||||
};
|
||||
|
@ -143,7 +143,7 @@ inline const cFileHeaderID& cFileHeader::GetID() const
|
|||
return mID;
|
||||
}
|
||||
|
||||
inline uint32 cFileHeader::GetVersion() const
|
||||
inline uint32_t cFileHeader::GetVersion() const
|
||||
{
|
||||
return mVersion;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -0,0 +1,69 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
// This program is free software. The contents of this file are subject
|
||||
// to the terms of the GNU General Public License as published by the
|
||||
// Free Software Foundation; either version 2 of the License, or (at your
|
||||
// option) any later version. You may redistribute it and/or modify it
|
||||
// only in compliance with the GNU General Public License.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful.
|
||||
// However, this program is distributed AS-IS WITHOUT ANY
|
||||
// WARRANTY; INCLUDING THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS
|
||||
// FOR A PARTICULAR PURPOSE. Please see the GNU General Public License
|
||||
// for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
// USA.
|
||||
//
|
||||
// Nothing in the GNU General Public License or any other license to use
|
||||
// the code or files shall permit you to use Tripwire's trademarks,
|
||||
// service marks, or other intellectual property without Tripwire's
|
||||
// prior written consent.
|
||||
//
|
||||
// If you have any questions, please contact Tripwire, Inc. at either
|
||||
// info@tripwire.org or www.tripwire.org.
|
||||
|
||||
|
||||
// ====================================================================
|
||||
// fixups.h :
|
||||
// This file is included at the end of the generated config.h, for repairing things
|
||||
// the configure script got wrong. Because this does happen now and then.
|
||||
//
|
||||
// This header is intentionally not wrapped with the usual #ifndef/#define/#endif
|
||||
// since config.h itself doesn't do that, and we need to be inclded right after
|
||||
// it each time it's included.
|
||||
|
||||
|
||||
// =====================================================================
|
||||
// Cross compiling to powerpc-wrs-vxworks from linux amd64, observed that
|
||||
// AC_CHECK_FUNC defines HAVE_xxx for every checked function, including
|
||||
// ones that don't and can't exist like fork() & symlink(), and others that
|
||||
// could at least optionally exist, but don't in my cross compiler, like socket().
|
||||
//
|
||||
|
||||
#if HAVE_BROKEN_AC_CHECK_FUNC
|
||||
#if defined(__VXWORKS__) || defined(__vxworks)
|
||||
#undef HAVE__EXIT
|
||||
#undef HAVE_CHOWN
|
||||
#undef HAVE_EXECVE
|
||||
#undef HAVE_FORK
|
||||
#undef HAVE_GETHOSTID
|
||||
#undef HAVE_GETUID
|
||||
#undef HAVE_LSTAT
|
||||
#undef HAVE_MKSTEMP
|
||||
#undef HAVE_MKTEMP
|
||||
#undef HAVE_POPEN
|
||||
#undef HAVE_SOCKET
|
||||
#undef HAVE_SYMLINK
|
||||
#undef HAVE_SYSLOG
|
||||
#undef HAVE_READLINK
|
||||
#undef HAVE_TZSET
|
||||
#endif
|
||||
#endif
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -98,8 +98,8 @@
|
|||
// TYPEDEFS
|
||||
//=========================================================================
|
||||
|
||||
typedef int64 cFSTime;
|
||||
typedef int64 cFSType;
|
||||
typedef int64_t cFSTime;
|
||||
typedef int64_t cFSType;
|
||||
|
||||
//=========================================================================
|
||||
// GLOBALS
|
||||
|
@ -117,7 +117,7 @@ typedef int64 cFSType;
|
|||
// it is the union of MAX(elem) for all the file systems that we support
|
||||
/*class cACLElem {
|
||||
// TODO this is just a place holder
|
||||
// uint32 mUid;
|
||||
// uint32_t mUid;
|
||||
};*/
|
||||
|
||||
// this class is used only to pass arguments to iFSServices
|
||||
|
@ -136,27 +136,31 @@ struct cFSStatArgs
|
|||
TY_SOCK,
|
||||
TY_DOOR,
|
||||
TY_PORT,
|
||||
TY_NAMED
|
||||
TY_NAMED,
|
||||
TY_NATIVE,
|
||||
TY_MESSAGE_QUEUE,
|
||||
TY_SEMAPHORE,
|
||||
TY_SHARED_MEMORY
|
||||
};
|
||||
|
||||
// attr is fs dependent?
|
||||
uint64 dev; // dep
|
||||
int64 ino; // dep
|
||||
int64 mode; // dep
|
||||
int64 nlink; // indep
|
||||
int64 uid; // dep
|
||||
int64 gid; // dep
|
||||
uint64 rdev; // dep
|
||||
int64 size; // indep
|
||||
cFSTime atime; // indep
|
||||
cFSTime mtime; // indep
|
||||
cFSTime ctime; // indep
|
||||
int64 blksize; // indep
|
||||
int64 blocks; // dep
|
||||
int64 fstype; // dep
|
||||
TSTRING usid; // dep
|
||||
TSTRING gsid; // dep
|
||||
// int64 mFileType; // Matt's addition...
|
||||
uint64_t dev; // dep
|
||||
int64_t ino; // dep
|
||||
int64_t mode; // dep
|
||||
int64_t nlink; // indep
|
||||
int64_t uid; // dep
|
||||
int64_t gid; // dep
|
||||
uint64_t rdev; // dep
|
||||
int64_t size; // indep
|
||||
cFSTime atime; // indep
|
||||
cFSTime mtime; // indep
|
||||
cFSTime ctime; // indep
|
||||
int64_t blksize; // indep
|
||||
int64_t blocks; // dep
|
||||
int64_t fstype; // dep
|
||||
TSTRING usid; // dep
|
||||
TSTRING gsid; // dep
|
||||
// int64_t mFileType; // Matt's addition...
|
||||
|
||||
FileType mFileType; // redundant with other information in this struct, but
|
||||
// broken out for convenience
|
||||
|
@ -269,7 +273,7 @@ public:
|
|||
|
||||
virtual bool GetCurrentUserName(TSTRING& tstrName) const = 0;
|
||||
|
||||
virtual bool GetIPAddress(uint32& uiIPAddress) = 0;
|
||||
virtual bool GetIPAddress(uint32_t& uiIPAddress) = 0;
|
||||
|
||||
|
||||
////////////////////////////////////////
|
||||
|
@ -305,8 +309,8 @@ public:
|
|||
////////////////////////////////////////
|
||||
// miscellaneous utility functions
|
||||
////////////////////////////////////////
|
||||
virtual void ConvertModeToString(uint64 perm, TSTRING& tstrPerm) const = 0;
|
||||
// takes a int64 permission (from stat) and changes it to look like UNIX's 'ls -l' (e.g. drwxrwxrwx)
|
||||
virtual void ConvertModeToString(uint64_t perm, TSTRING& tstrPerm) const = 0;
|
||||
// takes a int64_t permission (from stat) and changes it to look like UNIX's 'ls -l' (e.g. drwxrwxrwx)
|
||||
virtual bool FullPath(TSTRING& fullPath, const TSTRING& relPath, const TSTRING& pathRelFrom = _T("")) const = 0;
|
||||
// converts relPath into a fully qualified path, storing it in FullPath. If this
|
||||
// fails, false is returned. if the path to which relPath is relative is not CWD, put it in pathRelFrom.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -45,9 +45,9 @@ public:
|
|||
{
|
||||
public:
|
||||
size_t mSize;
|
||||
int8* mpData;
|
||||
int8_t* mpData;
|
||||
|
||||
cHeap(size_t size) : mSize(size), mpData(new int8[size])
|
||||
cHeap(size_t size) : mSize(size), mpData(new int8_t[size])
|
||||
{
|
||||
ASSERT(mpData != 0);
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ void* cGrowHeap_i::Malloc(size_t size)
|
|||
// we have room to add this to the current heap.
|
||||
//
|
||||
ASSERT(mHeaps.back().mpData);
|
||||
int8* ret = mHeaps.back().mpData + mCurOff;
|
||||
int8_t* ret = mHeaps.back().mpData + mCurOff;
|
||||
mCurOff += size;
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -32,11 +32,11 @@
|
|||
// hashtable.h : a template class for mapping tuples using TCHAR*'s
|
||||
//
|
||||
// implements cHashTable, which maps a key of arbitrary type to a value
|
||||
// of arbitrary type. The key data type MUST have the const byte*()
|
||||
// of arbitrary type. The key data type MUST have the const uint8_t*()
|
||||
// operator overloaded in order for this to work. TSTRINGS will always
|
||||
// work as the key value because of the overloaded-template-function
|
||||
//
|
||||
// Note: Any overloaded const byte*() operator must return an
|
||||
// Note: Any overloaded const uint8_t*() operator must return an
|
||||
// length of key as well. see cDefaultConvert
|
||||
//
|
||||
// IMPORTANT -- cDefaultConvert only works for pointers to objects
|
||||
|
@ -85,26 +85,26 @@ template<> inline bool cDefaultCompare<TSTRING>::operator()(const TSTRING& lhs,
|
|||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Conversion function objects ... used by the hash table to locate the key in KEY_TYPE
|
||||
// into a byte* and a key length (for hashing purposes). The default implementation
|
||||
// into a uint8_t* and a key length (for hashing purposes). The default implementation
|
||||
// just does a cast. A specialization is also provided for TSTRINGs.
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
template<class T> class cDefaultConvert
|
||||
{
|
||||
public:
|
||||
const byte* operator()(const T& obj, int* const pcbKeyLen)
|
||||
const uint8_t* operator()(const T& obj, int* const pcbKeyLen)
|
||||
{
|
||||
// HACK! TODO: in the interest of time, I've left this as it is.....
|
||||
*pcbKeyLen = sizeof(TCHAR) * _tcslen(obj);
|
||||
return (byte*)obj;
|
||||
return (uint8_t*)obj;
|
||||
}
|
||||
};
|
||||
/////////////////////////////////////////////////////////
|
||||
// specialization for TSTRINGS
|
||||
/////////////////////////////////////////////////////////
|
||||
template<> inline const byte* cDefaultConvert<TSTRING>::operator()(const TSTRING& obj, int* const pcbKeyLen)
|
||||
template<> inline const uint8_t* cDefaultConvert<TSTRING>::operator()(const TSTRING& obj, int* const pcbKeyLen)
|
||||
{
|
||||
*pcbKeyLen = sizeof(TCHAR) * obj.length();
|
||||
return (byte*)obj.c_str();
|
||||
return (uint8_t*)obj.c_str();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -113,8 +113,8 @@ template<> inline const byte* cDefaultConvert<TSTRING>::operator()(const TSTRING
|
|||
// VAL -- the value you want associated with that key
|
||||
// CMP -- a function object that takes (KEY, KEY) and returns true if they
|
||||
// are equal.
|
||||
// CONVERTER -- function object that takes (KEY, int* pcbKeyLen) and returns a const byte*
|
||||
// ( points to start of key ) and a byte length (in pcbKeyLen) that tells the hashtable
|
||||
// CONVERTER -- function object that takes (KEY, int* pcbKeyLen) and returns a const uint8_t*
|
||||
// ( points to start of key ) and a uint8_t length (in pcbKeyLen) that tells the hashtable
|
||||
// how long the key is
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// these were moved outside of the class because it sucks to have to name the class with template parameters
|
||||
|
@ -172,9 +172,9 @@ public:
|
|||
bool Clear(void);
|
||||
//Clears the entire table and sets all node pointers to NULL
|
||||
bool IsEmpty(void) const;
|
||||
uint32 Hash(const KEY_TYPE& key) const;
|
||||
uint32_t Hash(const KEY_TYPE& key) const;
|
||||
//The hashing function, taken from old Tripwire
|
||||
int32 GetNumValues() const
|
||||
int32_t GetNumValues() const
|
||||
{
|
||||
return mValuesInTable;
|
||||
};
|
||||
|
@ -189,9 +189,9 @@ private:
|
|||
cHashTable(const cHashTable& rhs); // not impl
|
||||
void operator=(const cHashTable& rhs); // not impl
|
||||
|
||||
node** mTable;
|
||||
int mTableSize;
|
||||
int32 mValuesInTable;
|
||||
node** mTable;
|
||||
int mTableSize;
|
||||
int32_t mValuesInTable;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -506,12 +506,12 @@ bool cHashTable<KEY_TYPE, VAL_TYPE, COMPARE_OP, CONVERTER>::IsEmpty(void) const
|
|||
// Hash -- performs hashing on key, returns an integer index val.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
template<class KEY_TYPE, class VAL_TYPE, class COMPARE_OP, class CONVERTER>
|
||||
uint32 cHashTable<KEY_TYPE, VAL_TYPE, COMPARE_OP, CONVERTER>::Hash(const KEY_TYPE& key) const
|
||||
uint32_t cHashTable<KEY_TYPE, VAL_TYPE, COMPARE_OP, CONVERTER>::Hash(const KEY_TYPE& key) const
|
||||
{
|
||||
CONVERTER converter;
|
||||
int len;
|
||||
const byte* pb = converter(key, &len); //locates key
|
||||
uint32 hindex;
|
||||
const uint8_t* pb = converter(key, &len); //locates key
|
||||
uint32_t hindex;
|
||||
|
||||
hindex = *pb;
|
||||
while (len-- > 0)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -99,17 +99,17 @@
|
|||
#define P_(s) ()
|
||||
#endif
|
||||
|
||||
void haval_string P_((char *, uint8 *)); /* hash a string */
|
||||
int haval_file P_((char *, uint8 *)); /* hash a file */
|
||||
void haval_string P_((char *, uint8_t *)); /* hash a string */
|
||||
int haval_file P_((char *, uint8_t *)); /* hash a file */
|
||||
void haval_stdin P_((void)); /* hash input from stdin */
|
||||
void haval_start P_((haval_state *)); /* initialization */
|
||||
void haval_hash P_((haval_state *,
|
||||
uint8 *, int)); /* updating routine */
|
||||
void haval_end P_((haval_state *, uint8 *)); /* finalization */
|
||||
uint8_t *, int)); /* updating routine */
|
||||
void haval_end P_((haval_state *, uint8_t *)); /* finalization */
|
||||
void haval_hash_block P_((haval_state *)); /* hash a 32-word block */
|
||||
static void haval_tailor P_((haval_state *)); /* folding the last output */
|
||||
|
||||
static uint8 padding[128] = { /* constants for padding */
|
||||
static uint8_t padding[128] = { /* constants for padding */
|
||||
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
|
@ -222,27 +222,27 @@ static uint8 padding[128] = { /* constants for padding */
|
|||
#define rotate_right(x, n) (((x) >> (n)) | ((x) << (32-(n))))
|
||||
|
||||
#define FF_1(x7, x6, x5, x4, x3, x2, x1, x0, w) { \
|
||||
register haval_word temp = Fphi_1(x6, x5, x4, x3, x2, x1, x0); \
|
||||
haval_word temp = Fphi_1(x6, x5, x4, x3, x2, x1, x0); \
|
||||
(x7) = rotate_right(temp, 7) + rotate_right((x7), 11) + (w); \
|
||||
}
|
||||
|
||||
#define FF_2(x7, x6, x5, x4, x3, x2, x1, x0, w, c) { \
|
||||
register haval_word temp = Fphi_2(x6, x5, x4, x3, x2, x1, x0); \
|
||||
haval_word temp = Fphi_2(x6, x5, x4, x3, x2, x1, x0); \
|
||||
(x7) = rotate_right(temp, 7) + rotate_right((x7), 11) + (w) + (c); \
|
||||
}
|
||||
|
||||
#define FF_3(x7, x6, x5, x4, x3, x2, x1, x0, w, c) { \
|
||||
register haval_word temp = Fphi_3(x6, x5, x4, x3, x2, x1, x0); \
|
||||
haval_word temp = Fphi_3(x6, x5, x4, x3, x2, x1, x0); \
|
||||
(x7) = rotate_right(temp, 7) + rotate_right((x7), 11) + (w) + (c); \
|
||||
}
|
||||
|
||||
#define FF_4(x7, x6, x5, x4, x3, x2, x1, x0, w, c) { \
|
||||
register haval_word temp = Fphi_4(x6, x5, x4, x3, x2, x1, x0); \
|
||||
haval_word temp = Fphi_4(x6, x5, x4, x3, x2, x1, x0); \
|
||||
(x7) = rotate_right(temp, 7) + rotate_right((x7), 11) + (w) + (c); \
|
||||
}
|
||||
|
||||
#define FF_5(x7, x6, x5, x4, x3, x2, x1, x0, w, c) { \
|
||||
register haval_word temp = Fphi_5(x6, x5, x4, x3, x2, x1, x0); \
|
||||
haval_word temp = Fphi_5(x6, x5, x4, x3, x2, x1, x0); \
|
||||
(x7) = rotate_right(temp, 7) + rotate_right((x7), 11) + (w) + (c); \
|
||||
}
|
||||
|
||||
|
@ -251,7 +251,7 @@ static uint8 padding[128] = { /* constants for padding */
|
|||
* assume the number of characters is a multiple of four.
|
||||
*/
|
||||
#define ch2uint(string, word, slen) { \
|
||||
uint8 *sp = string; \
|
||||
uint8_t *sp = string; \
|
||||
haval_word *wp = word; \
|
||||
while (sp < (string) + (slen)) { \
|
||||
*wp++ = (haval_word)*sp | \
|
||||
|
@ -265,12 +265,12 @@ static uint8 padding[128] = { /* constants for padding */
|
|||
/* translate each word into four characters */
|
||||
#define uint2ch(word, string, wlen) { \
|
||||
haval_word *wp = word; \
|
||||
uint8 *sp = string; \
|
||||
uint8_t *sp = string; \
|
||||
while (wp < (word) + (wlen)) { \
|
||||
*(sp++) = (uint8)( *wp & 0xFF); \
|
||||
*(sp++) = (uint8)((*wp >> 8) & 0xFF); \
|
||||
*(sp++) = (uint8)((*wp >> 16) & 0xFF); \
|
||||
*(sp++) = (uint8)((*wp >> 24) & 0xFF); \
|
||||
*(sp++) = (uint8_t)( *wp & 0xFF); \
|
||||
*(sp++) = (uint8_t)((*wp >> 8) & 0xFF); \
|
||||
*(sp++) = (uint8_t)((*wp >> 16) & 0xFF); \
|
||||
*(sp++) = (uint8_t)((*wp >> 24) & 0xFF); \
|
||||
wp++; \
|
||||
} \
|
||||
}
|
||||
|
@ -278,23 +278,23 @@ static uint8 padding[128] = { /* constants for padding */
|
|||
#if 0 //unused in OST
|
||||
|
||||
/* hash a string */
|
||||
void haval_string (char *string, uint8 fingerprint[FPTLEN >> 3])
|
||||
void haval_string (char *string, uint8_t fingerprint[FPTLEN >> 3])
|
||||
{
|
||||
haval_state state;
|
||||
unsigned int len = strlen (string);
|
||||
|
||||
haval_start (&state);
|
||||
haval_hash (&state, (uint8 *)string, len);
|
||||
haval_hash (&state, (uint8_t *)string, len);
|
||||
haval_end (&state, fingerprint);
|
||||
}
|
||||
|
||||
/* hash a file */
|
||||
int haval_file (char* file_name, uint8 fingerprint[FPTLEN >> 3])
|
||||
int haval_file (char* file_name, uint8_t fingerprint[FPTLEN >> 3])
|
||||
{
|
||||
FILE *file;
|
||||
haval_state state;
|
||||
int len;
|
||||
uint8 buffer[1024];
|
||||
uint8_t buffer[1024];
|
||||
|
||||
if ((file = fopen (file_name, "rb")) == NULL)
|
||||
{
|
||||
|
@ -318,7 +318,7 @@ void haval_stdin ()
|
|||
{
|
||||
haval_state state;
|
||||
int i, len;
|
||||
uint8 buffer[32],
|
||||
uint8_t buffer[32],
|
||||
fingerprint[FPTLEN >> 3];
|
||||
|
||||
haval_start (&state);
|
||||
|
@ -351,7 +351,7 @@ void haval_start (haval_state *state)
|
|||
* hash a string of specified length.
|
||||
* to be used in conjunction with haval_start and haval_end.
|
||||
*/
|
||||
void haval_hash (haval_state* state, uint8* str, int str_len)
|
||||
void haval_hash (haval_state* state, uint8_t* str, int str_len)
|
||||
{
|
||||
ASSERT(str_len >= 0);
|
||||
|
||||
|
@ -374,17 +374,17 @@ void haval_hash (haval_state* state, uint8* str, int str_len)
|
|||
|
||||
/* hash as many blocks as possible */
|
||||
if (rmd_len + str_len >= 128) {
|
||||
memcpy (((uint8 *)state->block)+rmd_len, str, fill_len);
|
||||
memcpy (((uint8_t *)state->block)+rmd_len, str, fill_len);
|
||||
haval_hash_block (state);
|
||||
for (i = fill_len; i + 127 < str_len; i += 128){
|
||||
memcpy ((uint8 *)state->block, str+i, 128);
|
||||
memcpy ((uint8_t *)state->block, str+i, 128);
|
||||
haval_hash_block (state);
|
||||
}
|
||||
rmd_len = 0;
|
||||
} else {
|
||||
i = 0;
|
||||
}
|
||||
memcpy (((uint8 *)state->block)+rmd_len, str+i, str_len-i);
|
||||
memcpy (((uint8_t *)state->block)+rmd_len, str+i, str_len-i);
|
||||
|
||||
#else
|
||||
|
||||
|
@ -409,19 +409,19 @@ void haval_hash (haval_state* state, uint8* str, int str_len)
|
|||
}
|
||||
|
||||
/* finalization */
|
||||
void haval_end (haval_state* state, uint8 final_fpt[FPTLEN >> 3])
|
||||
void haval_end (haval_state* state, uint8_t final_fpt[FPTLEN >> 3])
|
||||
{
|
||||
uint8 tail[10];
|
||||
uint8_t tail[10];
|
||||
unsigned int rmd_len, pad_len;
|
||||
|
||||
/*
|
||||
* save the version number, the number of passes, the fingerprint
|
||||
* length and the number of bits in the unpadded message.
|
||||
*/
|
||||
tail[0] = (uint8)(((FPTLEN & 0x3) << 6) |
|
||||
tail[0] = (uint8_t)(((FPTLEN & 0x3) << 6) |
|
||||
((PASS & 0x7) << 3) |
|
||||
(HAVAL_VERSION & 0x7));
|
||||
tail[1] = (uint8)((FPTLEN >> 2) & 0xFF);
|
||||
tail[1] = (uint8_t)((FPTLEN >> 2) & 0xFF);
|
||||
uint2ch (state->count, &tail[2], 2);
|
||||
|
||||
/* pad out to 118 mod 128 */
|
||||
|
@ -448,7 +448,7 @@ void haval_end (haval_state* state, uint8 final_fpt[FPTLEN >> 3])
|
|||
/* hash a 32-word block */
|
||||
void haval_hash_block (haval_state* state)
|
||||
{
|
||||
register haval_word t0 = state->fingerprint[0], /* make use of */
|
||||
haval_word t0 = state->fingerprint[0], /* make use of */
|
||||
t1 = state->fingerprint[1], /* internal registers */
|
||||
t2 = state->fingerprint[2],
|
||||
t3 = state->fingerprint[3],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -98,13 +98,13 @@
|
|||
#include "core/tchar.h"
|
||||
#endif
|
||||
|
||||
typedef uint32 haval_word; /* a HAVAL word = 32 bits */
|
||||
typedef uint32_t haval_word; /* a HAVAL word = 32 bits */
|
||||
|
||||
typedef struct {
|
||||
haval_word count[2]; /* number of bits in a message */
|
||||
haval_word fingerprint[8]; /* current state of fingerprint */
|
||||
haval_word block[32]; /* buffer for a 32-word block */
|
||||
uint8 remainder[32*4]; /* unhashed chars (No.<128) */
|
||||
uint8_t remainder[32*4]; /* unhashed chars (No.<128) */
|
||||
} haval_state;
|
||||
|
||||
/* Do not remove this line. Protyping depends on it!
|
||||
|
@ -118,14 +118,14 @@ typedef struct {
|
|||
#define P_(s) s
|
||||
//Old prototyping stuff... I will ignore it for now.
|
||||
#if 0 //unused in OST
|
||||
void haval_string P_((char *, uint8 *)); /* hash a string */
|
||||
int haval_file P_((char *, uint8 *)); /* hash a file */
|
||||
void haval_string P_((char *, uint8_t *)); /* hash a string */
|
||||
int haval_file P_((char *, uint8_t *)); /* hash a file */
|
||||
void haval_stdin P_((void)); /* filter -- hash input from stdin */
|
||||
#endif
|
||||
|
||||
void haval_start P_((haval_state *)); /* initialization */
|
||||
void haval_hash P_((haval_state* state, uint8* str, int str_len));
|
||||
void haval_end P_((haval_state *, uint8 *)); /* finalization */
|
||||
void haval_hash P_((haval_state* state, uint8_t* str, int str_len));
|
||||
void haval_end P_((haval_state *, uint8_t *)); /* finalization */
|
||||
void haval_hash_block P_((haval_state *)); /* hash a 32-word block */
|
||||
|
||||
#endif //__HAVAL_H
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -56,9 +56,9 @@
|
|||
#include "md5.h"
|
||||
|
||||
/* forward declaration */
|
||||
static void Transform (uint32*, uint32*);
|
||||
static void Transform (uint32_t*, uint32_t*);
|
||||
|
||||
static uint8 PADDING[64] = {
|
||||
static uint8_t PADDING[64] = {
|
||||
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
|
@ -85,22 +85,22 @@ static uint8 PADDING[64] = {
|
|||
/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4 */
|
||||
/* Rotation is separate from addition to prevent recomputation */
|
||||
#define FF(a, b, c, d, x, s, ac) \
|
||||
{(a) += F ((b), (c), (d)) + (x) + (uint32)(ac); \
|
||||
{(a) += F ((b), (c), (d)) + (x) + (uint32_t)(ac); \
|
||||
(a) = ROTATE_LEFT ((a), (s)); \
|
||||
(a) += (b); \
|
||||
}
|
||||
#define GG(a, b, c, d, x, s, ac) \
|
||||
{(a) += G ((b), (c), (d)) + (x) + (uint32)(ac); \
|
||||
{(a) += G ((b), (c), (d)) + (x) + (uint32_t)(ac); \
|
||||
(a) = ROTATE_LEFT ((a), (s)); \
|
||||
(a) += (b); \
|
||||
}
|
||||
#define HH(a, b, c, d, x, s, ac) \
|
||||
{(a) += H ((b), (c), (d)) + (x) + (uint32)(ac); \
|
||||
{(a) += H ((b), (c), (d)) + (x) + (uint32_t)(ac); \
|
||||
(a) = ROTATE_LEFT ((a), (s)); \
|
||||
(a) += (b); \
|
||||
}
|
||||
#define II(a, b, c, d, x, s, ac) \
|
||||
{(a) += I ((b), (c), (d)) + (x) + (uint32)(ac); \
|
||||
{(a) += I ((b), (c), (d)) + (x) + (uint32_t)(ac); \
|
||||
(a) = ROTATE_LEFT ((a), (s)); \
|
||||
(a) += (b); \
|
||||
}
|
||||
|
@ -109,22 +109,22 @@ static uint8 PADDING[64] = {
|
|||
mdContext. All fields are set to zero. */
|
||||
void MD5Init (MD5_CTX* mdContext)
|
||||
{
|
||||
mdContext->i[0] = mdContext->i[1] = (uint32)0;
|
||||
mdContext->i[0] = mdContext->i[1] = (uint32_t)0;
|
||||
|
||||
/* Load magic initialization constants.
|
||||
*/
|
||||
mdContext->buf[0] = (uint32)0x67452301;
|
||||
mdContext->buf[1] = (uint32)0xefcdab89;
|
||||
mdContext->buf[2] = (uint32)0x98badcfe;
|
||||
mdContext->buf[3] = (uint32)0x10325476;
|
||||
mdContext->buf[0] = (uint32_t)0x67452301;
|
||||
mdContext->buf[1] = (uint32_t)0xefcdab89;
|
||||
mdContext->buf[2] = (uint32_t)0x98badcfe;
|
||||
mdContext->buf[3] = (uint32_t)0x10325476;
|
||||
}
|
||||
|
||||
/* The routine MD5Update updates the message-digest context to
|
||||
account for the presence of each of the characters inBuf[0..inLen-1]
|
||||
in the message whose digest is being computed. */
|
||||
void MD5Update (MD5_CTX* mdContext, uint8* inBuf, unsigned int inLen)
|
||||
void MD5Update (MD5_CTX* mdContext, uint8_t* inBuf, unsigned int inLen)
|
||||
{
|
||||
uint32 in[16];
|
||||
uint32_t in[16];
|
||||
int mdi;
|
||||
unsigned int i, ii;
|
||||
|
||||
|
@ -133,15 +133,15 @@ void MD5Update (MD5_CTX* mdContext, uint8* inBuf, unsigned int inLen)
|
|||
|
||||
/* update number of bits */
|
||||
#ifndef UNICOS
|
||||
if ((mdContext->i[0] + ((uint32)inLen << 3)) < mdContext->i[0])
|
||||
if ((mdContext->i[0] + ((uint32_t)inLen << 3)) < mdContext->i[0])
|
||||
#else
|
||||
if (((mdContext->i[0]+((uint32)inLen << 3)) & 0xffffffff) < mdContext->i[0])
|
||||
if (((mdContext->i[0]+((uint32_t)inLen << 3)) & 0xffffffff) < mdContext->i[0])
|
||||
#endif
|
||||
|
||||
mdContext->i[1]++;
|
||||
|
||||
mdContext->i[0] += ((uint32)inLen << 3);
|
||||
mdContext->i[1] += ((uint32)inLen >> 29);
|
||||
mdContext->i[0] += ((uint32_t)inLen << 3);
|
||||
mdContext->i[1] += ((uint32_t)inLen >> 29);
|
||||
|
||||
while (inLen--) {
|
||||
/* add new character to buffer, increment mdi */
|
||||
|
@ -150,10 +150,10 @@ void MD5Update (MD5_CTX* mdContext, uint8* inBuf, unsigned int inLen)
|
|||
/* transform if necessary */
|
||||
if (mdi == 0x40) {
|
||||
for (i = 0, ii = 0; i < 16; i++, ii += 4)
|
||||
in[i] = (((uint32)mdContext->in[ii+3]) << 24) |
|
||||
(((uint32)mdContext->in[ii+2]) << 16) |
|
||||
(((uint32)mdContext->in[ii+1]) << 8) |
|
||||
((uint32)mdContext->in[ii]);
|
||||
in[i] = (((uint32_t)mdContext->in[ii+3]) << 24) |
|
||||
(((uint32_t)mdContext->in[ii+2]) << 16) |
|
||||
(((uint32_t)mdContext->in[ii+1]) << 8) |
|
||||
((uint32_t)mdContext->in[ii]);
|
||||
Transform (mdContext->buf, in);
|
||||
mdi = 0;
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ void MD5Update (MD5_CTX* mdContext, uint8* inBuf, unsigned int inLen)
|
|||
ends with the desired message digest in mdContext->digest[0...15]. */
|
||||
void MD5Final (MD5_CTX* mdContext)
|
||||
{
|
||||
uint32 in[16];
|
||||
uint32_t in[16];
|
||||
int mdi;
|
||||
unsigned int i, ii;
|
||||
unsigned int padLen;
|
||||
|
@ -182,28 +182,28 @@ void MD5Final (MD5_CTX* mdContext)
|
|||
|
||||
/* append length in bits and transform */
|
||||
for (i = 0, ii = 0; i < 14; i++, ii += 4)
|
||||
in[i] = (((uint32)mdContext->in[ii+3]) << 24) |
|
||||
(((uint32)mdContext->in[ii+2]) << 16) |
|
||||
(((uint32)mdContext->in[ii+1]) << 8) |
|
||||
((uint32)mdContext->in[ii]);
|
||||
in[i] = (((uint32_t)mdContext->in[ii+3]) << 24) |
|
||||
(((uint32_t)mdContext->in[ii+2]) << 16) |
|
||||
(((uint32_t)mdContext->in[ii+1]) << 8) |
|
||||
((uint32_t)mdContext->in[ii]);
|
||||
Transform (mdContext->buf, in);
|
||||
|
||||
/* store buffer in digest */
|
||||
for (i = 0, ii = 0; i < 4; i++, ii += 4) {
|
||||
mdContext->digest[ii] = (uint8)(mdContext->buf[i] & 0xFF);
|
||||
mdContext->digest[ii] = (uint8_t)(mdContext->buf[i] & 0xFF);
|
||||
mdContext->digest[ii+1] =
|
||||
(uint8)((mdContext->buf[i] >> 8) & 0xFF);
|
||||
(uint8_t)((mdContext->buf[i] >> 8) & 0xFF);
|
||||
mdContext->digest[ii+2] =
|
||||
(uint8)((mdContext->buf[i] >> 16) & 0xFF);
|
||||
(uint8_t)((mdContext->buf[i] >> 16) & 0xFF);
|
||||
mdContext->digest[ii+3] =
|
||||
(uint8)((mdContext->buf[i] >> 24) & 0xFF);
|
||||
(uint8_t)((mdContext->buf[i] >> 24) & 0xFF);
|
||||
}
|
||||
}
|
||||
|
||||
/* Basic MD5 step. Transforms buf based on in. */
|
||||
static void Transform (uint32* buf, uint32* in)
|
||||
static void Transform (uint32_t* buf, uint32_t* in)
|
||||
{
|
||||
uint32 a = buf[0], b = buf[1], c = buf[2], d = buf[3];
|
||||
uint32_t a = buf[0], b = buf[1], c = buf[2], d = buf[3];
|
||||
|
||||
/* Round 1 */
|
||||
#define S11 7
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -48,14 +48,14 @@
|
|||
|
||||
/* Data structure for MD5 (Message-Digest) computation */
|
||||
typedef struct {
|
||||
uint32 i[2]; /* number of _bits_ handled mod 2^64 */
|
||||
uint32 buf[4]; /* scratch buffer */
|
||||
uint8 in[64]; /* input buffer */
|
||||
uint8 digest[16]; /* actual digest after MD5Final call */
|
||||
uint32_t i[2]; /* number of _bits_ handled mod 2^64 */
|
||||
uint32_t buf[4]; /* scratch buffer */
|
||||
uint8_t in[64]; /* input buffer */
|
||||
uint8_t digest[16]; /* actual digest after MD5Final call */
|
||||
} MD5_CTX;
|
||||
|
||||
void MD5Init(MD5_CTX*);
|
||||
void MD5Update(MD5_CTX*, uint8*, unsigned int);
|
||||
void MD5Update(MD5_CTX*, uint8_t*, unsigned int);
|
||||
void MD5Final(MD5_CTX*);
|
||||
|
||||
#endif //__MD5_H
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -72,35 +72,40 @@
|
|||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#if !IS_SORTIX
|
||||
# include <sys/file.h>
|
||||
|
||||
#if !IS_SORTIX && HAVE_SYS_FILE_H
|
||||
# include <sys/file.h>
|
||||
#endif
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <sys/wait.h>
|
||||
#include <time.h>
|
||||
#if HAVE_MALLOC_H && !IS_AROS
|
||||
#include <malloc.h>
|
||||
|
||||
#if HAVE_SYS_WAIT_H
|
||||
# include <sys/wait.h>
|
||||
#endif
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#if HAVE_MALLOC_H && !IS_AROS
|
||||
# include <malloc.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
//#include <signal.h>
|
||||
#include "tw_signal.h"
|
||||
|
||||
#ifdef __STDC__
|
||||
# include <unistd.h>
|
||||
# include <stdlib.h>
|
||||
# include <unistd.h>
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
# include <sys/param.h>
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include "msystem.h"
|
||||
|
||||
#if IS_REDOX
|
||||
#define setuid(x) sleep(0)
|
||||
#define setgid(x) sleep(0)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if USES_MSYSTEM
|
||||
/*
|
||||
* signal type
|
||||
*/
|
||||
|
@ -227,7 +232,7 @@ char *getenv(); /* get variable from environment */
|
|||
char *str;
|
||||
# endif
|
||||
{
|
||||
register char *p; /* temp pointer */
|
||||
char *p; /* temp pointer */
|
||||
|
||||
/*
|
||||
* allocate space for the string, and copy if successful
|
||||
|
@ -253,7 +258,7 @@ char **old;
|
|||
int *sz_alloc;
|
||||
#endif
|
||||
{
|
||||
register int i; /* counter in a for loop */
|
||||
int i; /* counter in a for loop */
|
||||
union xyzzy x; /* used to cast malloc properly */
|
||||
|
||||
/*
|
||||
|
@ -284,8 +289,8 @@ static int initenv(void)
|
|||
static int initenv()
|
||||
#endif
|
||||
{
|
||||
register int i;
|
||||
register int rval;
|
||||
int i;
|
||||
int rval;
|
||||
|
||||
if (envp != NULL)
|
||||
le_clobber();
|
||||
|
@ -306,7 +311,7 @@ void le_clobber(void)
|
|||
void le_clobber()
|
||||
#endif
|
||||
{
|
||||
register int i; /* counter in a for loop */
|
||||
int i; /* counter in a for loop */
|
||||
union {
|
||||
char **ep;
|
||||
char *p;
|
||||
|
@ -344,8 +349,8 @@ static int le_getenv(var)
|
|||
char *var;
|
||||
#endif
|
||||
{
|
||||
register int i; /* counter in a for loop */
|
||||
register char *p, *q; /* used to compare two strings */
|
||||
int i; /* counter in a for loop */
|
||||
char *p, *q; /* used to compare two strings */
|
||||
|
||||
/*
|
||||
* check for no environment
|
||||
|
@ -385,8 +390,8 @@ int le_set(env)
|
|||
char *env;
|
||||
#endif
|
||||
{
|
||||
register char *p, *q; /* what is to be put into env */
|
||||
register int n; /* where a previous definition is */
|
||||
char *p, *q; /* what is to be put into env */
|
||||
int n; /* where a previous definition is */
|
||||
|
||||
/*
|
||||
* see if you need to create the environment list
|
||||
|
@ -475,7 +480,7 @@ int le_unset(env)
|
|||
char *env;
|
||||
#endif
|
||||
{
|
||||
register int i; /* counter in a for loop */
|
||||
int i; /* counter in a for loop */
|
||||
|
||||
/*
|
||||
* delete it from the environment
|
||||
|
@ -595,8 +600,8 @@ static const char *shellenv(void)
|
|||
static const char *shellenv()
|
||||
#endif
|
||||
{
|
||||
register int i; /* counter in a for loop */
|
||||
register const char *shptr; /* points to shell name */
|
||||
int i; /* counter in a for loop */
|
||||
const char *shptr; /* points to shell name */
|
||||
|
||||
/*
|
||||
* error check; should never happen
|
||||
|
@ -620,6 +625,8 @@ static const char *shellenv()
|
|||
return(shptr);
|
||||
}
|
||||
|
||||
|
||||
#if USES_MSYSTEM
|
||||
/*
|
||||
* like system but A LOT safer
|
||||
*/
|
||||
|
@ -631,9 +638,9 @@ char *cmd;
|
|||
#endif
|
||||
{
|
||||
const char *argv[5]; /* argument list */
|
||||
register const char *p; /* temoporary pointers */
|
||||
register const char* shptr; /* the program to be run */
|
||||
register int i; /* index number of child */
|
||||
const char *p; /* temoporary pointers */
|
||||
const char* shptr; /* the program to be run */
|
||||
int i; /* index number of child */
|
||||
|
||||
/*
|
||||
* if it's NULL, initialize it
|
||||
|
@ -661,6 +668,7 @@ char *cmd;
|
|||
return(127);
|
||||
return(echild(i));
|
||||
}
|
||||
#endif // USES_MSYSTEM
|
||||
|
||||
/*
|
||||
* this structure holds the information associating
|
||||
|
@ -672,6 +680,7 @@ static struct popenfunc { /* association of pid, file pointer */
|
|||
FILE *fp; /* the file pointer */
|
||||
} pfunc[MAX_MPOPEN];
|
||||
|
||||
#if USES_MPOPEN
|
||||
/*
|
||||
* like popen but A LOT safer
|
||||
*/
|
||||
|
@ -684,10 +693,10 @@ char *mode;
|
|||
#endif
|
||||
{
|
||||
const char *argv[5]; /* argument list */
|
||||
register const char *p; /* temoporary pointers */
|
||||
register const char *shptr; /* the program to be run */
|
||||
const char *p; /* temoporary pointers */
|
||||
const char *shptr; /* the program to be run */
|
||||
FILE *fpa[3]; /* process communication descriptors */
|
||||
register int indx; /* index number of child */
|
||||
int indx; /* index number of child */
|
||||
|
||||
/*
|
||||
* see if anything is available
|
||||
|
@ -722,6 +731,7 @@ char *mode;
|
|||
return(NULL);
|
||||
return(pfunc[indx].fp = ((*mode == 'w') ? fpa[0] : fpa[1]));
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* close the pipe
|
||||
|
@ -733,8 +743,8 @@ int mpclose(fp)
|
|||
FILE *fp;
|
||||
#endif
|
||||
{
|
||||
register int indx; /* used to look for corresponding pid */
|
||||
register int rstatus; /* return status of command */
|
||||
int indx; /* used to look for corresponding pid */
|
||||
int rstatus; /* return status of command */
|
||||
|
||||
/*
|
||||
* loop until you find the right process
|
||||
|
@ -771,9 +781,9 @@ FILE *fpa[];
|
|||
#endif
|
||||
{
|
||||
const char *argv[5]; /* argument list */
|
||||
register const char *p; /* temoporary pointers */
|
||||
register const char *shptr; /* the program to be run */
|
||||
register int indx; /* index number of child */
|
||||
const char *p; /* temoporary pointers */
|
||||
const char *shptr; /* the program to be run */
|
||||
int indx; /* index number of child */
|
||||
|
||||
/*
|
||||
* see if anything is available
|
||||
|
@ -816,7 +826,7 @@ int indx;
|
|||
FILE *fp[];
|
||||
#endif
|
||||
{
|
||||
register int rstatus; /* return status of command */
|
||||
int rstatus; /* return status of command */
|
||||
|
||||
/*
|
||||
* loop until you find the right process
|
||||
|
@ -850,7 +860,7 @@ char *argv[];
|
|||
FILE *fpa[];
|
||||
#endif
|
||||
{
|
||||
register int indx; /* index number of child */
|
||||
int indx; /* index number of child */
|
||||
|
||||
/*
|
||||
* see if anything is available
|
||||
|
@ -883,10 +893,13 @@ FILE *fp[];
|
|||
return(mfpclose(indx, fp));
|
||||
}
|
||||
|
||||
#if IS_AROS
|
||||
#define fork() vfork()
|
||||
#if HAVE_FORK
|
||||
# define tss_fork() fork()
|
||||
#elif HAVE_VFORK
|
||||
# define tss_fork() vfork()
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* signal values
|
||||
*/
|
||||
|
@ -910,9 +923,9 @@ int mask;
|
|||
#endif
|
||||
{
|
||||
int p[3][2]; /* pipes to/from child */
|
||||
register int i; /* counter in for loop */
|
||||
register int ch_pid; /* child PID */
|
||||
register int euid, egid; /* in case reset[gu]id is -1 */
|
||||
int i; /* counter in for loop */
|
||||
int ch_pid; /* child PID */
|
||||
int euid, egid; /* in case reset[gu]id is -1 */
|
||||
/*
|
||||
* create 1 pipe for each of standard input, output, error
|
||||
*/
|
||||
|
@ -932,14 +945,26 @@ int mask;
|
|||
/*
|
||||
* spawn the child and make the pipes the subprocess stdin, stdout
|
||||
*/
|
||||
if ((ch_pid = fork()) == 0){
|
||||
if ((ch_pid = tss_fork()) == 0){
|
||||
/* now reset the uid and gid if desired */
|
||||
if (mresetgid < -1) (void) setgid(getgid());
|
||||
else if (mresetgid == -1) (void) setgid(egid);
|
||||
else if (mresetgid > -1) (void) setgid(mresetgid);
|
||||
if (mresetuid < -1) (void) setuid(getuid());
|
||||
else if (mresetuid == -1) (void) setuid(euid);
|
||||
else if (mresetuid > -1) (void) setuid(mresetuid);
|
||||
#if HAVE_SETGID
|
||||
if (mresetgid < -1)
|
||||
(void) setgid(getgid());
|
||||
else if (mresetgid == -1)
|
||||
(void) setgid(egid);
|
||||
else if (mresetgid > -1)
|
||||
(void) setgid(mresetgid);
|
||||
#endif
|
||||
|
||||
#if HAVE_SETUID
|
||||
if (mresetuid < -1)
|
||||
(void) setuid(getuid());
|
||||
else if (mresetuid == -1)
|
||||
(void) setuid(euid);
|
||||
else if (mresetuid > -1)
|
||||
(void) setuid(mresetuid);
|
||||
#endif
|
||||
|
||||
/* reset the umask */
|
||||
(void) umask(mask);
|
||||
/* close the unused ends of the pipe */
|
||||
|
@ -1028,8 +1053,7 @@ int echild(pid)
|
|||
int pid;
|
||||
#endif
|
||||
{
|
||||
|
||||
register int r; /* PID of process just exited */
|
||||
int r; /* PID of process just exited */
|
||||
int status; /* status of wait call */
|
||||
|
||||
/*
|
||||
|
@ -1050,3 +1074,5 @@ int pid;
|
|||
*/
|
||||
return(status);
|
||||
}
|
||||
|
||||
#endif // SUPPORTS_POSIX_FORK_EXEC
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -57,6 +57,8 @@
|
|||
|
||||
#include "platform.h"
|
||||
|
||||
#if SUPPORTS_POSIX_FORK_EXEC
|
||||
|
||||
#ifdef __STDC__
|
||||
void le_clobber(void);
|
||||
int le_set(const char*);
|
||||
|
@ -66,8 +68,15 @@ int le_openfd(int);
|
|||
int le_closefd(int);
|
||||
int le_euid(int);
|
||||
int le_egid(int);
|
||||
|
||||
#if USES_MSYSTEM
|
||||
int msystem(const char*);
|
||||
#endif
|
||||
|
||||
#if USES_MPOPEN
|
||||
FILE *mpopen(const char*, const char*);
|
||||
#endif
|
||||
|
||||
int mpclose(FILE *);
|
||||
int mfpopen(const char*, FILE *[]);
|
||||
int mfpclose(int, FILE *[]);
|
||||
|
@ -136,3 +145,4 @@ int echild();
|
|||
# define NOSHELL "/bin/sh" /* use this if no shell */
|
||||
#endif
|
||||
|
||||
#endif // SUPPORTS_POSIX_FORK_EXEC
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -71,11 +71,19 @@ namespace tss
|
|||
typedef std::wstring dbstring;
|
||||
}
|
||||
|
||||
#elif (USE_U16STRING)
|
||||
namespace tss
|
||||
{
|
||||
typedef std::u16string dbstring;
|
||||
}
|
||||
|
||||
#elif (WCHAR_IS_32_BITS)
|
||||
#if HAVE_LOCALE
|
||||
namespace std
|
||||
{
|
||||
template<> struct char_traits<dbchar_t>;
|
||||
}
|
||||
#endif
|
||||
namespace tss
|
||||
{
|
||||
typedef std::basic_string<dbchar_t> dbstring;
|
||||
|
@ -87,9 +95,10 @@ typedef std::basic_string<dbchar_t> dbstring;
|
|||
#endif
|
||||
|
||||
|
||||
#if WCHAR_IS_32_BITS // We already have a dbstring implicitly in wstring!!!
|
||||
#if NEED_DBSTRING_IMPL // We already have a dbstring implicitly in wstring!!!
|
||||
|
||||
#include <locale>
|
||||
#if HAVE_LOCALE
|
||||
# include <locale>
|
||||
|
||||
// specialize *std*::char_traits!!!
|
||||
|
||||
|
@ -192,11 +201,9 @@ template<> struct std::char_traits<dbchar_t>
|
|||
return lhs == rhs;
|
||||
}
|
||||
|
||||
# if IS_STDLIB_MODENA
|
||||
|
||||
#if IS_STDLIB_MODENA
|
||||
// CAUTION:RAD -- Extra members required by Modena!!
|
||||
|
||||
# ifdef MBSTATE_T_DEFINED // This is ANSI-C *not* ANSI-C++!!
|
||||
#ifdef MBSTATE_T_DEFINED // This is ANSI-C *not* ANSI-C++!!
|
||||
static state_type get_state(pos_type pos)
|
||||
{
|
||||
return pos.state();
|
||||
|
@ -206,7 +213,7 @@ template<> struct std::char_traits<dbchar_t>
|
|||
{
|
||||
return pos_type(pos.offset(), state);
|
||||
}
|
||||
# endif //MBSTATE_T_DEFINED
|
||||
#endif //MBSTATE_T_DEFINED
|
||||
|
||||
static char_type newline()
|
||||
{
|
||||
|
@ -217,14 +224,14 @@ template<> struct std::char_traits<dbchar_t>
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
# endif //IS_STDLIB_MODENA
|
||||
#endif //IS_STDLIB_MODENA
|
||||
|
||||
static int_type eof()
|
||||
{
|
||||
return (wint_t)(0xFFFF);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
# endif //WCHAR_IS_16_BITS // We already have a dbstring implicitly in wstring!!!
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -86,9 +86,12 @@ typedef const wchar_t* const_ntwcs_t;
|
|||
# define NTDBS_T_DEFINED
|
||||
# if WCHAR_IS_16_BITS
|
||||
typedef wchar_t dbchar_t; // Same size but use NT's type
|
||||
# elif USE_CHAR16_T
|
||||
typedef char16_t dbchar_t;
|
||||
# else
|
||||
typedef uint16 dbchar_t;
|
||||
typedef uint16_t dbchar_t;
|
||||
# endif
|
||||
|
||||
typedef dbchar_t* ntdbs_t;
|
||||
typedef const dbchar_t* const_ntdbs_t;
|
||||
#endif //NTDBS_T_DEFINED
|
||||
|
@ -101,7 +104,7 @@ typedef const dbchar_t* const_ntdbs_t;
|
|||
# if WCHAR_IS_32_BITS
|
||||
typedef wchar_t qbchar_t; // Same size but use NT's type
|
||||
# else
|
||||
typedef uint32 qbchar_t;
|
||||
typedef uint32_t qbchar_t;
|
||||
# endif
|
||||
typedef qbchar_t* ntqbs_t;
|
||||
typedef const qbchar_t* const_ntqbs_t;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -33,73 +33,48 @@
|
|||
// platform.h
|
||||
//
|
||||
|
||||
#ifndef __PLATFORM_H
|
||||
#define __PLATFORM_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifndef __PLATFORM_H
|
||||
# define __PLATFORM_H
|
||||
#if HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_FEATURES_H
|
||||
#include <features.h>
|
||||
#endif
|
||||
|
||||
//NOTE: Autoconf is strongly preferred as the Right Way to detect platform-specific features/behaviors.
|
||||
// These macros should really only be used when autoconf can't get the job done.
|
||||
|
||||
//=============================================================================
|
||||
// Enumerations
|
||||
//
|
||||
// For each of these "enumerations" we create unique integers identifying each
|
||||
// variation. We group similar items together, such as OS_REDHAT and OS_SLACKWARE
|
||||
///////////////////////////////
|
||||
|
||||
# define OS_UNKNOWN 0
|
||||
#define COMP_UNKNOWN 0
|
||||
#define COMP_GCC 0x0001
|
||||
#define COMP_CLANG 0x0002
|
||||
|
||||
# define OS_WIN32 0x0101
|
||||
# define OS_CYGWIN 0x0102
|
||||
# define OS_DOS_DJGPP 0x0103
|
||||
#define COMP_MSVC 0x0101
|
||||
|
||||
# define OS_LINUX 0x0201
|
||||
# define OS_ANDROID 0x0202
|
||||
// Definitions for the old KAI C++ compiler.
|
||||
// KCC was EOL'd ages ago, but I'm leaving these definitions here for now
|
||||
// on the off chance someone's still using it.
|
||||
#define COMP_KAI 0x0200
|
||||
#define COMP_KAI_GCC 0x0201
|
||||
#define COMP_KAI_SUNPRO 0x0202
|
||||
#define COMP_KAI_GLIBC 0x0203
|
||||
#define COMP_KAI_VISUALAGE 0x0204
|
||||
#define COMP_KAI_HPANSIC 0x0205
|
||||
#define COMP_KAI_IRIX 0x0206
|
||||
#define COMP_KAI_OSF1ALPHA 0x0207
|
||||
|
||||
# define OS_FREEBSD 0x0301
|
||||
# define OS_NETBSD 0x0302
|
||||
# define OS_OPENBSD 0x0303
|
||||
# define OS_DARWIN 0x0304
|
||||
# define OS_DRAGONFLYBSD 0x0305
|
||||
# define OS_MIDNIGHTBSD 0x0306
|
||||
# define OS_MIRBSD 0x0307
|
||||
# define OS_BITRIG 0x0308
|
||||
# define OS_LIBERTYBSD 0x0309
|
||||
#define COMP_SUNPRO 0x0301
|
||||
#define COMP_XL_C 0x0302
|
||||
#define COMP_ACC 0x0303
|
||||
|
||||
# define OS_SOLARIS 0x0400
|
||||
# define OS_AIX 0x0401
|
||||
# define OS_HPUX 0x0402
|
||||
# define OS_IRIX 0x0403
|
||||
# define OS_OSF1 0x0404
|
||||
|
||||
# define OS_MINIX 0x0501
|
||||
# define OS_HURD 0x0502
|
||||
# define OS_HAIKU 0x0503
|
||||
# define OS_SYLLABLE 0x0504
|
||||
# define OS_SKYOS 0x0505
|
||||
# define OS_SORTIX 0x0506
|
||||
# define OS_MINT 0x0507
|
||||
# define OS_AROS 0x0508
|
||||
# define OS_RTEMS 0x0509
|
||||
# define OS_RISCOS 0x050A
|
||||
# define OS_REDOX 0x050B
|
||||
# define OS_QNX 0x050C
|
||||
|
||||
# define COMP_UNKNOWN 0
|
||||
# define COMP_GCC 0x0001
|
||||
# define COMP_CLANG 0x0002
|
||||
|
||||
# define COMP_MSVC 0x0101
|
||||
# define COMP_KAI_GCC 0x0201
|
||||
# define COMP_KAI_SUNPRO 0x0202
|
||||
# define COMP_KAI_GLIBC 0x0203
|
||||
# define COMP_KAI_VISUALAGE 0x0204
|
||||
# define COMP_KAI_HPANSIC 0x0205
|
||||
# define COMP_KAI_IRIX 0x0206
|
||||
# define COMP_KAI_OSF1ALPHA 0x0207
|
||||
# define COMP_SUNPRO 0x0301
|
||||
|
||||
//=============================================================================
|
||||
// Platform detection
|
||||
|
@ -111,159 +86,67 @@
|
|||
//
|
||||
// OS The OS
|
||||
// COMP The compiler
|
||||
//
|
||||
// PLEASE NOTE: Do not set any preprocessor variable other than the above three in this
|
||||
// section. Use the following sections for anything that does not fall into
|
||||
// the above catagories.
|
||||
|
||||
# if defined(_WIN32)
|
||||
# define OS OS_WIN32
|
||||
# define IS_WIN32 1
|
||||
|
||||
# elif defined(__CYGWIN__)
|
||||
# define OS OS_CYGWIN
|
||||
# define IS_CYGWIN 1
|
||||
|
||||
# elif defined(__DJGPP__)
|
||||
# define OS OS_DOS_DJGPP
|
||||
# define IS_DOS_DJGPP 1
|
||||
// plus IS_xxx macros for the OS & compiler
|
||||
|
||||
|
||||
# elif defined(__ANDROID__)
|
||||
# define OS OS_ANDROID
|
||||
# define IS_ANDROID 1
|
||||
//////////////////////////////
|
||||
// Compiler detection
|
||||
|
||||
# elif defined(__linux__)
|
||||
# define OS OS_LINUX
|
||||
# define IS_LINUX 1
|
||||
#if defined(HAVE_GCC)
|
||||
# define IS_GCC 1
|
||||
|
||||
#elif defined(HAVE_CLANG)
|
||||
# define IS_CLANG 1
|
||||
|
||||
// A herd of BSDs. Have to detect MidnightBSD before FreeBSD, and MirOS & Bitrig before OpenBSD
|
||||
// because they also define symbols for their ancestor BSDs.
|
||||
# elif defined(__DragonFly__)
|
||||
# define OS OS_DRAGONFLYBSD
|
||||
# define IS_DRAGONFLYBSD 1
|
||||
|
||||
# elif defined(__MidnightBSD__)
|
||||
# define OS OS_MIDNIGHTBSD
|
||||
# define IS_MIDNIGHTBSD 1
|
||||
|
||||
# elif defined(__FreeBSD__)
|
||||
# define OS OS_FREEBSD
|
||||
# define IS_FREEBSD 1
|
||||
|
||||
# elif defined(__NetBSD__)
|
||||
# define OS OS_NETBSD
|
||||
# define IS_NETBSD 1
|
||||
|
||||
# elif defined(__MirBSD__)
|
||||
# define OS OS_MIRBSD
|
||||
# define IS_MIRBSD 1
|
||||
|
||||
# elif defined(__Bitrig__)
|
||||
# define OS OS_BITRIG
|
||||
# define IS_BITRIG 1
|
||||
|
||||
# elif defined(TW_LibertyBSD)
|
||||
# define OS OS_LIBERTYBSD
|
||||
# define IS_LIBERTYBSD 1
|
||||
|
||||
# elif defined(__OpenBSD__)
|
||||
# define OS OS_OPENBSD
|
||||
# define IS_OPENBSD 1
|
||||
|
||||
# elif defined(__APPLE__)
|
||||
# define OS OS_DARWIN
|
||||
# define IS_DARWIN 1
|
||||
|
||||
|
||||
# elif defined(__sun)
|
||||
# define OS OS_SOLARIS
|
||||
# define IS_SOLARIS 1
|
||||
|
||||
# elif defined(_AIX)
|
||||
# define OS OS_AIX
|
||||
# define IS_AIX 1
|
||||
|
||||
# elif defined(__hpux)
|
||||
# define OS OS_HPUX
|
||||
# define IS_HPUX 1
|
||||
|
||||
# elif defined(__sgi)
|
||||
# define OS OS_IRIX
|
||||
# define IS_IRIX 1
|
||||
|
||||
# elif defined(TRU64) || defined(__OSF1__)
|
||||
# define OS OS_OSF1
|
||||
# define IS_OSF1 1
|
||||
|
||||
|
||||
# elif defined(__minix__)
|
||||
# define OS OS_MINIX
|
||||
# define IS_MINIX 1
|
||||
|
||||
# elif defined(__gnu_hurd__)
|
||||
# define OS OS_HURD
|
||||
# define IS_HURD 1
|
||||
|
||||
# elif defined(__HAIKU__)
|
||||
# define OS OS_HAIKU
|
||||
# define IS_HAIKU 1
|
||||
|
||||
# elif defined(__SYLLABLE__)
|
||||
# define OS OS_SYLLABLE
|
||||
# define IS_SYLLABLE 1
|
||||
|
||||
# elif defined(SKYOS)
|
||||
# define OS OS_SKYOS
|
||||
# define IS_SKYOS 1
|
||||
|
||||
# elif defined(_SORTIX_SOURCE)
|
||||
# define OS OS_SORTIX
|
||||
# define IS_SORTIX 1
|
||||
|
||||
# elif defined(__MINT__)
|
||||
# define OS OS_MINT
|
||||
# define IS_MINT 1
|
||||
|
||||
# elif defined(__AROS__)
|
||||
# define OS OS_AROS
|
||||
# define IS_AROS 1
|
||||
|
||||
# elif defined(__rtems__)
|
||||
# define OS OS_RTEMS
|
||||
# define IS_RTEMS 1
|
||||
|
||||
# elif defined(__riscos__)
|
||||
# define OS OS_RISCOS
|
||||
# define IS_RISCOS 1
|
||||
|
||||
# elif defined(__redox__)
|
||||
# define OS OS_REDOX
|
||||
# define IS_REDOX 1
|
||||
|
||||
# elif defined(__QNX__)
|
||||
# define OS OS_QNX
|
||||
# define IS_QNX 1
|
||||
#elif defined(HAVE_MSVC)
|
||||
# define IS_MSVC 1
|
||||
|
||||
#elif defined(HAVE_KAI_KCC)
|
||||
# if !defined(COMP)
|
||||
# define COMP COMP_KAI
|
||||
# endif
|
||||
# define IS_KAI 1
|
||||
|
||||
#elif defined(HAVE_ORACLE_SUNCC)
|
||||
# define IS_SUNPRO 1
|
||||
|
||||
#elif defined(HAVE_IBM_XL_C) || defined(HAVE_IBM_GXLC)
|
||||
# define IS_XL_C 1
|
||||
|
||||
#elif defined(HAVE_HP_ACC)
|
||||
# define IS_HP_ACC 1
|
||||
#endif
|
||||
|
||||
|
||||
/* XXX: COMP may now not resolve, because autoconf may
|
||||
* detect GCC. This is done in the hopes that all
|
||||
* COMP detections, and indeed both OS & COMP detechtions
|
||||
* will eventualy be done automatically.
|
||||
*
|
||||
* This means, the former "#if !defined(COMP)" will
|
||||
* temporarily have to also check the HAVE_[compiler]
|
||||
* #defines until all compilers are checked by autoconf,
|
||||
* at which point this can be removed completely.
|
||||
*
|
||||
* PH - 20010311
|
||||
*/
|
||||
# if !defined(COMP) && !defined(HAVE_GCC)
|
||||
# error COMP definition did not resolve. Check "platform.h".
|
||||
# endif
|
||||
//////////////////////////
|
||||
// OS detection
|
||||
|
||||
#if defined(_WIN32)
|
||||
# define IS_WIN32 1
|
||||
|
||||
#elif defined(__DJGPP__)
|
||||
# define IS_DOS_DJGPP 1
|
||||
|
||||
#elif defined(__FreeBSD__)
|
||||
# define IS_FREEBSD 1
|
||||
|
||||
#elif defined(SKYOS)
|
||||
# define IS_SKYOS 1
|
||||
|
||||
#elif defined(_SORTIX_SOURCE)
|
||||
# define IS_SORTIX 1
|
||||
|
||||
#elif defined(__AROS__) || defined(AMIGA)
|
||||
# define IS_AROS 1
|
||||
|
||||
#elif defined(__riscos__)
|
||||
# define IS_RISCOS 1
|
||||
|
||||
#elif defined(__redox__)
|
||||
# define IS_REDOX 1
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
//=============================================================================
|
||||
// Platform Macros (a.k.a. "IS_" macros)
|
||||
|
@ -271,6 +154,10 @@
|
|||
// These macros are the "worker bees" of platform.h. Programmers should use
|
||||
// these macros rather than comparing PLATFORM to the unique IDs by hand.
|
||||
//
|
||||
// NOTE: Wherever possible, let autotools figure this out & define it in config.h
|
||||
// rather than hardcoding it here. If autotools misdefines something, use
|
||||
// core/fixups.h, which is guaranteed to be (re)included right after config.h
|
||||
//
|
||||
// NB: Programmers are STRONGLY ENCOURAGED not to use the OS detection macros
|
||||
// or compiler detection marcros directly. Instead they should create
|
||||
// macros specific to the task at hand. For example Win32 and Solaris support
|
||||
|
@ -288,95 +175,212 @@
|
|||
// int network_order = swap(machine_order);
|
||||
// #endif
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
|
||||
// complier detection
|
||||
# define IS_KAI \
|
||||
(COMP == COMP_KAI_GCC || COMP == COMP_KAI_SUNPRO || COMP == COMP_KAI_GLIBC || COMP == COMP_KAI_VISUALAGE || \
|
||||
COMP == COMP_KAI_HPANSIC || COMP == COMP_KAI_IRIX || COMP == COMP_KAI_OSF1ALPHA)
|
||||
# define IS_MSVC (COMP == COMP_MSVC)
|
||||
# define IS_SUNPRO (COMP == COMP_SUNPRO)
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
// Unicode
|
||||
# define SUPPORTS_UNICODE IS_WIN32 // The OS supports Unicode
|
||||
#define CPLUSPLUS_1998_OR_GREATER (__cplusplus >= 199711L)
|
||||
#define CPLUSPLUS_PRE_1998 !CPLUSPLUS_1998_OR_GREATER
|
||||
|
||||
#define CPLUSPLUS_2011_OR_GREATER (__cplusplus >= 201103L)
|
||||
#define CPLUSPLUS_PRE_2011 !CPLUSPLUS_2011_OR_GREATER
|
||||
|
||||
#define CPLUSPLUS_2017_OR_GREATER (__cplusplus >= 201703L)
|
||||
#define CPLUSPLUS_PRE_2017 !CPLUSPLUS_2017_OR_GREATER
|
||||
|
||||
#define CPLUSPLUS_2020_OR_GREATER (__cplusplus >= 202002L)
|
||||
#define CPLUSPLUS_PRE_2020 !CPLUSPLUS_2020_OR_GREATER
|
||||
|
||||
// KAI 3.4 uses a much improved stl
|
||||
# define IS_KAI_3_4 (IS_KAI && (COMP == COMP_KAI_IRIX || COMP == COMP_KAI_OSF1ALPHA || COMP == COMP_KAI_GLIBC))
|
||||
#define IS_KAI_3_4 (IS_KAI && (COMP == COMP_KAI_IRIX || COMP == COMP_KAI_OSF1ALPHA || COMP == COMP_KAI_GLIBC))
|
||||
|
||||
// Used in twlocale
|
||||
# define USE_STD_CPP_LOCALE_WORKAROUND \
|
||||
#define USE_STD_CPP_LOCALE_WORKAROUND \
|
||||
(IS_SUNPRO || (IS_KAI && !IS_KAI_3_4)) // TODO:BAM -- name this something more general.
|
||||
# define USE_CLIB_LOCALE IS_KAI || HAVE_GCC
|
||||
# define USES_CLIB_DATE_FUNCTION \
|
||||
|
||||
#define USE_CLIB_LOCALE (!HAVE_LOCALE || HAVE_GCC || IS_KAI)
|
||||
|
||||
#define USES_CLIB_DATE_FUNCTION \
|
||||
(USE_CLIB_LOCALE || IS_SUNPRO || \
|
||||
IS_MSVC) // if we use clib, can't use C++ time_put, and SUNPRO and MSVC add characters
|
||||
//#define USE_CLIB_LOCALE (IS_ALPHA || IS_IRIX || (IS_KAI && !IS_KAI_3_4))
|
||||
|
||||
#if defined(__GLIBC__)
|
||||
#define USES_GLIBC 1
|
||||
#endif
|
||||
|
||||
#define SUPPORTS_MEMBER_TEMPLATES (!IS_SUNPRO)
|
||||
#define SUPPORTS_EXPLICIT_TEMPLATE_FUNC_INST (!IS_SUNPRO)
|
||||
|
||||
// Threading API
|
||||
// TODO:mdb -- this is not complete or rigorous on the unix side!!!
|
||||
# define SUPPORTS_WIN32_THREADS IS_WIN32
|
||||
# define SUPPORTS_POSIX_THREADS (!SUPPORTS_WIN32_THREADS)
|
||||
#define SUPPORTS_WIN32_THREADS IS_WIN32
|
||||
#define SUPPORTS_POSIX_THREADS (HAVE_PTHREAD_H)
|
||||
|
||||
// Miscellaneous
|
||||
# define WCHAR_IS_16_BITS IS_WIN32
|
||||
# define WCHAR_IS_32_BITS IS_UNIX
|
||||
# define WCHAR_REP_IS_UCS2 IS_WIN32
|
||||
#define SUPPORTS_C_FILE_IO (HAVE_FOPEN && HAVE_FREAD && HAVE_FCLOSE)
|
||||
#define SUPPORTS_POSIX_FILE_IO (HAVE_OPEN && HAVE_READ && HAVE_CLOSE)
|
||||
#define SUPPORTS_SYMLINKS (HAVE_READLINK || HAVE_READLINKAT)
|
||||
|
||||
#define ARCHAIC_STL (!HAVE_LOCALE && !HAVE_SSTREAM)
|
||||
|
||||
#if (SIZEOF_WCHAR_T == 2)
|
||||
# define WCHAR_IS_16_BITS 1
|
||||
# define WCHAR_REP_IS_UCS2 1
|
||||
#elif (SIZEOF_WCHAR_T == 4)
|
||||
# define WCHAR_IS_32_BITS 1
|
||||
#endif
|
||||
|
||||
#define USE_U16STRING ((!WCHAR_IS_16_BITS) && CPLUSPLUS_2011_OR_GREATER)
|
||||
#define USE_CHAR16_T USE_U16STRING
|
||||
#define NEED_DBSTRING_IMPL (!WCHAR_IS_16_BITS && !USE_U16STRING)
|
||||
|
||||
#define USE_UNIQUE_PTR CPLUSPLUS_2011_OR_GREATER
|
||||
#define USE_LAMBDAS CPLUSPLUS_2011_OR_GREATER
|
||||
#define USE_UNICODE_ESCAPES CPLUSPLUS_2011_OR_GREATER
|
||||
#define USE_UNEXPECTED CPLUSPLUS_PRE_2017
|
||||
|
||||
#define SUPPORTS_POSIX_FORK_EXEC ((HAVE_FORK || HAVE_VFORK) && HAVE_EXECVE)
|
||||
|
||||
#define USE_DEV_URANDOM (HAVE_DEV_URANDOM && ENABLE_DEV_URANDOM)
|
||||
|
||||
|
||||
// Per-platform special cases. At least some of these could be replaced
|
||||
// with better autotools detection
|
||||
|
||||
// msystem+mpopen fail on Syllable, so use the libc equivalents until we figure out why.
|
||||
// TODO: Figure out why.
|
||||
# define USES_MPOPEN (IS_UNIX && !IS_SYLLABLE)
|
||||
# define USES_MSYSTEM (IS_UNIX && !IS_SYLLABLE)
|
||||
# define SUPPORTS_WCHART IS_WIN32 // TODO: Remove after getting new ver of KAI
|
||||
# define USES_GLIBC ((COMP == COMP_KAI_GLIBC) || HAVE_GCC)
|
||||
# define SUPPORTS_MEMBER_TEMPLATES (!IS_SUNPRO)
|
||||
# define SUPPORTS_EXPLICIT_TEMPLATE_FUNC_INST (!IS_SUNPRO)
|
||||
#if !defined(__SYLLABLE__)
|
||||
# define USES_MPOPEN (SUPPORTS_POSIX_FORK_EXEC)
|
||||
# define USES_MSYSTEM (SUPPORTS_POSIX_FORK_EXEC)
|
||||
#endif
|
||||
|
||||
# define SUPPORTS_POSIX_SIGNALS (!IS_DOS_DJGPP)
|
||||
# define SUPPORTS_NETWORKING (!IS_SORTIX && !IS_DOS_DJGPP && !IS_REDOX)
|
||||
# define SUPPORTS_SYSLOG (HAVE_SYSLOG_H && !IS_SKYOS && !IS_RISCOS)
|
||||
# define NEEDS_SWAB_IMPL (IS_CYGWIN || IS_SYLLABLE || IS_ANDROID || IS_SORTIX)
|
||||
# define USES_MBLEN (!IS_ANDROID && !IS_AROS)
|
||||
# define USES_DEVICE_PATH (IS_AROS || IS_DOS_DJGPP || IS_RISCOS || IS_REDOX)
|
||||
# define ICONV_CONST_SOURCE (IS_MINIX)
|
||||
# define SUPPORTS_DIRECT_IO (IS_LINUX)
|
||||
// Linux is the only platform where direct i/o hashing has been tested & works properly so far.
|
||||
#if (!defined(__DJGPP__) && !defined(__MINGW32__))
|
||||
# define SUPPORTS_POSIX_SIGNALS 1
|
||||
#endif
|
||||
|
||||
# define SUPPORTS_TERMIOS (!IS_RTEMS && !IS_REDOX)
|
||||
// RTEMS errors are probably just a buildsys issue & this will change or go away.
|
||||
// Redox will probably implement this in the future.
|
||||
#if (!defined(__DJGPP__) && !defined(SORTIX_SOURCE) && !defined(__redox__))
|
||||
# define SUPPORTS_NETWORKING (HAVE_SOCKET)
|
||||
#endif
|
||||
|
||||
# define CAN_UNLINK_WHILE_OPEN (!IS_AROS && !IS_RISCOS && !IS_REDOX && !IS_DOS_DJGPP)
|
||||
#if (!defined(SKYOS) && !defined(__riscos__))
|
||||
# define SUPPORTS_SYSLOG (HAVE_SYSLOG)
|
||||
#endif
|
||||
|
||||
#if (defined(__CYGWIN__) || defined(__SYLLABLE__) || defined(__ANDROID__) || defined(SORTIX_SOURCE))
|
||||
# define NEEDS_SWAB_IMPL 1
|
||||
#else
|
||||
# define NEEDS_SWAB_IMPL (!HAVE_SWAB)
|
||||
#endif
|
||||
|
||||
#if defined(__MINGW32__)
|
||||
# define SWAB_TAKES_CHAR_PTRS 1
|
||||
# define MKDIR_TAKES_SINGLE_ARG 1
|
||||
#endif
|
||||
|
||||
#if (defined(__QNX__) || defined(__QNXNTO__)) && !defined(BBNDK_VERSION_CURRENT)
|
||||
# define SWAB_TAKES_CHAR_PTRS 1
|
||||
#endif
|
||||
|
||||
#if (!defined(__ANROID__) && !defined(__AROS__))
|
||||
# define USES_MBLEN (HAVE_MBLEN)
|
||||
#endif
|
||||
|
||||
#if (defined(__DJGPP__) || (defined(_WIN32) && !defined(__CYGWIN__)) || (defined(__OS2__) && !defined(__EMX__)))
|
||||
# define USES_DOS_DEVICE_PATH 1
|
||||
#endif
|
||||
|
||||
#if defined(__redox__)
|
||||
# define USES_URI_PATH 1
|
||||
#endif
|
||||
|
||||
#if (USES_DOS_DEVICE_PATH || USES_URI_PATH || defined(__riscos__) || defined(__AROS__))
|
||||
# define USES_DEVICE_PATH 1
|
||||
#endif
|
||||
|
||||
#if defined(__minix__)
|
||||
# define ICONV_CONST_SOURCE 1
|
||||
#endif
|
||||
|
||||
#if defined(SKYOS)
|
||||
# define READLINK_NULL_TERMINATES 1
|
||||
#endif
|
||||
|
||||
// HP-UX does have posix_fadvise(), but sys/fcntl.h neglects to wrap it in extern "C" on
|
||||
// at least some flavors of the OS. (see https://community.hpe.com/t5/Languages-and-Scripting/Bacula-try-to-compile-on-hpux11-31/m-p/6843389 )
|
||||
// The thread indicates this problem can be fixed by editing sys/fcntl.h, and then the special case below
|
||||
// can be removed. This is left as an exercise for the reader.
|
||||
#if !defined(__hpux)
|
||||
# define SUPPORTS_POSIX_FADVISE (HAVE_POSIX_FADVISE)
|
||||
#endif
|
||||
|
||||
#if defined(__VXWORKS__)
|
||||
# define READ_TAKES_CHAR_PTR 1
|
||||
#endif
|
||||
|
||||
#if (!defined(__RTEMS__) && !defined(__redox__))
|
||||
# define SUPPORTS_TERMIOS (HAVE_TERMIOS_H)
|
||||
#endif
|
||||
|
||||
// Unlinking an open file (to make a temporary file nobody else can see) is a Posix-ism
|
||||
// that other platforms generally don't support.
|
||||
#if (!defined(__CYGWIN__) && !defined(__DJGPP__) && !defined(__riscos__) && !defined(__redox__) && !defined(_WIN32) && !defined(__OS2__) && !IS_AROS)
|
||||
# define CAN_UNLINK_WHILE_OPEN 1
|
||||
#endif
|
||||
|
||||
# define SUPPORTS_DOUBLE_SLASH_PATH (IS_CYGWIN)
|
||||
// POSIX standard says paths beginning with 2 slashes are "implementation defined"
|
||||
// (see http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html#tag_04_11 )
|
||||
// The only platform OST works on (afaik) that actually defines a double-slash behavior is Cygwin
|
||||
// which uses this syntax for UNC paths. So we'll allow leading double slashes there, but
|
||||
// continue removing them on all other platforms
|
||||
// The only platform OST is known to work on (afaik) that actually defines a double-slash behavior is Cygwin
|
||||
// which uses this syntax for UNC paths. OST also might Just Work under Unix System Services on
|
||||
// z/OS / MVS / OS/390, which uses a leading double slash for dataset paths, so I'll add that
|
||||
// to the macro even though I don't have the hardware to actually test this.
|
||||
//
|
||||
// Other platform known to use this include IBM z/OS and the ancient Apollo Domain/OS.
|
||||
#if (defined(__CYGWIN__) || defined(__MVS__))
|
||||
# define SUPPORTS_DOUBLE_SLASH_PATH 1
|
||||
#endif
|
||||
|
||||
# define USE_DEV_URANDOM (HAVE_DEV_URANDOM && ENABLE_DEV_URANDOM)
|
||||
// Platforms where we might encounter AS/400 native objects,
|
||||
// which are only sometimes readable via ordinary file API
|
||||
#if defined(__OS400__) || defined(_AIX)
|
||||
# define SUPPORTS_NATIVE_OBJECTS 1
|
||||
#endif
|
||||
|
||||
// On most platforms, uname() returns 0 on success, like every other syscall out there.
|
||||
// However the POSIX standard merely says uname() returns some nonnegative value on success, probably
|
||||
// so certain vendors could be POSIX-compliant without changing anything. Solaris seems to return 1
|
||||
// on success, for example. If any other examples crop up, add them here, or figure out how to
|
||||
// do this with autoconf instead.
|
||||
//
|
||||
#if defined(__sun)
|
||||
# define UNAME_SUCCESS_POSIX 1
|
||||
#else
|
||||
# define UNAME_SUCCESS_ZERO 1
|
||||
#endif
|
||||
|
||||
// Whether to try unaligned access checks in one unit test of dubious value
|
||||
#if !defined(__sun) && !defined(__hpux)
|
||||
# define ENABLE_ALIGNMENT_TEST 1
|
||||
#endif
|
||||
|
||||
//=============================================================================
|
||||
// Miscellaneous
|
||||
//
|
||||
// Put all items that are not an "IS_" macro here.
|
||||
|
||||
# if IS_BYTE_ALIGNED
|
||||
# define BYTE_ALIGN 8
|
||||
# else
|
||||
# error Unknown Byte alignment
|
||||
# endif
|
||||
// This should ordinarily always be 8, but we'll do it the autoconf way just in case.
|
||||
#define BYTE_ALIGN ALIGNOF_LONG_LONG
|
||||
|
||||
// A scalar that matches the sizeof a pointer
|
||||
typedef unsigned long ptr_size_type; // true for all of our current platforms
|
||||
// TODO: I would like to use a XXXX_t like name
|
||||
typedef uintptr_t ptr_size_type;
|
||||
|
||||
// Check integer representation
|
||||
# if !(USES_2S_COMPLEMENT)
|
||||
# error "Tripwire will only work on a 2's complement CPU. Check \"platform.h\"."
|
||||
# endif
|
||||
// Check signed integer representation
|
||||
// This check has been around for ages, and I'm not sure it's still accurate.
|
||||
// It's not like there's a lot of contemporary non-2s-complement hardware out there
|
||||
// to try this on. Anyway, the configure script always defines USES_2S_COMPLEMENT to 1
|
||||
// without actually checking anything, so this check wasn't performing a valuable service here.
|
||||
//
|
||||
//#if !(USES_2S_COMPLEMENT)
|
||||
//# error "Tripwire will only work on a 2's complement CPU. Check \"platform.h\"."
|
||||
//#endif
|
||||
|
||||
|
||||
#endif // __PLATFORM_H
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -78,7 +78,7 @@ class iSerializer;
|
|||
class iSerializable
|
||||
{
|
||||
public:
|
||||
virtual void Read(iSerializer* pSerializer, int32 version = 0) = 0; // throw (eSerializer, eArchive)
|
||||
virtual void Read(iSerializer* pSerializer, int32_t version = 0) = 0; // throw (eSerializer, eArchive)
|
||||
virtual void Write(iSerializer* pSerializer) const = 0; // throw (eSerializer, eArchive)
|
||||
// objects implement these methods to read and write themselves to a serializer.
|
||||
|
||||
|
@ -93,21 +93,21 @@ public:
|
|||
typedef iTypedSerializable* (*CreateFunc)();
|
||||
// Pointer to a function that creates an empty version of each typed serializable object
|
||||
|
||||
virtual int32 Version() const = 0;
|
||||
virtual int32_t Version() const = 0;
|
||||
// Return the current version of that this serializable object writes.
|
||||
// As a convention version number should be (major_version << 16) | minor_version.
|
||||
|
||||
static int32 MkVersion(int16 major, int16 minor)
|
||||
static int32_t MkVersion(int16_t major, int16_t minor)
|
||||
{
|
||||
return (int32)(((uint32)major << 16) | (uint32)minor);
|
||||
return (int32_t)(((uint32_t)major << 16) | (uint32_t)minor);
|
||||
}
|
||||
static int16 MajorVersion(int32 version)
|
||||
static int16_t MajorVersion(int32_t version)
|
||||
{
|
||||
return (int16)((uint32)version >> 16);
|
||||
return (int16_t)((uint32_t)version >> 16);
|
||||
}
|
||||
static int16 MinorVersion(int32 version)
|
||||
static int16_t MinorVersion(int32_t version)
|
||||
{
|
||||
return (int16)version;
|
||||
return (int16_t)version;
|
||||
}
|
||||
|
||||
virtual ~iTypedSerializable()
|
||||
|
@ -121,7 +121,7 @@ public:
|
|||
DECLARE_TYPED() \
|
||||
public: \
|
||||
static iTypedSerializable* Create(); \
|
||||
virtual int32 Version() const;
|
||||
virtual int32_t Version() const;
|
||||
|
||||
# define IMPLEMENT_TYPEDSERIALIZABLE(CLASS, TYPEDSTRING, VERSION_MAJOR, VERSION_MINOR) \
|
||||
IMPLEMENT_TYPED(CLASS, TYPEDSTRING) \
|
||||
|
@ -129,7 +129,7 @@ public:
|
|||
{ \
|
||||
return new CLASS; \
|
||||
} \
|
||||
int32 CLASS::Version() const \
|
||||
int32_t CLASS::Version() const \
|
||||
{ \
|
||||
return iTypedSerializable::MkVersion(VERSION_MAJOR, VERSION_MINOR); \
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -127,14 +127,14 @@ public:
|
|||
|
||||
// writing interface
|
||||
// all of these can throw eArchive
|
||||
virtual void ReadInt16(int16& ret) = 0;
|
||||
virtual void ReadInt32(int32& ret) = 0;
|
||||
virtual void ReadInt64(int64& ret) = 0;
|
||||
virtual void ReadInt16(int16_t& ret) = 0;
|
||||
virtual void ReadInt32(int32_t& ret) = 0;
|
||||
virtual void ReadInt64(int64_t& ret) = 0;
|
||||
virtual void ReadString(TSTRING& ret) = 0;
|
||||
virtual int ReadBlob(void* pBlob, int count) = 0;
|
||||
virtual void WriteInt16(int16 i) = 0;
|
||||
virtual void WriteInt32(int32 i) = 0;
|
||||
virtual void WriteInt64(int64 i) = 0;
|
||||
virtual void WriteInt16(int16_t i) = 0;
|
||||
virtual void WriteInt32(int32_t i) = 0;
|
||||
virtual void WriteInt64(int64_t i) = 0;
|
||||
virtual void WriteString(const TSTRING& s) = 0;
|
||||
virtual void WriteBlob(const void* pBlob, int count) = 0;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -44,7 +44,7 @@ cSerializerImpl::SerRefCountMap cSerializerImpl::mSerRefCountCreateMap;
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// util_GetCrc -- calculates the crc for the narrow version of the type's AsString()
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
static uint32 util_GetCRC(const cType& type)
|
||||
static uint32_t util_GetCRC(const cType& type)
|
||||
{
|
||||
//
|
||||
// convert this to narrow...
|
||||
|
@ -59,10 +59,10 @@ static uint32 util_GetCRC(const cType& type)
|
|||
|
||||
// We only need to count the characters
|
||||
// RAD: Yeesh! This is already done for us in cType::mString!!!
|
||||
const uint8* pszType = (const uint8*)(type.AsString());
|
||||
int nBytes = ::strlen((const char*)pszType);
|
||||
const uint8_t* pszType = (const uint8_t*)(type.AsString());
|
||||
int nBytes = ::strlen((const char*)pszType);
|
||||
|
||||
ASSERT(sizeof(uint8) == sizeof(byte));
|
||||
//ASSERT(sizeof(uint8_t) == sizeof(byte));
|
||||
ASSERT(pszType && *pszType);
|
||||
|
||||
//
|
||||
|
@ -104,7 +104,7 @@ bool cSerializerImpl::IsWriting() const
|
|||
|
||||
void cSerializerImpl::RegisterSerializable(const cType& type, iTypedSerializable::CreateFunc pFunc)
|
||||
{
|
||||
uint32 crc = util_GetCRC(type);
|
||||
uint32_t crc = util_GetCRC(type);
|
||||
|
||||
if (cSerializerImpl::mSerCreateMap.find(crc) != cSerializerImpl::mSerCreateMap.end())
|
||||
{
|
||||
|
@ -113,14 +113,15 @@ void cSerializerImpl::RegisterSerializable(const cType& type, iTypedSerializable
|
|||
ASSERT(false);
|
||||
TOSTRINGSTREAM str;
|
||||
str << _T("Duplicate entry in type table: ") << type.AsString() << std::endl;
|
||||
throw eInternal(str.str());
|
||||
tss_mkstr(errStr, str);
|
||||
throw eInternal(errStr);
|
||||
}
|
||||
cSerializerImpl::mSerCreateMap[crc] = pFunc;
|
||||
}
|
||||
|
||||
void cSerializerImpl::RegisterSerializableRefCt(const cType& type, iSerRefCountObj::CreateFunc pFunc)
|
||||
{
|
||||
uint32 crc = util_GetCRC(type);
|
||||
uint32_t crc = util_GetCRC(type);
|
||||
|
||||
if (cSerializerImpl::mSerRefCountCreateMap.find(crc) != cSerializerImpl::mSerRefCountCreateMap.end())
|
||||
{
|
||||
|
@ -129,7 +130,8 @@ void cSerializerImpl::RegisterSerializableRefCt(const cType& type, iSerRefCountO
|
|||
ASSERT(false);
|
||||
TOSTRINGSTREAM str;
|
||||
str << _T("Duplicate entry in type table: ") << type.AsString() << std::ends;
|
||||
throw eInternal(str.str());
|
||||
tss_mkstr(errStr, str);
|
||||
throw eInternal(errStr);
|
||||
}
|
||||
cSerializerImpl::mSerRefCountCreateMap[crc] = pFunc;
|
||||
}
|
||||
|
@ -171,17 +173,17 @@ void cSerializerImpl::WriteObjectDynCreate(const iTypedSerializable* pObj)
|
|||
//d.TraceDetail("Entering... Archive Offset = %d\n", mpArchive->CurrentPos());
|
||||
d.TraceDetail(_T(" Object Type = %s\n"), pObj->GetType().AsString());
|
||||
// first, we write out the header, which consists of the following:
|
||||
// uint32 crc of the object's type
|
||||
// int32 version of stored data
|
||||
// int32 size of the chunk (counting from this point; not including the previous int32
|
||||
// int32 index into mRefCountObjTbl, or 0 if it isn't refrence counted.
|
||||
// uint32_t crc of the object's type
|
||||
// int32_t version of stored data
|
||||
// int32_t size of the chunk (counting from this point; not including the previous int32
|
||||
// int32_t index into mRefCountObjTbl, or 0 if it isn't refrence counted.
|
||||
// if the index already exists, then no data follows; a refrence
|
||||
// should just be added to the existing object.
|
||||
ASSERT(mpArchive != 0);
|
||||
|
||||
// get the ident for this class type
|
||||
//
|
||||
uint32 crc = util_GetCRC(pObj->GetType());
|
||||
uint32_t crc = util_GetCRC(pObj->GetType());
|
||||
|
||||
//
|
||||
// make sure this type is registered, and figure out if it is refrence counted
|
||||
|
@ -243,20 +245,20 @@ iTypedSerializable* cSerializerImpl::ReadObjectDynCreate()
|
|||
cDebug d("cSerializerImpl::ReadObjectDynCreate");
|
||||
//d.TraceDetail("Entering... archive offset = %d\n", mpArchive->CurrentPos());
|
||||
|
||||
int32 size, objIdx;
|
||||
uint32 crc;
|
||||
int32_t size, objIdx;
|
||||
uint32_t crc;
|
||||
// first, get the type...
|
||||
mpArchive->ReadInt32(reinterpret_cast<int32&>(crc));
|
||||
mpArchive->ReadInt32(reinterpret_cast<int32_t&>(crc));
|
||||
|
||||
// read in the version
|
||||
int32 version;
|
||||
int32_t version;
|
||||
mpArchive->ReadInt32(version);
|
||||
|
||||
// read in the size and the index...
|
||||
mpArchive->ReadInt32(size);
|
||||
|
||||
// Save the position so we can seek correctly later on
|
||||
//int64 sizePos = mpArchive->CurrentPos();
|
||||
//int64_t sizePos = mpArchive->CurrentPos();
|
||||
|
||||
mpArchive->ReadInt32(objIdx);
|
||||
if (objIdx == 0)
|
||||
|
@ -269,12 +271,15 @@ iTypedSerializable* cSerializerImpl::ReadObjectDynCreate()
|
|||
{
|
||||
// unable to find the creation function...
|
||||
d.TraceError("Unable to find creation function for non-ref counted object %d\n", crc);
|
||||
TOSTRINGSTREAM str;
|
||||
TSTRING errStr;
|
||||
|
||||
#ifdef DEBUG
|
||||
TOSTRINGSTREAM str;
|
||||
// Let's only report the actual crc in debug mode
|
||||
str << (int32)crc << std::ends;
|
||||
str << (int32_t)crc << std::ends;
|
||||
tss_mkstr(errStr, str);
|
||||
#endif
|
||||
ThrowAndAssert(eSerializerUnknownType(str.str(), mFileName, eSerializer::TY_FILE));
|
||||
ThrowAndAssert(eSerializerUnknownType(errStr, mFileName, eSerializer::TY_FILE));
|
||||
}
|
||||
iTypedSerializable* pObj = ((*si).second)();
|
||||
d.TraceDetail("Created non-ref counted object %s(%p)\n", pObj->GetType().AsString(), pObj);
|
||||
|
@ -287,7 +292,7 @@ iTypedSerializable* cSerializerImpl::ReadObjectDynCreate()
|
|||
}
|
||||
else
|
||||
{
|
||||
// refrence counted...
|
||||
// reference counted...
|
||||
iSerRefCountObj* pObj;
|
||||
pObj = mRefCtObjTbl.Lookup(objIdx);
|
||||
if (pObj == NULL)
|
||||
|
@ -300,11 +305,12 @@ iTypedSerializable* cSerializerImpl::ReadObjectDynCreate()
|
|||
// unable to find the creation function...
|
||||
d.TraceError("Unable to find creation function for ref counted object %d\n", crc);
|
||||
TOSTRINGSTREAM str;
|
||||
str << (int32)crc << std::ends;
|
||||
ThrowAndAssert(eSerializerUnknownType(str.str(), mFileName, eSerializer::TY_FILE));
|
||||
str << (int32_t)crc;;
|
||||
tss_mkstr(errStr, str);
|
||||
ThrowAndAssert(eSerializerUnknownType(errStr, mFileName, eSerializer::TY_FILE));
|
||||
}
|
||||
pObj = ((*rci).second)();
|
||||
d.TraceDetail("Creating Ref-Coutnted object [%d] %s(%p)\n", objIdx, pObj->GetType().AsString(), pObj);
|
||||
d.TraceDetail("Creating Ref-Counted object [%d] %s(%p)\n", objIdx, pObj->GetType().AsString(), pObj);
|
||||
pObj->Read(this);
|
||||
mRefCtObjTbl.Add(pObj, objIdx);
|
||||
|
||||
|
@ -316,7 +322,7 @@ iTypedSerializable* cSerializerImpl::ReadObjectDynCreate()
|
|||
else
|
||||
{
|
||||
// already serialized; just return this object.
|
||||
d.TraceDetail("Adding refrence to previously serialized object [%d] %s(%p)\n",
|
||||
d.TraceDetail("Adding reference to previously serialized object [%d] %s(%p)\n",
|
||||
objIdx,
|
||||
pObj->GetType().AsString(),
|
||||
pObj);
|
||||
|
@ -342,9 +348,9 @@ void cSerializerImpl::WriteObject(const iTypedSerializable* pObj)
|
|||
//d.TraceDetail("Entering... Archive Offset = %d\n", mpArchive->CurrentPos());
|
||||
d.TraceDetail(" Object Type = %s\n", pObj->GetType().AsString());
|
||||
// first, we write out the header, which consists of the following:
|
||||
// int32 refrence into mTypeArray, indicating the object's type
|
||||
// int32 version of stored data
|
||||
// int32 size of the chunk (counting from this point; not including the previous int32
|
||||
// int32_t refrence into mTypeArray, indicating the object's type
|
||||
// int32_t version of stored data
|
||||
// int32_t size of the chunk (counting from this point; not including the previous int32
|
||||
// data the object data
|
||||
ASSERT(mpArchive != 0);
|
||||
|
||||
|
@ -375,16 +381,16 @@ void cSerializerImpl::WriteObject(const iTypedSerializable* pObj)
|
|||
mpArchive->WriteInt32(0); // place holder for type array index
|
||||
mpArchive->WriteInt32(pObj->Version());
|
||||
// write a placeholder for the size; we will come back and fill in the right value later...
|
||||
//int64 sizePos = mpArchive->CurrentPos();
|
||||
//int64_t sizePos = mpArchive->CurrentPos();
|
||||
mpArchive->WriteInt32(0xffffffff);
|
||||
|
||||
// write out the object!
|
||||
pObj->Write(this);
|
||||
|
||||
// finally, we need to go back and patch up the size...
|
||||
//int64 returnPos = mpArchive->CurrentPos();
|
||||
//int64_t returnPos = mpArchive->CurrentPos();
|
||||
//mpArchive->Seek(sizePos, cBidirArchive::BEGINNING);
|
||||
//mpArchive->WriteInt32((int32)(returnPos - sizePos - sizeof(int32)));
|
||||
//mpArchive->WriteInt32((int32_t)(returnPos - sizePos - sizeof(int32_t)));
|
||||
//mpArchive->Seek(returnPos, cBidirArchive::BEGINNING);
|
||||
}
|
||||
|
||||
|
@ -394,7 +400,7 @@ void cSerializerImpl::ReadObject(iTypedSerializable* pObj)
|
|||
//d.TraceDetail("Entering... archive offset = %d\n", mpArchive->CurrentPos());
|
||||
|
||||
// NOTE -- type index stuff is gone; see the comment in WriteObject()
|
||||
int32 /*typeIdx,*/ size;
|
||||
int32_t /*typeIdx,*/ size;
|
||||
// first, get the type...
|
||||
/*
|
||||
mpArchive->ReadInt32(typeIdx);
|
||||
|
@ -408,7 +414,7 @@ void cSerializerImpl::ReadObject(iTypedSerializable* pObj)
|
|||
*/
|
||||
|
||||
// read in the version
|
||||
int32 dummy, version;
|
||||
int32_t dummy, version;
|
||||
mpArchive->ReadInt32(dummy); // old type array index
|
||||
mpArchive->ReadInt32(version);
|
||||
|
||||
|
@ -424,7 +430,7 @@ void cSerializerImpl::ReadObject(iTypedSerializable* pObj)
|
|||
}
|
||||
|
||||
// remember current position
|
||||
//int64 sizePos = mpArchive->CurrentPos();
|
||||
//int64_t sizePos = mpArchive->CurrentPos();
|
||||
|
||||
// read in the object!
|
||||
pObj->Read(this, version);
|
||||
|
@ -437,17 +443,17 @@ void cSerializerImpl::ReadObject(iTypedSerializable* pObj)
|
|||
///////////////////////////////////////////////////////////////////////////////
|
||||
// archive wrapper
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
void cSerializerImpl::ReadInt16(int16& ret)
|
||||
void cSerializerImpl::ReadInt16(int16_t& ret)
|
||||
{
|
||||
mpArchive->ReadInt16(ret);
|
||||
}
|
||||
|
||||
void cSerializerImpl::ReadInt32(int32& ret)
|
||||
void cSerializerImpl::ReadInt32(int32_t& ret)
|
||||
{
|
||||
mpArchive->ReadInt32(ret);
|
||||
}
|
||||
|
||||
void cSerializerImpl::ReadInt64(int64& ret)
|
||||
void cSerializerImpl::ReadInt64(int64_t& ret)
|
||||
{
|
||||
mpArchive->ReadInt64(ret);
|
||||
}
|
||||
|
@ -462,17 +468,17 @@ int cSerializerImpl::ReadBlob(void* pBlob, int count)
|
|||
return mpArchive->ReadBlob(pBlob, count);
|
||||
}
|
||||
|
||||
void cSerializerImpl::WriteInt16(int16 i)
|
||||
void cSerializerImpl::WriteInt16(int16_t i)
|
||||
{
|
||||
mpArchive->WriteInt16(i);
|
||||
}
|
||||
|
||||
void cSerializerImpl::WriteInt32(int32 i)
|
||||
void cSerializerImpl::WriteInt32(int32_t i)
|
||||
{
|
||||
mpArchive->WriteInt32(i);
|
||||
}
|
||||
|
||||
void cSerializerImpl::WriteInt64(int64 i)
|
||||
void cSerializerImpl::WriteInt64(int64_t i)
|
||||
{
|
||||
mpArchive->WriteInt64(i);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -100,14 +100,14 @@ public:
|
|||
// I think the best thing might be to have iSerializable only know about the archive
|
||||
// Standard data read/write
|
||||
// (All functions can throw eArchave exceptions).
|
||||
virtual void ReadInt16(int16& ret);
|
||||
virtual void ReadInt32(int32& ret);
|
||||
virtual void ReadInt64(int64& ret);
|
||||
virtual void ReadInt16(int16_t& ret);
|
||||
virtual void ReadInt32(int32_t& ret);
|
||||
virtual void ReadInt64(int64_t& ret);
|
||||
virtual void ReadString(TSTRING& ret);
|
||||
virtual int ReadBlob(void* pBlob, int count);
|
||||
virtual void WriteInt16(int16 i);
|
||||
virtual void WriteInt32(int32 i);
|
||||
virtual void WriteInt64(int64 i);
|
||||
virtual void WriteInt16(int16_t i);
|
||||
virtual void WriteInt32(int32_t i);
|
||||
virtual void WriteInt64(int64_t i);
|
||||
virtual void WriteString(const TSTRING& s);
|
||||
virtual void WriteBlob(const void* pBlob, int count);
|
||||
|
||||
|
@ -122,8 +122,8 @@ private:
|
|||
TSTRING mFileName;
|
||||
|
||||
// creation function maps
|
||||
typedef std::map<uint32, iTypedSerializable::CreateFunc> SerMap;
|
||||
typedef std::map<uint32, iSerRefCountObj::CreateFunc> SerRefCountMap;
|
||||
typedef std::map<uint32_t, iTypedSerializable::CreateFunc> SerMap;
|
||||
typedef std::map<uint32_t, iSerRefCountObj::CreateFunc> SerRefCountMap;
|
||||
static SerMap mSerCreateMap;
|
||||
static SerRefCountMap mSerRefCountCreateMap;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
//
|
||||
// The developer of the original code and/or files is Tripwire, Inc.
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2018 Tripwire,
|
||||
// Portions created by Tripwire, Inc. are copyright (C) 2000-2019 Tripwire,
|
||||
// Inc. Tripwire is a registered trademark of Tripwire, Inc. All rights
|
||||
// reserved.
|
||||
//
|
||||
|
@ -37,18 +37,18 @@
|
|||
|
||||
namespace
|
||||
{
|
||||
template<class FROM, class TO> int64 CopyImpl(TO* pTo, FROM* pFrom, int64 amt)
|
||||
template<class FROM, class TO> int64_t CopyImpl(TO* pTo, FROM* pFrom, int64_t amt)
|
||||
{
|
||||
enum
|
||||
{
|
||||
BUF_SIZE = 8192
|
||||
};
|
||||
int8 buf[BUF_SIZE];
|
||||
int64 amtLeft = amt;
|
||||
int8_t buf[BUF_SIZE];
|
||||
int64_t amtLeft = amt;
|
||||
|
||||
while (amtLeft > 0)
|
||||
{
|
||||
// NOTE: We use int's here rather than int64 because iSerializer and cArchive
|
||||
// NOTE: We use int's here rather than int64_t because iSerializer and cArchive
|
||||
// only take int's as their size parameter - dmb
|
||||
int amtToRead = amtLeft > BUF_SIZE ? BUF_SIZE : (int)amtLeft;
|
||||
int amtRead = pFrom->ReadBlob(buf, amtToRead);
|
||||
|
@ -64,12 +64,12 @@ template<class FROM, class TO> int64 CopyImpl(TO* pTo, FROM* pFrom, int64 amt)
|
|||
} // namespace
|
||||
|
||||
|
||||
int64 cSerializerUtil::Copy(iSerializer* pDest, cArchive* pSrc, int64 amt)
|
||||
int64_t cSerializerUtil::Copy(iSerializer* pDest, cArchive* pSrc, int64_t amt)
|
||||
{
|
||||
return CopyImpl(pDest, pSrc, amt);
|
||||
}
|
||||
|
||||
int64 cSerializerUtil::Copy(cArchive* pDest, iSerializer* pSrc, int64 amt)
|
||||
int64_t cSerializerUtil::Copy(cArchive* pDest, iSerializer* pSrc, int64_t amt)
|
||||
{
|
||||
return CopyImpl(pDest, pSrc, amt);
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue