mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 01:37:00 +00:00
Rebase resync
This commit is contained in:
parent
a0797532e8
commit
1997c1e903
3106 changed files with 11118 additions and 627576 deletions
3
.gitattributes
vendored
3
.gitattributes
vendored
|
|
@ -3,6 +3,9 @@
|
|||
*.vcproj eol=crlf
|
||||
*.vcxproj* eol=crlf
|
||||
|
||||
src/shared/revision_nr.h eol=lf
|
||||
src/shared/revision_sql.h eol=lf
|
||||
|
||||
# Whitespace rules
|
||||
# strict (no trailing, no tabs)
|
||||
*.cpp whitespace=trailing-space,space-before-tab,tab-in-indent,cr-at-eol
|
||||
|
|
|
|||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -27,6 +27,7 @@ tags
|
|||
TAGS
|
||||
!.gitignore
|
||||
!.gitattributes
|
||||
!.travis.yml
|
||||
|
||||
#
|
||||
# Build generated files
|
||||
|
|
|
|||
|
|
@ -94,6 +94,9 @@ endif()
|
|||
# find Git: used to get the revision number
|
||||
find_package(Git)
|
||||
|
||||
# find Git: used to get the revision number
|
||||
find_package(Git)
|
||||
|
||||
# check if the platform supports precomiled headers
|
||||
find_package(PCHSupport)
|
||||
|
||||
|
|
|
|||
333
contrib/backporting/mangos-backport.sh
Normal file
333
contrib/backporting/mangos-backport.sh
Normal file
|
|
@ -0,0 +1,333 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# mangos-backport - a bash helper for backporting in git for MaNGOS project
|
||||
# Copyright (C) 2009 freghar <compmancz@gmail.com>
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under 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.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU 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., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
# 02110-1301, USA
|
||||
#
|
||||
|
||||
# The script works pretty simple - each time an empty commit is made,
|
||||
# copying author and message from the original one.
|
||||
# Then the original commit is cherry-picked -n (no commit)
|
||||
# and the changes are git commit --amended to the prepared empty commit.
|
||||
|
||||
### general definitions
|
||||
|
||||
## internals
|
||||
BATCH_PROCESS=0
|
||||
VERBOSE=0
|
||||
|
||||
## user-tunable
|
||||
AUTORESOLVE="src/shared/revision_nr.h"
|
||||
GIT_AMEND_OPTS="-s"
|
||||
GIT_RECOVER="git reset --hard HEAD^"
|
||||
CONFLICT_RETVAL=2 # for batch usage
|
||||
GIT_PATH="./"
|
||||
|
||||
|
||||
### print error to stderr
|
||||
function print_error {
|
||||
echo -e "${@}" 1>&2
|
||||
}
|
||||
|
||||
### prints help
|
||||
function print_help {
|
||||
echo -e "Usage: ${0##*/} [-vb] <revspec>" \
|
||||
"\nBackports a specified commit to current branch." \
|
||||
"\n\n -b Batch processing (no interaction)." \
|
||||
"\n (runs amend without calling \$EDITOR)" \
|
||||
"\n -v Be verbose." \
|
||||
"\n -n Never automatically commit." \
|
||||
"\n"
|
||||
}
|
||||
|
||||
### verbose print
|
||||
function verbose_print {
|
||||
[[ ${VERBOSE} > 0 ]] && echo "${@}"
|
||||
}
|
||||
|
||||
### runs a command and handles it's output verbosity
|
||||
#function verbose_run {
|
||||
# if [[ ${VERBOSE} > 0 ]]; then
|
||||
# "${@}"
|
||||
# return $?
|
||||
# else
|
||||
# "${@}" 1 > /dev/null
|
||||
# return $?
|
||||
# fi
|
||||
#}
|
||||
|
||||
### catches output of a command and returns it's retval
|
||||
#function catch_out {
|
||||
# pick_out=$(${@} 2>&1)
|
||||
# return $?
|
||||
#}
|
||||
|
||||
### recover from an error, deleting empty commit
|
||||
function git_recover {
|
||||
print_error "----------"
|
||||
print_error "Caught an error, checking for last commit ..."
|
||||
|
||||
# check if the last commit is empty,
|
||||
# ie. it has the same tree object dependency as it's parent
|
||||
local head_tree=$(git log -1 --pretty="%T" HEAD)
|
||||
local prev_tree=$(git log -1 --pretty="%T" HEAD^)
|
||||
if [[ $head_tree == $prev_tree ]]; then
|
||||
print_error "Last commit empty, running ${GIT_RECOVER}" \
|
||||
"\nto previous HEAD (should be ${CURRENT_HEAD})."
|
||||
print_error "----------"
|
||||
${GIT_RECOVER}
|
||||
else
|
||||
print_error "Last commit isn't empty (or git log failed) -" \
|
||||
"something strange happened,\ncheck git log" \
|
||||
"and do the cleanup (if needed) by hand."
|
||||
fi
|
||||
exit 1
|
||||
}
|
||||
|
||||
### amend the empty commit, assigning new tree
|
||||
function git_autoamend {
|
||||
|
||||
# if the index is empty, there's nothing to amend
|
||||
if [[ -z $(git diff-index --cached HEAD) ]]; then
|
||||
git_retval=$?
|
||||
[[ $git_retval != 0 ]] && git_recover
|
||||
|
||||
print_error "The index is empty, nothing to amend. This should" \
|
||||
"not happen during normal\nworkflow, so you" \
|
||||
"probably did something crazy like picking\na" \
|
||||
"commit to a branch where it already exists."
|
||||
git_recover
|
||||
fi
|
||||
|
||||
verbose_print "----------"
|
||||
if [[ ${BATCH_PROCESS} > 0 ]]; then
|
||||
if [[ ${VERBOSE} > 0 ]]; then
|
||||
git commit ${GIT_AMEND_OPTS} --amend -C HEAD
|
||||
git_retval=$?
|
||||
else
|
||||
git commit ${GIT_AMEND_OPTS} --amend -C HEAD 1> /dev/null
|
||||
git_retval=$?
|
||||
[[ $git_retval == 0 ]] && echo \
|
||||
"Commit ${COMMIT_HASH} picked."
|
||||
fi
|
||||
else
|
||||
git commit ${GIT_AMEND_OPTS} --amend -c HEAD
|
||||
git_retval=$?
|
||||
fi
|
||||
[[ $git_retval != 0 ]] && git_recover
|
||||
}
|
||||
|
||||
|
||||
### main()
|
||||
|
||||
## arguments
|
||||
|
||||
# arg parsing
|
||||
while getopts "vbn" OPTION; do
|
||||
case $OPTION in
|
||||
v)
|
||||
VERBOSE=1
|
||||
;;
|
||||
b)
|
||||
BATCH_PROCESS=1
|
||||
;;
|
||||
n)
|
||||
NO_AUTOCOMMIT=1
|
||||
;;
|
||||
\?)
|
||||
print_help
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done;
|
||||
shift $(( $OPTIND - 1 ))
|
||||
ORIG_REF=${1}
|
||||
|
||||
# check for needed arguments
|
||||
if [[ -z ${ORIG_REF} ]]; then
|
||||
print_help
|
||||
exit 1
|
||||
fi
|
||||
|
||||
## startup checks
|
||||
|
||||
# check for needed commands
|
||||
for cmd in git grep sed wc; do
|
||||
if [[ -z $(which ${cmd}) ]]; then
|
||||
print_error "error: ${cmd}: command not found"
|
||||
exit 1
|
||||
fi
|
||||
done;
|
||||
|
||||
# are we in git root dir?
|
||||
if [[ ! -d .git/ ]]; then
|
||||
print_error "error: not in repository root directory"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# is the index clean?
|
||||
if [[ ! -z $(git diff-index HEAD) ]]; then
|
||||
print_error "error: dirty index, run mixed/hard reset first"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
## original commit infos
|
||||
|
||||
# current HEAD commit hash
|
||||
CURRENT_HEAD=$(git show -s --pretty=format:'%h' HEAD)
|
||||
[[ $? != 0 ]] && exit 1
|
||||
|
||||
# author with email
|
||||
COMMIT_AUTHOR=$(git show -s --pretty=format:'%an <%ae>' ${ORIG_REF})
|
||||
[[ $? != 0 ]] && exit 1
|
||||
|
||||
# commit object hash (abbrev)
|
||||
COMMIT_HASH=$(git show -s --pretty=format:'%h' ${ORIG_REF})
|
||||
[[ $? != 0 ]] && exit 1
|
||||
|
||||
# subject (with removed revision number)
|
||||
COMMIT_SUBJECT=$(git show -s --pretty=format:'%s' ${ORIG_REF} | sed -r 's/\[[a-z]?[0-9]*\] //')
|
||||
[[ $? != 0 ]] && exit 1
|
||||
COMMIT_REVISION=$(git show -s --pretty=format:'%s' ${ORIG_REF} | sed -nr 's/^\[([a-z]?[0-9]*).*/\1/p')
|
||||
[[ $? != 0 ]] && exit 1
|
||||
if [ "$COMMIT_REVISION" != "" ]; then COMMIT_REVISION="[$COMMIT_REVISION] - "; fi
|
||||
|
||||
# body
|
||||
COMMIT_BODY=$(git show -s --pretty=format:'%b' ${ORIG_REF})
|
||||
[[ $? != 0 ]] && exit 1
|
||||
|
||||
# whole message (yea, it could be done without echo)
|
||||
COMMIT_MESSAGE=$(echo -e "${COMMIT_SUBJECT}\n\n${COMMIT_BODY}\n\n(based on commit $COMMIT_REVISION${COMMIT_HASH})")
|
||||
[[ $? != 0 ]] && exit 1
|
||||
|
||||
## new empty commit ready, so create it
|
||||
verbose_print "Creating new empty commit on current HEAD (${CURRENT_HEAD}}."
|
||||
verbose_print "----------"
|
||||
if [[ ${VERBOSE} > 0 ]]; then
|
||||
git commit --author="${COMMIT_AUTHOR}" -m "${COMMIT_MESSAGE}" \
|
||||
--allow-empty
|
||||
[[ $? != 0 ]] && exit 1
|
||||
else
|
||||
git commit --author="${COMMIT_AUTHOR}" -m "${COMMIT_MESSAGE}" \
|
||||
--allow-empty 1> /dev/null
|
||||
[[ $? != 0 ]] && exit 1
|
||||
fi
|
||||
|
||||
|
||||
## first, try cherry-picking the commit and catch conflicts.
|
||||
## - if there are none, simply amend and exit
|
||||
## - if there are none related to $AUTORESOLVE, only prepare
|
||||
## the backported commit
|
||||
## - when multiple conflicts occur, including $AUTORESOLVE,
|
||||
## do the resolution for the one file, prepare the commit
|
||||
## and let user resolve the rest (+ amend)
|
||||
## - when only single ($AUTORESOLVE) conflict occur, resolve it
|
||||
## and fire up $EDITOR to autocommit
|
||||
|
||||
pick_out=$(git cherry-pick -n ${ORIG_REF} 2>&1)
|
||||
pick_retval=$?
|
||||
|
||||
# exit if there was a fatal app error
|
||||
if [[ $pick_retval > 1 ]]; then
|
||||
print_error "${pick_out}"
|
||||
git_recover
|
||||
fi
|
||||
|
||||
# get a list of unmerged files
|
||||
unmerged_files=$(git diff-files --diff-filter=U | sed 's/^[^\t]*\t//')
|
||||
git_retval=$?
|
||||
if [[ $git_retval != 0 ]]; then
|
||||
print_error "${pick_out}"
|
||||
git_recover
|
||||
fi
|
||||
|
||||
# simply amend if the pick was successful
|
||||
if [[ $pick_retval == 0 && -z $unmerged_files ]]; then
|
||||
verbose_print "${pick_out}"
|
||||
verbose_print "----------"
|
||||
if [[ ${NO_AUTOCOMMIT} > 0 ]]; then
|
||||
verbose_print "No conflicts to resolve, nothing to do."
|
||||
verbose_print "Please run git commit ${GIT_AMEND_OPTS} --amend" \
|
||||
"after making all necessary changes."
|
||||
verbose_print "Use ${GIT_RECOVER} to recover."
|
||||
else
|
||||
verbose_print "No conflicts to resolve, running amend."
|
||||
git_autoamend
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# sanity check
|
||||
if [[ -z $unmerged_files ]]; then
|
||||
print_error "${pick_out}"
|
||||
print_error "----------"
|
||||
print_error "git cherry-pick failed with status 1," \
|
||||
"\nbut no unmerged files were found."
|
||||
git_recover
|
||||
fi
|
||||
|
||||
# if $AUTORESOLVE isn't there (but other conflicts are), simply exit
|
||||
if [[ -z $(echo "${unmerged_files}" | grep ${AUTORESOLVE}) ]]; then
|
||||
print_error "${pick_out}"
|
||||
echo "----------"
|
||||
verbose_print "${AUTORESOLVE} not found as unmerged."
|
||||
echo "Please run git commit ${GIT_AMEND_OPTS} --amend" \
|
||||
"after resolving all conflicts."
|
||||
echo "To recover from the resolution, use ${GIT_RECOVER}."
|
||||
exit ${CONFLICT_RETVAL}
|
||||
fi
|
||||
|
||||
# do the resolution - use old version of the file
|
||||
if [[ -f ${AUTORESOLVE} ]]; then
|
||||
verbose_print "${pick_out}"
|
||||
verbose_print "----------"
|
||||
verbose_print "Auto-resolving ${AUTORESOLVE} using old version."
|
||||
git show :2:${AUTORESOLVE} > ${AUTORESOLVE}
|
||||
[[ $? != 0 ]] && git_recover
|
||||
git add ${AUTORESOLVE}
|
||||
[[ $? != 0 ]] && git_recover
|
||||
# echo "Resolution of ${AUTORESOLVE} finished successfuly."
|
||||
else
|
||||
print_error "${pick_out}"
|
||||
print_error "----------"
|
||||
print_error "error: ${AUTORESOLVE} not found, cannot resolve"
|
||||
git_recover
|
||||
fi
|
||||
|
||||
# if $AUTORESOLVE was the only conflict, amend the commit
|
||||
if [[ $(echo "${unmerged_files}" | wc -l) == 1 ]]; then
|
||||
verbose_print "----------"
|
||||
if [[ ${NO_AUTOCOMMIT} > 0 ]]; then
|
||||
verbose_print "All done, autocommit disabled, nothing to do."
|
||||
verbose_print "Please run git commit ${GIT_AMEND_OPTS} --amend" \
|
||||
"after making all necessary changes."
|
||||
verbose_print "Use ${GIT_RECOVER} to recover."
|
||||
else
|
||||
verbose_print "All done, running git commit ${GIT_AMEND_OPTS} --amend ..."
|
||||
git_autoamend
|
||||
fi
|
||||
exit 0
|
||||
|
||||
# else let the user do all other conflict resolutions
|
||||
else
|
||||
print_error "${pick_out}"
|
||||
echo "----------"
|
||||
echo "Please run git commit ${GIT_AMEND_OPTS} --amend" \
|
||||
"after resolving all conflicts."
|
||||
echo "To recover from the resolution, use ${GIT_RECOVER}."
|
||||
exit ${CONFLICT_RETVAL}
|
||||
fi
|
||||
1
contrib/cleanupTools/.gitignore
vendored
Normal file
1
contrib/cleanupTools/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
cleanupTools.config
|
||||
133
contrib/cleanupTools/cleanupHistory.sh
Normal file
133
contrib/cleanupTools/cleanupHistory.sh
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Tool to rebase a branch with cleaned commits
|
||||
#
|
||||
# Required:
|
||||
# - some tool for the cleanup
|
||||
# - base commit from which on the current branch shall be cleaned
|
||||
|
||||
# Do config stuff
|
||||
sh "${0%/*}/cleanupToolConfig.sh"
|
||||
if [ "$?" != "0" ]
|
||||
then
|
||||
echo "You need to edit the configuration file before you can use this tool!"
|
||||
echo "Configuration file: ${0%/*}/cleanupTools.config"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# And use config settings
|
||||
. "${0%/*}/cleanupTools.config"
|
||||
|
||||
if [ "$BASE_COMMIT" = "" ]
|
||||
then
|
||||
echo "You did not specify a base-commit onto which to rebuild history"
|
||||
echo "or another unexpected error happened.."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# First: commit all changes onto current branch
|
||||
git commit -a -m"Cleanup History Commit: Pending Changes of WorkDir"
|
||||
|
||||
# Create list of commits that needs to be processed
|
||||
COMMIT_LIST=`git log --reverse --format=format:"%H" $BASE_COMMIT..HEAD`
|
||||
|
||||
# prepare history_cleanup branch
|
||||
git checkout -b history_cleanup $BASE_COMMIT
|
||||
# cleanup history
|
||||
echo "Cleanup History Tool: Cleanup initial state before rewriting history(might result in an empty commit)"
|
||||
$CLEANUP_TOOL > /dev/null
|
||||
git commit -a -m"Cleanup History Commit: Cleanup state before starting cleaning history"
|
||||
|
||||
for commit in $COMMIT_LIST
|
||||
do
|
||||
git checkout -b history_cleanup_tmp $commit
|
||||
[[ $? != 0 ]] && exit 1
|
||||
echo "Cleanup History Tool: Cleanup after commit $commit)"
|
||||
$CLEANUP_TOOL > /dev/null
|
||||
git commit -a -m"Cleanup History Commit: Temp cleaned" --allow-empty
|
||||
[[ $? != 0 ]] && exit 1
|
||||
git checkout history_cleanup
|
||||
[[ $? != 0 ]] && exit 1
|
||||
|
||||
## Catch differences
|
||||
git diff --binary history_cleanup..history_cleanup_tmp > history_cleanup_tmp.patch
|
||||
|
||||
# Get committer information to store it
|
||||
COMMITTER_N=$(git show -s --pretty=format:'%cn' ${commit})
|
||||
[[ $? != 0 ]] && exit 1
|
||||
COMMITTER_M=$(git show -s --pretty=format:'%ce' ${commit})
|
||||
[[ $? != 0 ]] && exit 1
|
||||
COMMITTER_D=$(git show -s --pretty=format:'%cd' ${commit})
|
||||
[[ $? != 0 ]] && exit 1
|
||||
GIT_COMMITTER_NAME=$COMMITTER_N; GIT_COMMITTER_EMAIL=$COMMITTER_M; GIT_COMMITTER_DATE=$COMMITTER_D;
|
||||
export GIT_COMMITTER_NAME; export GIT_COMMITTER_EMAIL; export GIT_COMMITTER_DATE;
|
||||
|
||||
# Two cases: either diff is identical to original commit, or not
|
||||
git diff --binary $commit^..$commit > history_cleanup_compare.patch
|
||||
DIFF_COUNT=`diff history_cleanup_tmp.patch history_cleanup_compare.patch | grep ">" | grep -v "> index " | wc -l`
|
||||
echo "Current State: Diffcount=$DIFF_COUNT"
|
||||
if [ "$DIFF_COUNT" = " 0" ]
|
||||
then # identical# TODO this is too strict!
|
||||
git cherry-pick $commit
|
||||
else # different, use new commit
|
||||
# commit object hash
|
||||
COMMIT_HASH=$(git show -s --pretty=format:'%h' ${commit})
|
||||
[[ $? != 0 ]] && exit 1
|
||||
# subject
|
||||
COMMIT_SUBJECT=$(git show -s --pretty=format:'%s' ${commit})
|
||||
[[ $? != 0 ]] && exit 1
|
||||
# body
|
||||
COMMIT_BODY=$(git show -s --pretty=format:'%b' ${commit})
|
||||
[[ $? != 0 ]] && exit 1
|
||||
# whole message
|
||||
COMMIT_MESSAGE=$(echo -e "${COMMIT_SUBJECT}\n\n${COMMIT_BODY}\n\n(cleaned version of ${COMMIT_HASH})")
|
||||
[[ $? != 0 ]] && exit 1
|
||||
|
||||
# Apply Cleaned changeset
|
||||
git apply history_cleanup_tmp.patch
|
||||
if [ $? != 0 ]
|
||||
then
|
||||
echo "Could not apply patch with git methods, try with patch tool directly? (y/n)"
|
||||
read line
|
||||
if [ "$line" = "y" ]
|
||||
then
|
||||
patch -p1 -d. < history_cleanup_tmp.patch
|
||||
echo "Please check manually if this worked.."
|
||||
echo "Did it work? (y/n)"
|
||||
read line
|
||||
if [ "$line" != "y" ]
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [ $? != 0 ]
|
||||
then
|
||||
echo "Could not apply patch, store in history_cleanup_tmp.patch"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Git add new files
|
||||
NEW_FILES_LIST=`grep -B1 "new file mode" history_cleanup_tmp.patch | grep "diff --git a/" | sed 's!diff --git a/\(.*\) .*!\1!'`
|
||||
for fline in $NEW_FILES_LIST
|
||||
do
|
||||
git add $fline
|
||||
[[ $? != 0 ]] && exit 1
|
||||
done
|
||||
|
||||
# Commit just created commit with original information
|
||||
git commit -a --allow-empty -C"$commit"
|
||||
[[ $? != 0 ]] && exit 1
|
||||
git commit --amend --allow-empty -m"${COMMIT_MESSAGE}"
|
||||
[[ $? != 0 ]] && exit 1
|
||||
fi
|
||||
|
||||
git branch -D history_cleanup_tmp
|
||||
[[ $? != 0 ]] && exit 1
|
||||
done
|
||||
|
||||
rm history_cleanup_tmp.patch
|
||||
rm history_cleanup_compare.patch
|
||||
|
||||
GIT_COMMITTER_NAME=""; GIT_COMMITTER_EMAIL=""; GIT_COMMITTER_DATE="";
|
||||
export GIT_COMMITTER_NAME; export GIT_COMMITTER_EMAIL; export GIT_COMMITTER_DATE;
|
||||
68
contrib/cleanupTools/cleanupToolConfig.sh
Normal file
68
contrib/cleanupTools/cleanupToolConfig.sh
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Helper script to create a config file for the cleanup tools
|
||||
# The created config file must be edited manually
|
||||
|
||||
|
||||
if [ -f "${0%/*}/cleanupTools.config" ]
|
||||
then
|
||||
# file already exists, exit
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Create file
|
||||
cat << EOF > "${0%/*}/cleanupTools.config"
|
||||
#!/bin/sh
|
||||
|
||||
# Basic configuration for the cleanup helper scripts with mangos
|
||||
# Be sure to read this whole file and edit the variables as required
|
||||
#
|
||||
############################################################
|
||||
# Generic options:
|
||||
############################################################
|
||||
# Define the path to <MaNGOS> folder relatively from where you want to call the scripts.
|
||||
# The cleanupHistory.sh script must be called from within the repository that is to be cleaned!
|
||||
#
|
||||
BASEPATH="."
|
||||
#
|
||||
# Path to Astyle from the <MaNGOS> directory
|
||||
ASTYLE="../AStyle/bin/AStyle.exe"
|
||||
|
||||
|
||||
############################################################
|
||||
# The cleanupStyle.sh tool:
|
||||
############################################################
|
||||
# Job selection options are:
|
||||
# DO with possible choices: ASTYLE (to call the Astyle tool)
|
||||
# COMMENT_STYLE (to change comments from //foo to // foo and align them to column 61 if possible
|
||||
# OVERRIDE_CORRECTNESS[2] use at own RISK, this is maybe not too usefull
|
||||
DO="ASTYLE"
|
||||
#
|
||||
# DO_ON with possible choices: MANGOS_SRC to invoke the above cleanup routine on <MaNGOS>/src directory and subdirectories
|
||||
# MANGOS_CONTRIB to invoke the above cleanup routine on <MaNGOS>/contrib directory and subdirectories
|
||||
# MANGOS_WHOLE to invoke the above cleanup routine on <MaNGOS> directory and subdirectories
|
||||
# SD2 to invoke the above cleanup routine on <MaNGOS>/src/bindings/ScriptDev2 directory and subdirectories
|
||||
DO_ON="MANGOS_SRC"
|
||||
|
||||
|
||||
############################################################
|
||||
# The cleanupHistory.sh tool:
|
||||
############################################################
|
||||
# This tool will USE the cleanupStyle.sh tool to cleanup the history of the current branch with the settings above
|
||||
# It will clean the history based on the variable BASE_COMMIT that needs to be defined here
|
||||
BASE_COMMIT=""
|
||||
|
||||
|
||||
|
||||
###
|
||||
# Internal variables, do not change except you know what you are doing
|
||||
###
|
||||
# cleanup-tool
|
||||
CLEANUP_TOOL="\$BASEPATH/contrib/cleanupTools/cleanupStyle.sh"
|
||||
# path from current's caller position to ASTYLE
|
||||
ASTYLE="\$BASEPATH/\$ASTYLE"
|
||||
|
||||
EOF
|
||||
|
||||
# Return wil error, to display message if file is not found
|
||||
exit 1
|
||||
|
|
@ -29,16 +29,21 @@ __fastcall TFrmMain::TFrmMain(TComponent* Owner)
|
|||
|
||||
void __fastcall TFrmMain::btOpenClick(TObject* Sender)
|
||||
{
|
||||
if(OpenDialog1->Execute()){
|
||||
if (FileExists(OpenDialog1->FileName)){
|
||||
if (OpenDialog1->Execute())
|
||||
{
|
||||
if (FileExists(OpenDialog1->FileName))
|
||||
{
|
||||
OpenOk = false;
|
||||
if(thOpen){
|
||||
if (thOpen)
|
||||
{
|
||||
thOpen->Terminate();
|
||||
}
|
||||
thOpen = new thOpenFile(false);
|
||||
//thOpen->Priority = tpTimeCritical;
|
||||
pnFileName->Caption = OpenDialog1->FileName;
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
OpenOk = false;
|
||||
pnFileName->Caption = "";
|
||||
}
|
||||
|
|
@ -48,9 +53,12 @@ void __fastcall TFrmMain::btOpenClick(TObject *Sender)
|
|||
void __fastcall TFrmMain::btSaveClick(TObject* Sender)
|
||||
{
|
||||
//CurrentOpenFile;
|
||||
if(OpenOk){
|
||||
if (OpenOk)
|
||||
{
|
||||
SaveToFile(CurrentOpenFile.c_str());
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowMessage("文件未打开完成!");
|
||||
}
|
||||
}
|
||||
|
|
@ -100,10 +108,13 @@ void TFrmMain::SaveToFile(const char * pszFileName)
|
|||
{
|
||||
for (int j = 1; j < sgEdit->ColCount; j++)
|
||||
{
|
||||
if(j==1){ //ID
|
||||
if (j == 1) //ID
|
||||
{
|
||||
iVal = StrToInt(sgEdit->Cells[j][i]);
|
||||
FileWrite(iFileHandle, &iVal, 4);
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
//ColType= ini->ReadInteger(SectionName,"ColType"+IntToStr(j-1),0);
|
||||
//thOpen->ColType[10000];
|
||||
|
|
@ -138,7 +149,8 @@ void TFrmMain::SaveToFile(const char * pszFileName)
|
|||
}
|
||||
void __fastcall TFrmMain::btIntTypeClick(TObject* Sender)
|
||||
{
|
||||
if(OpenOk==true){
|
||||
if (OpenOk == true)
|
||||
{
|
||||
AnsiString iniSetFile = ExtractFilePath(Application->ExeName) + "BcdEditer.ini";
|
||||
AnsiString SectionName = ExtractFileName(CurrentOpenFile);
|
||||
TIniFile* ini;
|
||||
|
|
@ -156,7 +168,8 @@ if(OpenOk==true){
|
|||
|
||||
void __fastcall TFrmMain::btFloatTypeClick(TObject* Sender)
|
||||
{
|
||||
if(OpenOk==true){
|
||||
if (OpenOk == true)
|
||||
{
|
||||
AnsiString iniSetFile = ExtractFilePath(Application->ExeName) + "BcdEditer.ini";
|
||||
AnsiString SectionName = ExtractFileName(CurrentOpenFile);
|
||||
TIniFile* ini;
|
||||
|
|
@ -171,7 +184,8 @@ if(OpenOk==true){
|
|||
|
||||
void __fastcall TFrmMain::PopupMenu1Popup(TObject* Sender)
|
||||
{
|
||||
if(OpenOk==true){
|
||||
if (OpenOk == true)
|
||||
{
|
||||
AnsiString iniSetFile = ExtractFilePath(Application->ExeName) + "BcdEditer.ini";
|
||||
AnsiString SectionName = ExtractFileName(CurrentOpenFile);
|
||||
int ColType;
|
||||
|
|
@ -210,7 +224,8 @@ void __fastcall TFrmMain::N1Click(TObject *Sender)
|
|||
AnsiString SectionName = ExtractFileName(CurrentOpenFile);
|
||||
int ColType;
|
||||
FrmTitle->edTitle->Text = sgEdit->Cells[sgEdit->Col][0];
|
||||
if(FrmTitle->ShowModal()==mrOk){
|
||||
if (FrmTitle->ShowModal() == mrOk)
|
||||
{
|
||||
TIniFile* ini;
|
||||
ini = new TIniFile(iniSetFile);
|
||||
ini->WriteString(SectionName, "ColTitle" + IntToStr(sgEdit->Col), FrmTitle->edTitle->Text);
|
||||
|
|
@ -224,7 +239,8 @@ void __fastcall TFrmMain::N1Click(TObject *Sender)
|
|||
|
||||
void __fastcall TFrmMain::FormDestroy(TObject* Sender)
|
||||
{
|
||||
if(thOpen){
|
||||
if (thOpen)
|
||||
{
|
||||
thOpen->Terminate();
|
||||
SleepEx(200, 0);
|
||||
}
|
||||
|
|
@ -234,14 +250,18 @@ void __fastcall TFrmMain::FormDestroy(TObject *Sender)
|
|||
void __fastcall TFrmMain::ToolButton1Click(TObject* Sender)
|
||||
{
|
||||
bool SeFlag = true;
|
||||
if(FrmSearch->ShowModal()==mrOk){
|
||||
if (FrmSearch->ShowModal() == mrOk)
|
||||
{
|
||||
switch (FrmSearch->rgSI->ItemIndex)
|
||||
{
|
||||
case 0: //向上找;
|
||||
for(int i=sgEdit->ColCount*sgEdit->Row+sgEdit->Col-1;i>sgEdit->ColCount;i--){
|
||||
if(i%sgEdit->ColCount!=0){
|
||||
for (int i = sgEdit->ColCount * sgEdit->Row + sgEdit->Col - 1; i > sgEdit->ColCount; i--)
|
||||
{
|
||||
if (i % sgEdit->ColCount != 0)
|
||||
{
|
||||
if (0 == CompareStr(sgEdit->Cells[i - sgEdit->ColCount * (i / sgEdit->ColCount)][i / sgEdit->ColCount],
|
||||
FrmSearch->edSeach->Text)){ //找到了
|
||||
FrmSearch->edSeach->Text)) //找到了
|
||||
{
|
||||
sgEdit->Col = i - sgEdit->ColCount * i / sgEdit->ColCount;
|
||||
sgEdit->Row = i / sgEdit->ColCount;
|
||||
SeFlag = false;
|
||||
|
|
@ -252,10 +272,13 @@ void __fastcall TFrmMain::ToolButton1Click(TObject *Sender)
|
|||
if (SeFlag) ShowMessage("Seach Top,Find Nothing.");
|
||||
break;
|
||||
case 1: //向下找;
|
||||
for(int i=sgEdit->ColCount*sgEdit->Row+sgEdit->Col+1;i<sgEdit->ColCount*sgEdit->RowCount;i++){
|
||||
if(i%sgEdit->ColCount!=0){
|
||||
for (int i = sgEdit->ColCount * sgEdit->Row + sgEdit->Col + 1; i < sgEdit->ColCount * sgEdit->RowCount; i++)
|
||||
{
|
||||
if (i % sgEdit->ColCount != 0)
|
||||
{
|
||||
if (0 == CompareStr(sgEdit->Cells[i - sgEdit->ColCount * (i / sgEdit->ColCount)][i / sgEdit->ColCount],
|
||||
FrmSearch->edSeach->Text)){ //找到了
|
||||
FrmSearch->edSeach->Text)) //找到了
|
||||
{
|
||||
sgEdit->Col = i - sgEdit->ColCount * (i / sgEdit->ColCount);
|
||||
sgEdit->Row = i / sgEdit->ColCount;
|
||||
SeFlag = false;
|
||||
|
|
@ -266,9 +289,11 @@ void __fastcall TFrmMain::ToolButton1Click(TObject *Sender)
|
|||
if (SeFlag) ShowMessage("Seach End,Find Nothing");
|
||||
break;
|
||||
case 2: //当前列向上找;
|
||||
for(int i=sgEdit->Row;i>1;i--){
|
||||
for (int i = sgEdit->Row; i > 1; i--)
|
||||
{
|
||||
if (0 == CompareStr(sgEdit->Cells[sgEdit->Col][i],
|
||||
FrmSearch->edSeach->Text)){ //找到了
|
||||
FrmSearch->edSeach->Text)) //找到了
|
||||
{
|
||||
sgEdit->Row = i;
|
||||
SeFlag = false;
|
||||
break;
|
||||
|
|
@ -277,9 +302,11 @@ void __fastcall TFrmMain::ToolButton1Click(TObject *Sender)
|
|||
if (SeFlag) ShowMessage("Seach col top,Find Nothing");
|
||||
break;
|
||||
case 3: //当前列向下找;
|
||||
for(int i=sgEdit->Row;i<sgEdit->RowCount;i++){
|
||||
for (int i = sgEdit->Row; i < sgEdit->RowCount; i++)
|
||||
{
|
||||
if (0 == CompareStr(sgEdit->Cells[sgEdit->Col][i],
|
||||
FrmSearch->edSeach->Text)){ //找到了
|
||||
FrmSearch->edSeach->Text)) //找到了
|
||||
{
|
||||
sgEdit->Row = i;
|
||||
SeFlag = false;
|
||||
break;
|
||||
|
|
@ -297,14 +324,18 @@ void __fastcall TFrmMain::sgEditKeyDown(TObject *Sender, WORD &Key,
|
|||
{
|
||||
|
||||
bool SeFlag = true;
|
||||
if(Key==VK_F3){
|
||||
if (Key == VK_F3)
|
||||
{
|
||||
switch (FrmSearch->rgSI->ItemIndex)
|
||||
{
|
||||
case 0: //向上找;
|
||||
for(int i=sgEdit->ColCount*sgEdit->Row+sgEdit->Col-1;i>sgEdit->ColCount;i--){
|
||||
if(i%sgEdit->ColCount!=0){
|
||||
for (int i = sgEdit->ColCount * sgEdit->Row + sgEdit->Col - 1; i > sgEdit->ColCount; i--)
|
||||
{
|
||||
if (i % sgEdit->ColCount != 0)
|
||||
{
|
||||
if (0 == CompareStr(sgEdit->Cells[i - sgEdit->ColCount * (i / sgEdit->ColCount)][i / sgEdit->ColCount],
|
||||
FrmSearch->edSeach->Text)){ //找到了
|
||||
FrmSearch->edSeach->Text)) //找到了
|
||||
{
|
||||
sgEdit->Col = i - sgEdit->ColCount * i / sgEdit->ColCount;
|
||||
sgEdit->Row = i / sgEdit->ColCount;
|
||||
SeFlag = false;
|
||||
|
|
@ -315,10 +346,13 @@ void __fastcall TFrmMain::sgEditKeyDown(TObject *Sender, WORD &Key,
|
|||
if (SeFlag) ShowMessage("Seach Top,Find Nothing.");
|
||||
break;
|
||||
case 1: //向下找;
|
||||
for(int i=sgEdit->ColCount*sgEdit->Row+sgEdit->Col+1;i<sgEdit->ColCount*sgEdit->RowCount;i++){
|
||||
if(i%sgEdit->ColCount!=0){
|
||||
for (int i = sgEdit->ColCount * sgEdit->Row + sgEdit->Col + 1; i < sgEdit->ColCount * sgEdit->RowCount; i++)
|
||||
{
|
||||
if (i % sgEdit->ColCount != 0)
|
||||
{
|
||||
if (0 == CompareStr(sgEdit->Cells[i - sgEdit->ColCount * (i / sgEdit->ColCount)][i / sgEdit->ColCount],
|
||||
FrmSearch->edSeach->Text)){ //找到了
|
||||
FrmSearch->edSeach->Text)) //找到了
|
||||
{
|
||||
sgEdit->Col = i - sgEdit->ColCount * (i / sgEdit->ColCount);
|
||||
sgEdit->Row = i / sgEdit->ColCount;
|
||||
SeFlag = false;
|
||||
|
|
@ -329,9 +363,11 @@ void __fastcall TFrmMain::sgEditKeyDown(TObject *Sender, WORD &Key,
|
|||
if (SeFlag) ShowMessage("Seach End,Find Nothing.");
|
||||
break;
|
||||
case 2: //当前列向上找;
|
||||
for(int i=sgEdit->Row;i>1;i--){
|
||||
for (int i = sgEdit->Row; i > 1; i--)
|
||||
{
|
||||
if (0 == CompareStr(sgEdit->Cells[sgEdit->Col][i],
|
||||
FrmSearch->edSeach->Text)){ //找到了
|
||||
FrmSearch->edSeach->Text)) //找到了
|
||||
{
|
||||
sgEdit->Row = i;
|
||||
SeFlag = false;
|
||||
break;
|
||||
|
|
@ -340,9 +376,11 @@ void __fastcall TFrmMain::sgEditKeyDown(TObject *Sender, WORD &Key,
|
|||
if (SeFlag) ShowMessage("Seach col Top,Find Nothing.");
|
||||
break;
|
||||
case 3: //当前列向下找;
|
||||
for(int i=sgEdit->Row;i<sgEdit->RowCount;i++){
|
||||
for (int i = sgEdit->Row; i < sgEdit->RowCount; i++)
|
||||
{
|
||||
if (0 == CompareStr(sgEdit->Cells[sgEdit->Col][i],
|
||||
FrmSearch->edSeach->Text)){ //找到了
|
||||
FrmSearch->edSeach->Text)) //找到了
|
||||
{
|
||||
sgEdit->Row = i;
|
||||
SeFlag = false;
|
||||
break;
|
||||
|
|
@ -390,14 +428,16 @@ void __fastcall TFrmMain::OpenFileCol(AnsiString FileName,int ColIndex,int ColTy
|
|||
switch (ColType)
|
||||
{
|
||||
case 0: //整型值 Int
|
||||
for(int i=0;i<sgEdit->RowCount-1;i++){
|
||||
for (int i = 0; i < sgEdit->RowCount - 1; i++)
|
||||
{
|
||||
fseek(stream, 0x14 + (i * (sgEdit->ColCount - 1) + (ColIndex - 1)) * 4, 0);
|
||||
fread(&iVal, 4, 1, stream);
|
||||
sgEdit->Cells[ColIndex][i + 1] = IntToStr(iVal);
|
||||
}
|
||||
break;
|
||||
case 1: //浮点值 Float
|
||||
for(int i=0;i<sgEdit->RowCount-1;i++){
|
||||
for (int i = 0; i < sgEdit->RowCount - 1; i++)
|
||||
{
|
||||
fseek(stream, 0x14 + (i * (sgEdit->ColCount - 1) + (ColIndex - 1)) * 4, 0);
|
||||
fread(&fVal, 4, 1, stream);
|
||||
sgEdit->Cells[ColIndex][i + 1] = FloatToStr(fVal);
|
||||
|
|
@ -415,16 +455,20 @@ void __fastcall TFrmMain::OpenFileCol(AnsiString FileName,int ColIndex,int ColTy
|
|||
dwTextLen = iVal;
|
||||
|
||||
dwTextStartPos = dwRows * dwRowLen + 20;
|
||||
for(int i=0;i<sgEdit->RowCount-1;i++){
|
||||
for (int i = 0; i < sgEdit->RowCount - 1; i++)
|
||||
{
|
||||
fseek(stream, 0x14 + (i * (sgEdit->ColCount - 1) + (ColIndex - 1)) * 4, 0);
|
||||
fread(&iVal, 4, 1, stream);
|
||||
sgEdit->Cells[ColIndex][i + 1] = IntToStr(iVal);
|
||||
if(dwTextStartPos + iVal < length){
|
||||
if (dwTextStartPos + iVal < length)
|
||||
{
|
||||
fseek(stream, dwTextStartPos + iVal, 0);
|
||||
fread(Txtbuf, 1, 255, stream);
|
||||
//pTextPtr = pBuff + dwTextStartPos + lTemp;
|
||||
sgEdit->Cells[ColIndex][i + 1] = Txtbuf;
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
sgEdit->Cells[ColIndex][i + 1] = "This Col Not Text!";
|
||||
}
|
||||
}
|
||||
|
|
@ -434,9 +478,12 @@ void __fastcall TFrmMain::OpenFileCol(AnsiString FileName,int ColIndex,int ColTy
|
|||
}
|
||||
void __fastcall TFrmMain::Timer1Timer(TObject* Sender)
|
||||
{
|
||||
if(OpenOk){
|
||||
if (OpenOk)
|
||||
{
|
||||
lbOpState->Caption = "Open File Ok.";
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
lbOpState->Caption = "Open Now.....";
|
||||
}
|
||||
}
|
||||
|
|
@ -498,7 +545,8 @@ void __fastcall TFrmMain::N4Click(TObject *Sender)
|
|||
|
||||
void __fastcall TFrmMain::btTxtTypeClick(TObject* Sender)
|
||||
{
|
||||
if(OpenOk==true){
|
||||
if (OpenOk == true)
|
||||
{
|
||||
AnsiString iniSetFile = ExtractFilePath(Application->ExeName) + "BcdEditer.ini";
|
||||
AnsiString SectionName = ExtractFileName(CurrentOpenFile);
|
||||
TIniFile* ini;
|
||||
|
|
@ -517,12 +565,15 @@ void __fastcall TFrmMain::ToolButton3Click(TObject *Sender)
|
|||
int OldRow;
|
||||
OldRow = sgEdit->Row;
|
||||
OldCol = sgEdit->Col;
|
||||
if(sgEdit->FixedCols==1){
|
||||
if (sgEdit->FixedCols == 1)
|
||||
{
|
||||
sgEdit->FixedCols = 2;
|
||||
if (OldCol != 1)
|
||||
sgEdit->Col = OldCol;
|
||||
sgEdit->Row = OldRow;
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
sgEdit->FixedCols = 1;
|
||||
sgEdit->Row = OldRow;
|
||||
if (OldCol != 2)
|
||||
|
|
@ -560,7 +611,8 @@ if(OpenOk==false) return;
|
|||
//length = ftell(stream);
|
||||
iFileHandle = FileOpen(CurrentOpenFile, fmOpenRead | fmOpenWrite); //打开文件
|
||||
|
||||
for(int i=0;i<sgEdit->ColCount-1;i++){
|
||||
for (int i = 0; i < sgEdit->ColCount - 1; i++)
|
||||
{
|
||||
switch (thOpen->ColType[i])
|
||||
{
|
||||
case 0: //整型值 sgEdit->Row
|
||||
|
|
@ -624,7 +676,8 @@ if(OpenOk==false) return;
|
|||
switch (thOpen->ColType[sgEdit->Col])
|
||||
{
|
||||
case 0: //整型值
|
||||
for(int i=0;i<sgEdit->RowCount-1;i++){
|
||||
for (int i = 0; i < sgEdit->RowCount - 1; i++)
|
||||
{
|
||||
//fseek(stream, 0x14+(i*(sgEdit->ColCount-1)+(sgEdit->Col-1))*4, 0);
|
||||
//iVal=StrToInt(sgEdit->Cells[sgEdit->Col][i+1]);
|
||||
//fwrite(&iVal, 4, 1, stream);
|
||||
|
|
@ -635,7 +688,8 @@ if(OpenOk==false) return;
|
|||
}
|
||||
break;
|
||||
case 1: //浮点值
|
||||
for(int i=0;i<sgEdit->RowCount-1;i++){
|
||||
for (int i = 0; i < sgEdit->RowCount - 1; i++)
|
||||
{
|
||||
//fseek(stream, 0x14+(i*(sgEdit->ColCount-1)+(sgEdit->Col-1))*4, 0);
|
||||
//fVal=StrToFloat(sgEdit->Cells[sgEdit->Col][i+1]);
|
||||
//fwrite(&fVal, 4, 1, stream);
|
||||
|
|
@ -682,7 +736,8 @@ if(OpenOk==false) return;
|
|||
fseek(stream, 0L, SEEK_END);
|
||||
length = ftell(stream);
|
||||
|
||||
for(int i=1;i<sgEdit->ColCount-1;i++){
|
||||
for (int i = 1; i < sgEdit->ColCount - 1; i++)
|
||||
{
|
||||
switch (thOpen->ColType[i])
|
||||
{
|
||||
case 0: //整型值 sgEdit->Row
|
||||
|
|
@ -736,7 +791,8 @@ if(OpenOk==false) return;
|
|||
switch (thOpen->ColType[sgEdit->Col])
|
||||
{
|
||||
case 0: //整型值
|
||||
for(int i=0;i<sgEdit->RowCount-1;i++){
|
||||
for (int i = 0; i < sgEdit->RowCount - 1; i++)
|
||||
{
|
||||
//fseek(stream, 0x14+(i*(sgEdit->ColCount-1)+(ColIndex-1))*4, 0);
|
||||
//iVal=StrToInt(sgEdit->Cells[ColIndex][i+1]);
|
||||
//fwrite(&iVal, 4, 1, stream);
|
||||
|
|
@ -744,7 +800,8 @@ if(OpenOk==false) return;
|
|||
}
|
||||
break;
|
||||
case 1: //浮点值
|
||||
for(int i=0;i<sgEdit->RowCount-1;i++){
|
||||
for (int i = 0; i < sgEdit->RowCount - 1; i++)
|
||||
{
|
||||
//fseek(stream, 0x14+(i*(sgEdit->ColCount-1)+(ColIndex-1))*4, 0);
|
||||
//fVal=StrToFloat(sgEdit->Cells[ColIndex][i+1]);
|
||||
//fwrite(&fVal, 4, 1, stream);
|
||||
|
|
|
|||
|
|
@ -77,7 +77,8 @@ void thOpenFile::ReadAndModifyFromBuff(char *pBuff, DWORD dwSize, const char* ps
|
|||
FrmMain->sgEdit->RowCount = dwRows + 1;
|
||||
FrmMain->sgEdit->ColCount = dwCols + 1;
|
||||
|
||||
for(int i=0; i<FrmMain->sgEdit->RowCount; i++){
|
||||
for (int i = 0; i < FrmMain->sgEdit->RowCount; i++)
|
||||
{
|
||||
FrmMain->sgEdit->Cells[0][i] = IntToStr(i);
|
||||
if (Terminated) return;
|
||||
}
|
||||
|
|
@ -86,7 +87,8 @@ void thOpenFile::ReadAndModifyFromBuff(char *pBuff, DWORD dwSize, const char* ps
|
|||
AnsiString SectionName = ExtractFileName(FrmMain->CurrentOpenFile);
|
||||
|
||||
ini = new TIniFile(iniSetFile);
|
||||
for(int j=0; j<FrmMain->sgEdit->ColCount; j++){
|
||||
for (int j = 0; j < FrmMain->sgEdit->ColCount; j++)
|
||||
{
|
||||
FrmMain->sgEdit->Cells[j][0] = ini->ReadString(SectionName, "ColTitle" + IntToStr(j), IntToStr(j));
|
||||
//sgEdit->Cells[j][0]=IntToStr(j);
|
||||
ColType[j] = ini->ReadInteger(SectionName, "ColType" + IntToStr(j), 0);
|
||||
|
|
@ -120,7 +122,8 @@ void thOpenFile::ReadAndModifyFromBuff(char *pBuff, DWORD dwSize, const char* ps
|
|||
|
||||
if (j == 0) //ID
|
||||
FrmMain->sgEdit->Cells[j + 1][i + 1] = IntToStr(lTemp);
|
||||
else{
|
||||
else
|
||||
{
|
||||
|
||||
//ColType= ini->ReadInteger(SectionName,"ColType"+IntToStr(j),0);
|
||||
|
||||
|
|
@ -133,10 +136,13 @@ void thOpenFile::ReadAndModifyFromBuff(char *pBuff, DWORD dwSize, const char* ps
|
|||
FrmMain->sgEdit->Cells[j + 1][i + 1] = FloatToStr(fTemp);
|
||||
break;
|
||||
case 2: //文本 文本类型只能看,不能编辑
|
||||
if(dwTextStartPos + lTemp < dwSize){
|
||||
if (dwTextStartPos + lTemp < dwSize)
|
||||
{
|
||||
pTextPtr = pBuff + dwTextStartPos + lTemp;
|
||||
FrmMain->sgEdit->Cells[j + 1][i + 1] = pTextPtr;
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
FrmMain->sgEdit->Cells[j + 1][i + 1] = "该列不是文本";
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,10 @@
|
|||
#include "loadlib/wdt.h"
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined( __GNUC__ )
|
||||
#define _open open
|
||||
#define _close close
|
||||
|
|
@ -393,7 +397,7 @@ void ReadLiquidTypeTableDBC(int const locale)
|
|||
|
||||
// Map file format data
|
||||
static char const* MAP_MAGIC = "MAPS";
|
||||
static char const* MAP_VERSION_MAGIC = "v1.2";
|
||||
static char const* MAP_VERSION_MAGIC = "c1.3";
|
||||
static char const* MAP_AREA_MAGIC = "AREA";
|
||||
static char const* MAP_HEIGHT_MAGIC = "MHGT";
|
||||
static char const* MAP_LIQUID_MAGIC = "MLIQ";
|
||||
|
|
@ -443,7 +447,6 @@ struct map_heightHeader
|
|||
#define MAP_LIQUID_TYPE_DARK_WATER 0x10
|
||||
#define MAP_LIQUID_TYPE_WMO_WATER 0x20
|
||||
|
||||
|
||||
#define MAP_LIQUID_NO_TYPE 0x0001
|
||||
#define MAP_LIQUID_NO_HEIGHT 0x0002
|
||||
|
||||
|
|
@ -478,7 +481,8 @@ uint16 uint16_V9[ADT_GRID_SIZE+1][ADT_GRID_SIZE+1];
|
|||
uint8 uint8_V8[ADT_GRID_SIZE][ADT_GRID_SIZE];
|
||||
uint8 uint8_V9[ADT_GRID_SIZE + 1][ADT_GRID_SIZE + 1];
|
||||
|
||||
uint8 liquid_type[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID];
|
||||
uint16 liquid_entry[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID];
|
||||
uint8 liquid_flags[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID];
|
||||
bool liquid_show[ADT_GRID_SIZE][ADT_GRID_SIZE];
|
||||
float liquid_height[ADT_GRID_SIZE + 1][ADT_GRID_SIZE + 1];
|
||||
|
||||
|
|
@ -490,7 +494,8 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32
|
|||
return false;
|
||||
|
||||
memset(liquid_show, 0, sizeof(liquid_show));
|
||||
memset(liquid_type, 0, sizeof(liquid_type));
|
||||
memset(liquid_flags, 0, sizeof(liquid_flags));
|
||||
memset(liquid_entry, 0, sizeof(liquid_entry));
|
||||
|
||||
// Prepare map header
|
||||
map_fileheader map;
|
||||
|
|
@ -724,6 +729,68 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32
|
|||
map.heightMapSize += sizeof(V9) + sizeof(V8);
|
||||
}
|
||||
|
||||
// Get from MCLQ chunk (old)
|
||||
for (int i = 0; i < ADT_CELLS_PER_GRID; i++)
|
||||
{
|
||||
for (int j = 0; j < ADT_CELLS_PER_GRID; j++)
|
||||
{
|
||||
adt_MCNK* cell = adt.cells[i][j];
|
||||
if (!cell)
|
||||
continue;
|
||||
|
||||
adt_MCLQ* liquid = cell->getMCLQ();
|
||||
int count = 0;
|
||||
if (!liquid || cell->sizeMCLQ <= 8)
|
||||
continue;
|
||||
|
||||
for (int y = 0; y < ADT_CELL_SIZE; y++)
|
||||
{
|
||||
int cy = i * ADT_CELL_SIZE + y;
|
||||
for (int x = 0; x < ADT_CELL_SIZE; x++)
|
||||
{
|
||||
int cx = j * ADT_CELL_SIZE + x;
|
||||
if (liquid->flags[y][x] != 0x0F)
|
||||
{
|
||||
liquid_show[cy][cx] = true;
|
||||
if (liquid->flags[y][x] & (1 << 7))
|
||||
liquid_flags[i][j] |= MAP_LIQUID_TYPE_DARK_WATER;
|
||||
++count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32 c_flag = cell->flags;
|
||||
if (c_flag & (1 << 2))
|
||||
{
|
||||
liquid_entry[i][j] = 1;
|
||||
liquid_flags[i][j] |= MAP_LIQUID_TYPE_WATER; // water
|
||||
}
|
||||
if (c_flag & (1 << 3))
|
||||
{
|
||||
liquid_entry[i][j] = 2;
|
||||
liquid_flags[i][j] |= MAP_LIQUID_TYPE_OCEAN; // ocean
|
||||
}
|
||||
if (c_flag & (1 << 4))
|
||||
{
|
||||
liquid_entry[i][j] = 3;
|
||||
liquid_flags[i][j] |= MAP_LIQUID_TYPE_MAGMA; // magma/slime
|
||||
}
|
||||
|
||||
if (!count && liquid_flags[i][j])
|
||||
fprintf(stderr, "Wrong liquid detect in MCLQ chunk");
|
||||
|
||||
for (int y = 0; y <= ADT_CELL_SIZE; y++)
|
||||
{
|
||||
int cy = i * ADT_CELL_SIZE + y;
|
||||
for (int x = 0; x <= ADT_CELL_SIZE; x++)
|
||||
{
|
||||
int cx = j * ADT_CELL_SIZE + x;
|
||||
liquid_height[cy][cx] = liquid->liquid[y][x].height;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get liquid map for grid (in WOTLK used MH2O chunk)
|
||||
adt_MH2O* h2o = adt.a_grid->getMH2O();
|
||||
if (h2o)
|
||||
|
|
@ -753,26 +820,26 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32
|
|||
}
|
||||
}
|
||||
|
||||
uint32 type = LiqType[h->liquidType];
|
||||
switch (type)
|
||||
liquid_entry[i][j] = h->liquidType;
|
||||
switch (LiqType[h->liquidType])
|
||||
{
|
||||
case LIQUID_TYPE_WATER: liquid_type[i][j] |= MAP_LIQUID_TYPE_WATER; break;
|
||||
case LIQUID_TYPE_OCEAN: liquid_type[i][j] |= MAP_LIQUID_TYPE_OCEAN; break;
|
||||
case LIQUID_TYPE_MAGMA: liquid_type[i][j] |= MAP_LIQUID_TYPE_MAGMA; break;
|
||||
case LIQUID_TYPE_SLIME: liquid_type[i][j] |= MAP_LIQUID_TYPE_SLIME; break;
|
||||
case LIQUID_TYPE_WATER: liquid_flags[i][j] |= MAP_LIQUID_TYPE_WATER; break;
|
||||
case LIQUID_TYPE_OCEAN: liquid_flags[i][j] |= MAP_LIQUID_TYPE_OCEAN; break;
|
||||
case LIQUID_TYPE_MAGMA: liquid_flags[i][j] |= MAP_LIQUID_TYPE_MAGMA; break;
|
||||
case LIQUID_TYPE_SLIME: liquid_flags[i][j] |= MAP_LIQUID_TYPE_SLIME; break;
|
||||
default:
|
||||
printf("\nCan't find Liquid type %u for map %s\nchunk %d,%d\n", h->liquidType, filename, i, j);
|
||||
break;
|
||||
}
|
||||
// Dark water detect
|
||||
if (type == LIQUID_TYPE_OCEAN)
|
||||
if (LiqType[h->liquidType] == LIQUID_TYPE_OCEAN)
|
||||
{
|
||||
uint8* lm = h2o->getLiquidLightMap(h);
|
||||
if (!lm)
|
||||
liquid_type[i][j]|=MAP_LIQUID_TYPE_DARK_WATER;
|
||||
liquid_flags[i][j] |= MAP_LIQUID_TYPE_DARK_WATER;
|
||||
}
|
||||
|
||||
if (!count && liquid_type[i][j])
|
||||
if (!count && liquid_flags[i][j])
|
||||
printf("Wrong liquid detect in MH2O chunk");
|
||||
|
||||
float* height = h2o->getLiquidHeightMap(h);
|
||||
|
|
@ -793,72 +860,16 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get from MCLQ chunk (old)
|
||||
for (int i=0;i<ADT_CELLS_PER_GRID;i++)
|
||||
{
|
||||
for(int j=0;j<ADT_CELLS_PER_GRID;j++)
|
||||
{
|
||||
adt_MCNK *cell = adt.cells[i][j];
|
||||
if (!cell)
|
||||
continue;
|
||||
|
||||
adt_MCLQ *liquid = cell->getMCLQ();
|
||||
int count = 0;
|
||||
if (!liquid || cell->sizeMCLQ <= 8)
|
||||
continue;
|
||||
|
||||
for (int y=0; y < ADT_CELL_SIZE; y++)
|
||||
{
|
||||
int cy = i*ADT_CELL_SIZE + y;
|
||||
for (int x=0; x < ADT_CELL_SIZE; x++)
|
||||
{
|
||||
int cx = j*ADT_CELL_SIZE + x;
|
||||
if (liquid->flags[y][x] != 0x0F)
|
||||
{
|
||||
liquid_show[cy][cx] = true;
|
||||
if (liquid->flags[y][x]&(1<<7))
|
||||
liquid_type[i][j]|=MAP_LIQUID_TYPE_DARK_WATER;
|
||||
++count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32 c_flag = cell->flags;
|
||||
if(c_flag & (1<<2))
|
||||
liquid_type[i][j]|=MAP_LIQUID_TYPE_WATER; // water
|
||||
if(c_flag & (1<<3))
|
||||
liquid_type[i][j]|=MAP_LIQUID_TYPE_OCEAN; // ochean
|
||||
if(c_flag & (1<<4))
|
||||
liquid_type[i][j]|=MAP_LIQUID_TYPE_MAGMA; // magma/slime
|
||||
|
||||
if (!count && liquid_type[i][j])
|
||||
printf("Wrong liquid detect in MCLQ chunk");
|
||||
|
||||
for (int y=0; y <= ADT_CELL_SIZE; y++)
|
||||
{
|
||||
int cy = i*ADT_CELL_SIZE + y;
|
||||
for (int x=0; x<= ADT_CELL_SIZE; x++)
|
||||
{
|
||||
int cx = j*ADT_CELL_SIZE + x;
|
||||
liquid_height[cy][cx] = liquid->liquid[y][x].height;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//============================================
|
||||
// Pack liquid data
|
||||
//============================================
|
||||
uint8 type = liquid_type[0][0];
|
||||
uint8 type = liquid_flags[0][0];
|
||||
bool fullType = false;
|
||||
for (int y = 0; y < ADT_CELLS_PER_GRID; y++)
|
||||
{
|
||||
for (int x = 0; x < ADT_CELLS_PER_GRID; x++)
|
||||
{
|
||||
if (liquid_type[y][x]!=type)
|
||||
if (liquid_flags[y][x] != type)
|
||||
{
|
||||
fullType = true;
|
||||
y = ADT_CELLS_PER_GRID;
|
||||
|
|
@ -924,7 +935,7 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32
|
|||
if (liquidHeader.flags & MAP_LIQUID_NO_TYPE)
|
||||
liquidHeader.liquidType = type;
|
||||
else
|
||||
map.liquidMapSize+=sizeof(liquid_type);
|
||||
map.liquidMapSize += sizeof(liquid_entry) + sizeof(liquid_flags);
|
||||
|
||||
if (!(liquidHeader.flags & MAP_LIQUID_NO_HEIGHT))
|
||||
map.liquidMapSize += sizeof(float) * liquidHeader.width * liquidHeader.height;
|
||||
|
|
@ -991,7 +1002,10 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32
|
|||
{
|
||||
fwrite(&liquidHeader, sizeof(liquidHeader), 1, output);
|
||||
if (!(liquidHeader.flags & MAP_LIQUID_NO_TYPE))
|
||||
fwrite(liquid_type, sizeof(liquid_type), 1, output);
|
||||
{
|
||||
fwrite(liquid_entry, sizeof(liquid_entry), 1, output);
|
||||
fwrite(liquid_flags, sizeof(liquid_flags), 1, output);
|
||||
}
|
||||
if (!(liquidHeader.flags & MAP_LIQUID_NO_HEIGHT))
|
||||
{
|
||||
for (int y = 0; y < liquidHeader.height; y++)
|
||||
|
|
|
|||
165
contrib/extractor/VC110_ad.vcxproj
Normal file
165
contrib/extractor/VC110_ad.vcxproj
Normal file
|
|
@ -0,0 +1,165 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>ad</ProjectName>
|
||||
<ProjectGuid>{D7552D4F-408F-4F8E-859B-366659150CF4}</ProjectGuid>
|
||||
<RootNamespace>ad</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseOfMfc>false</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\debug\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\release\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">ad_debug</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<TypeLibraryName>./ad.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\dep\StormLib\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)ad.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
|
||||
<ObjectFileName>$(IntDir)</ObjectFileName>
|
||||
<ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>
|
||||
<XMLDocumentationFileName>$(IntDir)</XMLDocumentationFileName>
|
||||
<BrowseInformation>true</BrowseInformation>
|
||||
<BrowseInformationFile>$(IntDir)</BrowseInformationFile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0419</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>StormLibDAS.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\..\dep\StormLib\bin\StormLib\$(Platform)\$(Configuration)AS;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<OutputFile>ad_debug.exe</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>./ad_debug.pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>true</MkTypLibCompatible>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<TargetEnvironment>Win32</TargetEnvironment>
|
||||
<TypeLibraryName>./ad.tlb</TypeLibraryName>
|
||||
<HeaderFileName>
|
||||
</HeaderFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Full</Optimization>
|
||||
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
|
||||
<AdditionalIncludeDirectories>..\..\dep\StormLib\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)ad.pch</PrecompiledHeaderOutputFile>
|
||||
<AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
|
||||
<ObjectFileName>$(IntDir)</ObjectFileName>
|
||||
<ProgramDataBaseFileName>$(IntDir)</ProgramDataBaseFileName>
|
||||
<XMLDocumentationFileName>$(IntDir)</XMLDocumentationFileName>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
</ClCompile>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0419</Culture>
|
||||
</ResourceCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>StormLibRAS.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\..\dep\StormLib\bin\StormLib\$(Platform)\$(Configuration)AS;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<OutputFile>./ad.exe</OutputFile>
|
||||
<SuppressStartupBanner>true</SuppressStartupBanner>
|
||||
<ProgramDatabaseFile>./ad.pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="loadlib\adt.cpp" />
|
||||
<ClCompile Include="dbcfile.cpp" />
|
||||
<ClCompile Include="loadlib\loadlib.cpp" />
|
||||
<ClCompile Include="system.cpp" />
|
||||
<ClCompile Include="loadlib\wdt.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="loadlib\adt.h" />
|
||||
<ClInclude Include="dbcfile.h" />
|
||||
<ClInclude Include="loadlib\loadlib.h" />
|
||||
<ClInclude Include="loadlib\wdt.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
44
contrib/extractor/VC110_ad.vcxproj.filters
Normal file
44
contrib/extractor/VC110_ad.vcxproj.filters
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{7748a821-40c1-4432-a07e-ff4da1273091}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{bd48cc48-7a79-4088-9e3f-8bf123692891}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="loadlib\adt.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="dbcfile.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="loadlib\loadlib.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="system.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="loadlib\wdt.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="loadlib\adt.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="dbcfile.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="loadlib\loadlib.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="loadlib\wdt.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -25,7 +25,6 @@ DBCFile::DBCFile(const std::string &filename):
|
|||
filename(filename),
|
||||
data(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
DBCFile::DBCFile(HANDLE file) : fileHandle(file), data(0)
|
||||
|
|
|
|||
|
|
@ -98,13 +98,15 @@ public:
|
|||
Iterator(DBCFile& file, unsigned char* offset):
|
||||
record(file, offset) {}
|
||||
/// Advance (prefix only)
|
||||
Iterator & operator++() {
|
||||
Iterator& operator++()
|
||||
{
|
||||
record.offset += record.file.recordSize;
|
||||
return *this;
|
||||
}
|
||||
/// Return address of current instance
|
||||
Record const& operator*() const { return record; }
|
||||
const Record* operator->() const {
|
||||
const Record* operator->() const
|
||||
{
|
||||
return &record;
|
||||
}
|
||||
/// Comparison
|
||||
|
|
|
|||
|
|
@ -68,7 +68,8 @@ void CloseArchives();
|
|||
//
|
||||
struct file_MVER
|
||||
{
|
||||
union{
|
||||
union
|
||||
{
|
||||
uint32 fcc;
|
||||
char fcc_txt[4];
|
||||
};
|
||||
|
|
@ -76,7 +77,8 @@ struct file_MVER
|
|||
uint32 ver;
|
||||
};
|
||||
|
||||
class FileLoader{
|
||||
class FileLoader
|
||||
{
|
||||
uint8* data;
|
||||
uint32 data_size;
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -25,8 +25,10 @@
|
|||
//**************************************************************************************
|
||||
#define WDT_MAP_SIZE 64
|
||||
|
||||
class wdt_MWMO{
|
||||
union{
|
||||
class wdt_MWMO
|
||||
{
|
||||
union
|
||||
{
|
||||
uint32 fcc;
|
||||
char fcc_txt[4];
|
||||
};
|
||||
|
|
@ -35,8 +37,10 @@ public:
|
|||
bool prepareLoadedData();
|
||||
};
|
||||
|
||||
class wdt_MPHD{
|
||||
union{
|
||||
class wdt_MPHD
|
||||
{
|
||||
union
|
||||
{
|
||||
uint32 fcc;
|
||||
char fcc_txt[4];
|
||||
};
|
||||
|
|
@ -54,15 +58,18 @@ public:
|
|||
bool prepareLoadedData();
|
||||
};
|
||||
|
||||
class wdt_MAIN{
|
||||
union{
|
||||
class wdt_MAIN
|
||||
{
|
||||
union
|
||||
{
|
||||
uint32 fcc;
|
||||
char fcc_txt[4];
|
||||
};
|
||||
public:
|
||||
uint32 size;
|
||||
|
||||
struct adtData{
|
||||
struct adtData
|
||||
{
|
||||
uint32 exist;
|
||||
uint32 data1;
|
||||
} adt_list[64][64];
|
||||
|
|
@ -70,7 +77,8 @@ public:
|
|||
bool prepareLoadedData();
|
||||
};
|
||||
|
||||
class WDT_file : public FileLoader{
|
||||
class WDT_file : public FileLoader
|
||||
{
|
||||
public:
|
||||
bool prepareLoadedData();
|
||||
|
||||
|
|
|
|||
|
|
@ -163,11 +163,11 @@ fi
|
|||
if [ "$USE_VMAPS" = "1" ]
|
||||
then
|
||||
echo "`date`: Start extraction of vmaps..." | tee -a $LOG_FILE
|
||||
vmapExtractor4 | tee -a $DETAIL_LOG_FILE
|
||||
vmapExtractor | tee -a $DETAIL_LOG_FILE
|
||||
echo "`date`: Extracting of vmaps finished" | tee -a $LOG_FILE
|
||||
mkdir vmaps
|
||||
echo "`date`: Start assembling of vmaps..." | tee -a $LOG_FILE
|
||||
vmap_assembler.exe buildings vmaps | tee -a $DETAIL_LOG_FILE
|
||||
vmap_assembler Buildings vmaps | tee -a $DETAIL_LOG_FILE
|
||||
echo "`date`: Assembling of vmaps finished" | tee -a $LOG_FILE
|
||||
|
||||
echo | tee -a $LOG_FILE
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -33,13 +33,13 @@ DETAIL_LOG_FILE="MoveMapGen_detailed.log"
|
|||
## ! Use below only for finetuning or if you know what you are doing !
|
||||
|
||||
## All maps
|
||||
MAP_LIST_A="1 37 543 595 289 572 529 562 531 269 47 649 650 599 548 559 429 230 573 349 13 25 409 229 43 48 546 553 547 604 545 90 576"
|
||||
MAP_LIST_B="571 628 560 509 723 532 607 600 668 33 585 566 389 601 369 129 550 189 542 70 109 554 632 552 555 540 598 450 558 249 35 624 557"
|
||||
MAP_LIST_C="0 631 609 534 533 619 469 602 329 580 615 578 36 556 44 565 544 34 617 608 618 449 616 42 451 582 584 586 587 588 589 590 591 592"
|
||||
MAP_LIST_D="530 169 575 603 309 574 30 564 568 209 724 658 489 593 594 596 597 605 606 610 612 613 614 620 621 622 623 641 642 647 672 673 712 713 718"
|
||||
MAP_LIST_D1="209 724 658 489 606 610 612 613 614 620 621"
|
||||
MAP_LIST_D2="169 575 603 309 574 30 564 568 622 623 641 642 647 672 673 712 713 718"
|
||||
MAP_LIST_D3="530 593 594 596 597 605"
|
||||
MAP_LIST_A="1 37 543 595 289 572 529 562 531 269 47 649 650 599 548 559 429 230 573 349 13 25 409 229 43 48 546 553 547 604 545 90 576 742 743 746 747 748 749 750 762 763 764 765 766 767 859 861 930 938 939 940 980"
|
||||
MAP_LIST_B="571 628 560 509 723 532 607 600 668 33 585 566 389 601 369 129 550 189 542 70 109 554 632 552 555 540 598 450 558 249 35 624 557 659 660 661 662 719 720 721 731 732 734 736 738 739 740 741 951 967 969"
|
||||
MAP_LIST_C="0 631 609 534 533 619 469 602 329 580 615 578 36 556 44 565 544 34 617 608 618 449 616 42 451 582 584 586 587 588 589 590 591 592 643 644 645 646 648 627 637 638 669 670 671 674 725 726 727 728 730"
|
||||
MAP_LIST_D="530 169 575 603 309 574 30 564 568 209 724 658 489 593 594 596 597 605 606 610 612 613 614 620 621 622 623 641 642 647 672 673 712 713 718 651 654 655 656 657 751 752 753 754 755 757 759 760 761 974 977"
|
||||
MAP_LIST_D1="209 724 658 489 606 610 612 613 614 620 621 754 755 757 759 760 761"
|
||||
MAP_LIST_D2="169 575 603 309 574 30 564 568 622 623 641 642 647 672 673 712 713"
|
||||
MAP_LIST_D3="530 593 594 596 597 605 651 654 655 656 657 751 752 753 974 977 718"
|
||||
|
||||
badParam()
|
||||
{
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -25,8 +25,10 @@ from collections import deque
|
|||
mapList = deque([0,1,530,571,13,25,30,33,34,35,36,37,42,43,44,47,48,70,90,109,129,169,189,209,229,230,249,269,289,309,329,349,369,
|
||||
389,409,429,449,450,451,469,489,509,529,531,532,533,534,540,542,543,544,545,546,547,548,550,552,553,554,555,556,557,558,559,
|
||||
560,562,564,565,566,568,572,573,574,575,576,578,580,582,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,
|
||||
601,602,603,604,605,606,607,608,609,610,612,613,614,615,616,617,618,619,620,621,622,623,624,628,631,632,641,642,647,649,650,
|
||||
658,668,672,673,712,713,718,723,724])
|
||||
601,602,603,604,605,606,607,608,609,610,612,613,614,615,616,617,618,619,620,621,622,623,624,627,628,631,632,637,638,641,642,
|
||||
643,644,645,646,647,648,649,650,651,654,655,656,657,658,659,660,661,662,668,669,670,671,672,673,674,712,713,718,719,720,721,
|
||||
723,724,725,726,727,728,730,731,732,734,736,738,739,740,741,742,743,746,747,748,749,750,751,752,753,754,755,757,759,760,761,
|
||||
762,763,764,765,766,767,859,861,930,938,939,940,951,967,969,974,977,980])
|
||||
|
||||
class workerThread(threading.Thread):
|
||||
def __init__(self, mapID):
|
||||
|
|
|
|||
|
|
@ -792,6 +792,7 @@ namespace MMAP
|
|||
case 597: // CraigTest.wdt
|
||||
case 605: // development_nonweighted.wdt
|
||||
case 606: // QA_DVD.wdt
|
||||
case 627: // unused.wdt
|
||||
return true;
|
||||
default:
|
||||
if (isTransportMap(mapID))
|
||||
|
|
@ -809,6 +810,10 @@ namespace MMAP
|
|||
case 566: // EotS
|
||||
case 607: // SotA
|
||||
case 628: // IoC
|
||||
case 727: // TP
|
||||
case 728: // BfG
|
||||
case 761: // BfG2
|
||||
case 968: // EotS2
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
|
|
@ -848,9 +853,26 @@ namespace MMAP
|
|||
case 647:
|
||||
case 672:
|
||||
case 673:
|
||||
case 674:
|
||||
case 712:
|
||||
case 713:
|
||||
case 718:
|
||||
case 738:
|
||||
case 739:
|
||||
case 740:
|
||||
case 741:
|
||||
case 742:
|
||||
case 743:
|
||||
case 746:
|
||||
case 747:
|
||||
case 748:
|
||||
case 749:
|
||||
case 750:
|
||||
case 762:
|
||||
case 763:
|
||||
case 765:
|
||||
case 766:
|
||||
case 767:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
|
@ -878,5 +900,4 @@ namespace MMAP
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -494,7 +494,8 @@ namespace MMAP
|
|||
}
|
||||
else
|
||||
switch (triangle)
|
||||
{ // 0-----1 .... 128
|
||||
{
|
||||
// 0-----1 .... 128
|
||||
case TOP: // |\ |
|
||||
indices[0] = square + rowOffset; // | \ T |
|
||||
indices[1] = square + 1 + rowOffset; // | \ |
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ namespace MMAP
|
|||
// see following files:
|
||||
// contrib/extractor/system.cpp
|
||||
// src/game/GridMap.cpp
|
||||
static char const* MAP_VERSION_MAGIC = "v1.2";
|
||||
static char const* MAP_VERSION_MAGIC = "c1.3";
|
||||
|
||||
struct MeshData
|
||||
{
|
||||
|
|
|
|||
|
|
@ -58,6 +58,27 @@ bool checkDirectories(bool debugOutput)
|
|||
return true;
|
||||
}
|
||||
|
||||
void printUsage()
|
||||
{
|
||||
printf("Generator command line args\n\n");
|
||||
printf("-? : This help\n");
|
||||
printf("[#] : Build only the map specified by #.\n");
|
||||
printf("--maxAngle [#] : Max walkable inclination angle\n");
|
||||
printf("--tile [#,#] : Build the specified tile\n");
|
||||
printf("--skipLiquid [true|false] : liquid data for maps\n");
|
||||
printf("--skipContinents [true|false] : skip continents\n");
|
||||
printf("--skipJunkMaps [true|false] : junk maps include some unused\n");
|
||||
printf("--skipBattlegrounds [true|false] : does not include PVP arenas\n");
|
||||
printf("--debugOutput [true|false] : create debugging files for use with RecastDemo\n");
|
||||
printf("--bigBaseUnit [true|false] : Generate tile/map using bigger basic unit.\n");
|
||||
printf("--silent : Make script friendly. No wait for user input, error, completion.\n");
|
||||
printf("--offMeshInput [file.*] : Path to file containing off mesh connections data.\n\n");
|
||||
printf("Exemple:\nmovemapgen (generate all mmap with default arg\n"
|
||||
"movemapgen 0 (generate map 0)\n"
|
||||
"movemapgen --tile 34,46 (builds only tile 34,46 of map 0)\n\n");
|
||||
printf("Please read readme file for more information and exemples.\n");
|
||||
}
|
||||
|
||||
bool handleArgs(int argc, char** argv,
|
||||
int& mapnum,
|
||||
int& tileX,
|
||||
|
|
@ -199,6 +220,11 @@ bool handleArgs(int argc, char** argv,
|
|||
|
||||
offMeshInputPath = param;
|
||||
}
|
||||
else if (strcmp(argv[i], "-?") == 0)
|
||||
{
|
||||
printUsage();
|
||||
exit(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
int map = atoi(argv[i]);
|
||||
|
|
@ -242,7 +268,7 @@ int main(int argc, char** argv)
|
|||
debugOutput, silent, bigBaseUnit, offMeshInputPath);
|
||||
|
||||
if (!validParam)
|
||||
return silent ? -1 : finish("You have specified invalid parameters", -1);
|
||||
return silent ? -1 : finish("You have specified invalid parameters (use -? for more help)", -1);
|
||||
|
||||
if (mapnum == -1 && debugOutput)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MoveMapGen", "VC110\MoveMapGen_VC110.vcxproj", "{8028C1F8-4C3E-44D4-96D7-1D6F51B7AB47}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2} = {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}
|
||||
|
|
|
|||
|
|
@ -12,9 +12,8 @@
|
|||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{8028C1F8-4C3E-44D4-96D7-1D6F51B7AB47}</ProjectGuid>
|
||||
<RootNamespace>MoveMapGen_VC100</RootNamespace>
|
||||
<RootNamespace>MoveMapGen_VC110</RootNamespace>
|
||||
<ProjectName>MoveMapGen</ProjectName>
|
||||
<VCTargetsPath Condition="'$(VCTargetsPath11)' != '' and '$(VSVersion)' == '' and $(VisualStudioVersion) == ''">$(VCTargetsPath11)</VCTargetsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
|
|
@ -139,16 +138,16 @@
|
|||
<ClInclude Include="..\..\src\IntermediateValues.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\dep\recastnavigation\Detour\win\VC100\Detour.vcxproj">
|
||||
<ProjectReference Include="..\..\..\..\dep\recastnavigation\Detour\win\VC110\Detour.vcxproj">
|
||||
<Project>{72bdf975-4d4a-42c7-b2c4-f9ed90a2abb6}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\dep\recastnavigation\Recast\win\VC100\Recast.vcxproj">
|
||||
<ProjectReference Include="..\..\..\..\dep\recastnavigation\Recast\win\VC110\Recast.vcxproj">
|
||||
<Project>{00b9dc66-96a6-465d-a6c1-5dff94e48a64}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\win\VC100\g3dlite.vcxproj">
|
||||
<ProjectReference Include="..\..\..\..\win\VC110\g3dlite.vcxproj">
|
||||
<Project>{8072769e-cf10-48bf-b9e1-12752a5dac6e}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\..\win\VC100\zlib.vcxproj">
|
||||
<ProjectReference Include="..\..\..\..\win\VC110\zlib.vcxproj">
|
||||
<Project>{8f1dea42-6a5b-4b62-839d-c141a7bfacf2}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
|
|
|||
|
|
@ -336,4 +336,3 @@ int main(int argc, char* argv[])
|
|||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
218
contrib/vmap_assembler/VC110/vmap_assembler.vcxproj
Normal file
218
contrib/vmap_assembler/VC110/vmap_assembler.vcxproj
Normal file
|
|
@ -0,0 +1,218 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{572FFF74-480C-4472-8ABF-81733BB4049D}</ProjectGuid>
|
||||
<RootNamespace>vmap_assembler</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\$(Platform)_$(Configuration)\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\bin\$(Platform)_$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\bin\$(ProjectName)__$(Platform)_$(Configuration)\</IntDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\bin\$(ProjectName)__$(Platform)_$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\bin\$(Platform)_$(Configuration)\</OutDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\bin\$(Platform)_$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\bin\$(ProjectName)__$(Platform)_$(Configuration)\</IntDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\bin\$(ProjectName)__$(Platform)_$(Configuration)\</IntDir>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
|
||||
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\dep\include\g3dlite;..\..\..\src\shared;..\..\..\src\game\vmap;..\..\..\src\framework;..\..\..\dep\ACE_wrappers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;NO_CORE_FUNCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>$(OutDir)vmap_assembler.exe</OutputFile>
|
||||
<IgnoreSpecificDefaultLibraries>
|
||||
</IgnoreSpecificDefaultLibraries>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<AdditionalLibraryDirectories>
|
||||
</AdditionalLibraryDirectories>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\dep\include\g3dlite;..\..\..\src\shared;..\..\..\src\game\vmap;..\..\..\src\framework;..\..\..\dep\ACE_wrappers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;NO_CORE_FUNCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>$(OutDir)vmap_assembler.exe</OutputFile>
|
||||
<IgnoreSpecificDefaultLibraries>
|
||||
</IgnoreSpecificDefaultLibraries>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(TargetName).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\..\..\dep\include\g3dlite;..\..\..\src\shared;..\..\..\src\game\vmap;..\..\..\src\framework;..\..\..\dep\ACE_wrappers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;NO_CORE_FUNCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>$(OutDir)vmap_assembler.exe</OutputFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\..\..\dep\include\g3dlite;..\..\..\src\shared;..\..\..\src\game\vmap;..\..\..\src\framework;..\..\..\dep\ACE_wrappers;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;NO_CORE_FUNCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>$(OutDir)vmap_assembler.exe</OutputFile>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\vmap_assembler.cpp" />
|
||||
<ClCompile Include="..\..\..\src\game\vmap\BIH.cpp" />
|
||||
<ClCompile Include="..\..\..\src\game\vmap\MapTree.cpp" />
|
||||
<ClCompile Include="..\..\..\src\game\vmap\ModelInstance.cpp" />
|
||||
<ClCompile Include="..\..\..\src\game\vmap\TileAssembler.cpp" />
|
||||
<ClCompile Include="..\..\..\src\game\vmap\VMapManager2.cpp" />
|
||||
<ClCompile Include="..\..\..\src\game\vmap\WorldModel.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\src\game\vmap\BIH.h" />
|
||||
<ClInclude Include="..\..\..\src\game\vmap\MapTree.h" />
|
||||
<ClInclude Include="..\..\..\src\game\vmap\ModelInstance.h" />
|
||||
<ClInclude Include="..\..\..\src\game\vmap\TileAssembler.h" />
|
||||
<ClInclude Include="..\..\..\src\game\vmap\VMapManager2.h" />
|
||||
<ClInclude Include="..\..\..\src\game\vmap\VMapTools.h" />
|
||||
<ClInclude Include="..\..\..\src\game\vmap\WorldModel.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\win\VC110\g3dlite.vcxproj">
|
||||
<Project>{8072769e-cf10-48bf-b9e1-12752a5dac6e}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\..\win\VC110\zlib.vcxproj">
|
||||
<Project>{8f1dea42-6a5b-4b62-839d-c141a7bfacf2}</Project>
|
||||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
The default files for ACE_LITE were amended in this commit: https://github.com/mangos/mangosDeps/commit/52e4c984dbca474f7a4353b444339067a95ea277
|
||||
|
||||
The same changes need to be reapplied if a new version is added.
|
||||
|
||||
The following two lines were amended to fix a connection bottleneck (especially on Linux):
|
||||
- ACE_DEFAULT_BACKLOG - Change 5 to 128 https://github.com/mangos/mangosDeps/blob/Rel21/acelite/ace/Default_Constants.h#L81
|
||||
- ACE_DEFAULT_ASYNCH_BACKLOG - Change 5 to 128 https://github.com/mangos/mangosDeps/blob/Rel21/acelite/ace/Default_Constants.h#L85
|
||||
|
||||
For MacOS X, the ACE_UINT64_TYPE should be defined as follows in `ace/config-macosx-leopard.h`
|
||||
```
|
||||
#define ACE_UINT64_TYPE unsigned long long
|
||||
```
|
||||
|
||||
To get Travis CI working with `macos10.12` and `xcode8.3`, the following changes should be made to `ace/config-macosx-yosemite.h`
|
||||
```diff
|
||||
#include "ace/config-macosx-mavericks.h"
|
||||
+#undef ACE_LACKS_CLOCKID_T
|
||||
+#undef ACE_LACKS_CLOCK_MONOTONIC
|
||||
+#undef ACE_LACKS_CLOCK_REALTIME
|
||||
```
|
||||
|
||||
March 7th, 2018 - To build ACE as static library, one has to add the following line to the global CMakeLists.txt
|
||||
```
|
||||
add_definitions(-DACE_AS_STATIC_LIBS)
|
||||
```
|
||||
|
|
@ -53,20 +53,12 @@ if(WIN32 AND MSVC)
|
|||
ALWAYS 0
|
||||
)
|
||||
elseif(UNIX)
|
||||
if(CMAKE_BUILD_TOOL MATCHES "/gmake")
|
||||
set(ACE_BUILD_TOOL gmake)
|
||||
else()
|
||||
set(ACE_BUILD_TOOL make)
|
||||
endif()
|
||||
|
||||
ExternalProject_Add(ACE_Project
|
||||
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}
|
||||
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
|
||||
DOWNLOAD_COMMAND ""
|
||||
CONFIGURE_COMMAND <SOURCE_DIR>/configure --prefix=<INSTALL_DIR> --disable-ssl
|
||||
BUILD_COMMAND ${ACE_BUILD_TOOL} -j2 # export arch="ia32" &&
|
||||
INSTALL_COMMAND ${ACE_BUILD_TOOL} install
|
||||
CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/configure --prefix=${CMAKE_INSTALL_PREFIX} --disable-ssl
|
||||
)
|
||||
else()
|
||||
message(FATAL_ERROR
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
#
|
||||
# This code is part of MaNGOS. Contributor & Copyright details are in AUTHORS/THANKS.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -14,7 +13,6 @@
|
|||
# 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
|
||||
#
|
||||
|
||||
if(NOT (TBB_USE_EXTERNAL OR USE_STD_MALLOC))
|
||||
add_subdirectory(tbb)
|
||||
|
|
|
|||
|
|
@ -1,58 +0,0 @@
|
|||
June 16, 2019
|
||||
- revert some ACE changes which badly affected threads in FreeBSD
|
||||
|
||||
May 27, 2019
|
||||
- fixed TomLib::Crypt build on VS
|
||||
- fixed Detour/Recast CMake configuration
|
||||
- assuring STATIC generation of libraries for ZLIB::ZLIB, BZIP2::BZIP2 and mpqlib
|
||||
|
||||
May 17,2019
|
||||
- removed useless files from ACE
|
||||
|
||||
May 15, 2019
|
||||
- added PCH support for ACE
|
||||
|
||||
May 10th, 2019
|
||||
- cleaned up libmpq
|
||||
- bzip2 version raised to 1.0.6
|
||||
- zlib version raised to 1.2.11
|
||||
- root CMakeLists.txt logic improved
|
||||
- revert some FreBSD patches
|
||||
|
||||
May 3rd, 2019
|
||||
- added missing sources to ACE CMakeLists.txt
|
||||
- fixed ACE_SIZE_T_FORMAT_SPECIFIER for FreeBSD
|
||||
- applied FreeBSD 12+ patches from ports collection to ACE
|
||||
|
||||
May 2nd, 2019
|
||||
- fixed a typo which prevented ACE to be built as static lib
|
||||
- added _WANT_SEMUN compiler definition for ACE when build on FreeBSD 12+
|
||||
- removed __fastcall attribute from G3D sources
|
||||
- removed redundant zlib and bzip2 sources from stormlib
|
||||
- added TomCrypt and TomMath as static libs for future removal of OpenSSL
|
||||
- changed CmakeLists.txt files to proper show header files on IDEs
|
||||
- removed mersenne source code
|
||||
|
||||
January 16th, 2019
|
||||
- ACE is built as static library by default.
|
||||
- Fixed ACE_HAS_CPP11/14 defines for compatibility with other compilers.
|
||||
- added support for FreeBSD on stormlib
|
||||
|
||||
March 7th, 2018
|
||||
- To build ACE as static library, one has to add the following line to the global CMakeLists.txt
|
||||
'add_definitions(-DACE_AS_STATIC_LIBS)'
|
||||
|
||||
2017 and older
|
||||
- The default files for ACE_LITE were amended in commit: https://github.com/mangos/mangosDeps/commit/52e4c984dbca474f7a4353b444339067a95ea277
|
||||
- The same changes need to be reapplied if a new version is added.
|
||||
- The following two lines were amended to fix a connection bottleneck (especially on Linux):
|
||||
ACE_DEFAULT_BACKLOG - Change 5 to 128 https://github.com/mangos/mangosDeps/blob/Rel21/acelite/ace/Default_Constants.h#L81
|
||||
ACE_DEFAULT_ASYNCH_BACKLOG - Change 5 to 128 https://github.com/mangos/mangosDeps/blob/Rel21/acelite/ace/Default_Constants.h#L85
|
||||
- For MacOS X, the ACE_UINT64_TYPE should be defined as follows in `ace/config-macosx-leopard.h`
|
||||
#define ACE_UINT64_TYPE unsigned long long
|
||||
- To get Travis CI working with `macos10.12` and `xcode8.3`, the following changes should be made to `ace/config-macosx-yosemite.h`
|
||||
#include "ace/config-macosx-mavericks.h"
|
||||
#undef ACE_LACKS_CLOCKID_T
|
||||
#undef ACE_LACKS_CLOCK_MONOTONIC
|
||||
#undef ACE_LACKS_CLOCK_REALTIME
|
||||
|
||||
|
|
@ -1,65 +0,0 @@
|
|||
<table border=0 cellpadding=0 cellspacing=0 valign='top'><tr>
|
||||
<td><a href='https://www.getmangos.eu' target='getmangos.eu'><img src='https://www.getmangos.eu/!assets_mangos/logo.png' border=0></a></td>
|
||||
<td valign='top'>
|
||||
<a href='https://www.getmangos.eu/forums/' target='getmangos.forum'><img src='/icons/FORUM.gif' border=0></a>
|
||||
<a href='https://www.getmangos.eu/wiki' target='getmangos.wiki'><img src='/icons/WIKI.gif' border=0></a>
|
||||
<a href='https://www.getmangos.eu/github-activity/' target='getmangos.activity'><img src='/icons/ACTIVITY.gif' border=0></a>
|
||||
<a href='https://www.getmangos.eu/bug-tracker/mangos-zero/' target='getmangos.tracker'><img src='/icons/TRACKER.gif' border=0></a>
|
||||
</td></tr></table>
|
||||
|
||||
Mangos Dependencies
|
||||
------------
|
||||
*Mangos* stands on the shoulders of well-known Open Source
|
||||
libraries, and a few awesome, but less known libraries to prevent us from
|
||||
inventing the wheel again.
|
||||
|
||||
*Please note that Linux and Mac OS X users should install packages using
|
||||
their systems package management instead of source packages.*
|
||||
|
||||
* **MySQL** / **PostgreSQL**: to store content, and user data, we rely on
|
||||
[MySQL][1]/[MariaDB][2] and [PostgreSQL][3] to handle data.
|
||||
* **ACE**: the [ADAPTIVE Communication Environment][4] aka. *ACE* provides us
|
||||
with a solid cross-platform framework for abstracting operating system
|
||||
specific details.
|
||||
* **Recast**: in order to create navigation data from the client's map files,
|
||||
we use [Recast][5] to do the dirty work. It provides functions for
|
||||
rendering, pathing, etc.
|
||||
* **G3D**: the [G3D][6] engine provides the basic framework for handling 3D
|
||||
data, and is used to handle basic map data.
|
||||
* **libmpq**: [libmpq][7] provides an abstraction layer for reading from the
|
||||
client's data files.
|
||||
* **Zlib**: [Zlib][12] ([Zlib for Windows][10]) provides compression algorithms
|
||||
used in both MPQ archive handling and the client/server protocol.
|
||||
* **Bzip2**: [Bzip2][13] ([Bzip2 for Windows][11]) provides compression
|
||||
algorithms used in MPQ archives.
|
||||
* **OpenSSL**: [OpenSSL][8] ([OpenSSL for Windows][14]) provides encryption
|
||||
algorithms used when authenticating clients.
|
||||
* **Lua**: [Lua 5.2][15] ([Lua 5.2 for Windows][16]) provides a convenient, fast
|
||||
scripting environment, which allows us to make live changes to scripted
|
||||
content.
|
||||
|
||||
*Recast*, *G3D* and *libmpq* are included in the *Mangos* distribution as
|
||||
we rely on specific versions. *libmpq* is to be replaced with *stormlib* shortly.
|
||||
|
||||
Optional dependencies
|
||||
---------------------
|
||||
|
||||
* **Doxygen**: if you want to export HTML or PDF formatted documentation for the
|
||||
*Mangos* API, you should install [Doxygen][9].
|
||||
|
||||
[1]: http://www.mysql.com/ "MySQL · The world's most popular open source database"
|
||||
[2]: http://www.mariadb.org/ "MariaDB · An enhanced, drop-in replacement for MySQL"
|
||||
[3]: http://www.postgresql.org/ "PostgreSQL · The world's most advanced open source database"
|
||||
[4]: http://www.cs.wustl.edu/~schmidt/ACE.html "ACE · The ADAPTIVE Communication Environment"
|
||||
[5]: http://github.com/memononen/recastnavigation "Recast · Navigation-mesh Toolset for Games"
|
||||
[6]: http://sourceforge.net/projects/g3d/ "G3D · G3D Innovation Engine"
|
||||
[7]: http://github.com/ge0rg/libmpq "libmpq · A library for reading data from MPQ archives"
|
||||
[8]: http://www.openssl.org/ "OpenSSL · The Open Source toolkit for SSL/TLS"
|
||||
[9]: http://www.stack.nl/~dimitri/doxygen/ "Doxygen · API documentation generator"
|
||||
[10]: http://gnuwin32.sourceforge.net/packages/zlib.htm "Zlib for Windows"
|
||||
[11]: http://gnuwin32.sourceforge.net/packages/bzip2.htm "Bzip2 for Windows"
|
||||
[12]: http://www.zlib.net/ "Zlib"
|
||||
[13]: http://www.bzip.org/ "Bzip2"
|
||||
[14]: http://slproweb.com/products/Win32OpenSSL.html "OpenSSL for Windows"
|
||||
[15]: http://www.lua.org/ "Lua"
|
||||
[16]: https://code.google.com/p/luaforwindows/ "Lua for Windows"
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 1999-2013 Ladislav Zezula
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
|
@ -1 +0,0 @@
|
|||
This is official repository for the StomLib library, an open-source project that can work with Blizzard MPQ archives.
|
||||
696
dep/StormLib/StormLib_vc110.vcxproj
Normal file
696
dep/StormLib/StormLib_vc110.vcxproj
Normal file
|
|
@ -0,0 +1,696 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="DebugAD|Win32">
|
||||
<Configuration>DebugAD</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="DebugAD|x64">
|
||||
<Configuration>DebugAD</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="DebugAS|Win32">
|
||||
<Configuration>DebugAS</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="DebugAS|x64">
|
||||
<Configuration>DebugAS</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="ReleaseAD|Win32">
|
||||
<Configuration>ReleaseAD</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="ReleaseAD|x64">
|
||||
<Configuration>ReleaseAD</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="ReleaseAS|Win32">
|
||||
<Configuration>ReleaseAS</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="ReleaseAS|x64">
|
||||
<Configuration>ReleaseAS</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>StormLib</ProjectName>
|
||||
<ProjectGuid>{78424708-1F6E-4D4B-920C-FB6D26847055}</ProjectGuid>
|
||||
<RootNamespace>StormLib</RootNamespace>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">./bin/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'" />
|
||||
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" />
|
||||
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'" />
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">$(ProjectName)RAS</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">$(ProjectName)DAD</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">$(ProjectName)DAS</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">$(ProjectName)RAD</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">$(ProjectName)DAD</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">$(ProjectName)DAS</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">$(ProjectName)RAD</TargetName>
|
||||
<TargetName Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">$(ProjectName)RAS</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level1</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Lib>
|
||||
<OutputFile>$(OutDir)$(ProjectName)DAD.lib</OutputFile>
|
||||
</Lib>
|
||||
<PostBuildEvent>
|
||||
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level1</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Lib>
|
||||
<OutputFile>$(OutDir)$(ProjectName)DAD.lib</OutputFile>
|
||||
</Lib>
|
||||
<PostBuildEvent>
|
||||
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level1</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Lib>
|
||||
<OutputFile>$(OutDir)$(ProjectName)DAS.lib</OutputFile>
|
||||
</Lib>
|
||||
<PostBuildEvent>
|
||||
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level1</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Lib>
|
||||
<OutputFile>$(OutDir)$(ProjectName)DAS.lib</OutputFile>
|
||||
</Lib>
|
||||
<PostBuildEvent>
|
||||
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level1</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Lib>
|
||||
<OutputFile>$(OutDir)$(ProjectName)RAD.lib</OutputFile>
|
||||
</Lib>
|
||||
<PostBuildEvent>
|
||||
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level1</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Lib>
|
||||
<OutputFile>$(OutDir)$(ProjectName)RAD.lib</OutputFile>
|
||||
</Lib>
|
||||
<PostBuildEvent>
|
||||
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level1</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Lib>
|
||||
<OutputFile>$(OutDir)$(ProjectName)RAS.lib</OutputFile>
|
||||
</Lib>
|
||||
<PostBuildEvent>
|
||||
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">
|
||||
<Midl>
|
||||
<TargetEnvironment>X64</TargetEnvironment>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level1</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Lib>
|
||||
<OutputFile>$(OutDir)$(ProjectName)RAS.lib</OutputFile>
|
||||
</Lib>
|
||||
<PostBuildEvent>
|
||||
<Command>StormLib.bat $(Platform) $(Configuration)</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include="doc\History.txt" />
|
||||
<None Include="doc\The MoPaQ File Format 0.9.txt" />
|
||||
<None Include="doc\The MoPaQ File Format 1.0.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="src\StormCommon.h" />
|
||||
<ClInclude Include="src\StormLib.h" />
|
||||
<ClInclude Include="src\StormPort.h" />
|
||||
<ClInclude Include="src\adpcm\adpcm.h" />
|
||||
<ClInclude Include="src\huffman\huff.h" />
|
||||
<ClInclude Include="src\pklib\pklib.h" />
|
||||
<ClInclude Include="src\sparse\sparse.h" />
|
||||
<ClInclude Include="src\jenkins\lookup.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="src\FileStream.cpp">
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\SBaseCommon.cpp">
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\SBaseFileTable.cpp">
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\SCompression.cpp">
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\SFileAddFile.cpp">
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\SFileAttributes.cpp">
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\SFileCompactArchive.cpp">
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\SFileCreateArchive.cpp">
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\SFileExtractFile.cpp">
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\SFileFindFile.cpp">
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\SFileListFile.cpp">
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\SFileOpenArchive.cpp">
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\SFileOpenFileEx.cpp">
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\SFilePatchArchives.cpp" />
|
||||
<ClCompile Include="src\SFileReadFile.cpp">
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\SFileVerify.cpp">
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='DebugAS|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAD|x64'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|Win32'">Level4</WarningLevel>
|
||||
<WarningLevel Condition="'$(Configuration)|$(Platform)'=='ReleaseAS|x64'">Level4</WarningLevel>
|
||||
</ClCompile>
|
||||
<ClCompile Include="src\adpcm\adpcm.cpp" />
|
||||
<ClCompile Include="src\bzip2\blocksort.c" />
|
||||
<ClCompile Include="src\bzip2\bzlib.c" />
|
||||
<ClCompile Include="src\bzip2\compress.c" />
|
||||
<ClCompile Include="src\bzip2\crctable.c" />
|
||||
<ClCompile Include="src\bzip2\decompress.c" />
|
||||
<ClCompile Include="src\bzip2\huffman.c" />
|
||||
<ClCompile Include="src\bzip2\randtable.c" />
|
||||
<ClCompile Include="src\huffman\huff.cpp" />
|
||||
<ClCompile Include="src\libtomcrypt\src\hashes\hash_memory.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\hashes\md5.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\hashes\sha1.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\math\ltm_desc.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\math\multi.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\math\rand_prime.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\misc\base64_decode.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\misc\crypt_argchk.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\misc\crypt_find_hash.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\misc\crypt_find_prng.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\misc\crypt_hash_descriptor.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\misc\crypt_hash_is_valid.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\misc\crypt_libc.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\misc\crypt_ltc_mp_descriptor.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\misc\crypt_prng_descriptor.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\misc\crypt_prng_is_valid.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\misc\crypt_register_hash.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\misc\crypt_register_prng.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\misc\zeromem.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_bit_string.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_boolean.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_choice.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_ia5_string.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_integer.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_object_identifier.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_octet_string.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_printable_string.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_ex.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_flexi.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_sequence_multi.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_short_integer.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_utctime.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_decode_utf8_string.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_bit_string.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_boolean.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_ia5_string.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_integer.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_object_identifier.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_octet_string.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_printable_string.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_sequence.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_short_integer.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_utctime.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_length_utf8_string.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\asn1\der_sequence_free.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_map.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_mul2add.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_mulmod.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_points.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_projective_add_point.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\ecc\ltc_ecc_projective_dbl_point.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_mgf1.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_oaep_decode.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_pss_decode.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\pkcs1\pkcs_1_v1_5_decode.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_exptmod.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_free.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_import.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_make_key.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_verify_hash.c" />
|
||||
<ClCompile Include="src\libtomcrypt\src\pk\rsa\rsa_verify_simple.c" />
|
||||
<ClCompile Include="src\libtommath\bn_fast_mp_invmod.c" />
|
||||
<ClCompile Include="src\libtommath\bn_fast_mp_montgomery_reduce.c" />
|
||||
<ClCompile Include="src\libtommath\bn_fast_s_mp_mul_digs.c" />
|
||||
<ClCompile Include="src\libtommath\bn_fast_s_mp_mul_high_digs.c" />
|
||||
<ClCompile Include="src\libtommath\bn_fast_s_mp_sqr.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_2expt.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_abs.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_add.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_add_d.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_addmod.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_and.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_clamp.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_clear.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_clear_multi.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_cmp.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_cmp_d.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_cmp_mag.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_cnt_lsb.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_copy.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_count_bits.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_div.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_div_2.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_div_2d.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_div_3.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_div_d.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_dr_is_modulus.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_dr_reduce.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_dr_setup.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_exch.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_expt_d.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_exptmod.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_exptmod_fast.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_exteuclid.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_fread.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_fwrite.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_gcd.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_get_int.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_grow.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_init.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_init_copy.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_init_multi.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_init_set.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_init_set_int.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_init_size.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_invmod.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_invmod_slow.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_is_square.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_jacobi.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_karatsuba_mul.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_karatsuba_sqr.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_lcm.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_lshd.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_mod.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_mod_2d.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_mod_d.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_montgomery_calc_normalization.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_montgomery_reduce.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_montgomery_setup.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_mul.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_mul_2.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_mul_2d.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_mul_d.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_mulmod.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_n_root.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_neg.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_or.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_prime_fermat.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_prime_is_divisible.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_prime_is_prime.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_prime_miller_rabin.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_prime_next_prime.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_prime_rabin_miller_trials.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_prime_random_ex.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_radix_size.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_radix_smap.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_rand.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_read_radix.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_read_signed_bin.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_read_unsigned_bin.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_reduce.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_reduce_2k.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_l.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_setup.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_reduce_2k_setup_l.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_reduce_is_2k.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_reduce_is_2k_l.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_reduce_setup.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_rshd.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_set.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_set_int.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_shrink.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_signed_bin_size.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_sqr.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_sqrmod.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_sqrt.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_sub.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_sub_d.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_submod.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_to_signed_bin.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_to_signed_bin_n.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_to_unsigned_bin.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_to_unsigned_bin_n.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_toom_mul.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_toom_sqr.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_toradix.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_toradix_n.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_unsigned_bin_size.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_xor.c" />
|
||||
<ClCompile Include="src\libtommath\bn_mp_zero.c" />
|
||||
<ClCompile Include="src\libtommath\bn_prime_tab.c" />
|
||||
<ClCompile Include="src\libtommath\bn_reverse.c" />
|
||||
<ClCompile Include="src\libtommath\bn_s_mp_add.c" />
|
||||
<ClCompile Include="src\libtommath\bn_s_mp_exptmod.c" />
|
||||
<ClCompile Include="src\libtommath\bn_s_mp_mul_digs.c" />
|
||||
<ClCompile Include="src\libtommath\bn_s_mp_mul_high_digs.c" />
|
||||
<ClCompile Include="src\libtommath\bn_s_mp_sqr.c" />
|
||||
<ClCompile Include="src\libtommath\bn_s_mp_sub.c" />
|
||||
<ClCompile Include="src\libtommath\bncore.c" />
|
||||
<ClCompile Include="src\lzma\C\LzFind.c" />
|
||||
<ClCompile Include="src\lzma\C\LzFindMt.c" />
|
||||
<ClCompile Include="src\lzma\C\LzmaDec.c" />
|
||||
<ClCompile Include="src\lzma\C\LzmaEnc.c" />
|
||||
<ClCompile Include="src\lzma\C\Threads.c" />
|
||||
<ClCompile Include="src\pklib\explode.c" />
|
||||
<ClCompile Include="src\pklib\implode.c" />
|
||||
<ClCompile Include="src\sparse\sparse.cpp" />
|
||||
<ClCompile Include="src\zlib\adler32.c" />
|
||||
<ClCompile Include="src\zlib\compress2.c" />
|
||||
<ClCompile Include="src\zlib\crc32.c" />
|
||||
<ClCompile Include="src\zlib\deflate.c" />
|
||||
<ClCompile Include="src\zlib\inffast.c" />
|
||||
<ClCompile Include="src\zlib\inflate.c" />
|
||||
<ClCompile Include="src\zlib\inftrees.c" />
|
||||
<ClCompile Include="src\zlib\trees.c" />
|
||||
<ClCompile Include="src\zlib\zutil.c" />
|
||||
<ClCompile Include="src\jenkins\lookup3.c" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
|
|
@ -1 +0,0 @@
|
|||
UCMXF6EJY352EFH4XFRXCFH2XC9MQRZK
|
||||
|
|
@ -1 +0,0 @@
|
|||
MMKVHY48RP7WXP4GHYBQ7SL9J9UNPHBP
|
||||
|
|
@ -1 +0,0 @@
|
|||
8MXLWHQ7VGGLTZ9MQZQSFDCLJYET3CPP
|
||||
|
|
@ -1 +0,0 @@
|
|||
EJ2R5TM6XFE2GUNG5QDGHKQ9UAKPWZSZ
|
||||
|
|
@ -1 +0,0 @@
|
|||
PBGFBE42Z6LNK65UGJQ3WZVMCLP4HQQT
|
||||
|
|
@ -1 +0,0 @@
|
|||
X7SEJJS9TSGCW5P28EBSC47AJPEY8VU2
|
||||
|
|
@ -1 +0,0 @@
|
|||
5KVBQA8VYE6XRY3DLGC5ZDE4XS4P7YA2
|
||||
|
|
@ -1 +0,0 @@
|
|||
478JD2K56EVNVVY4XX8TDWYT5B8KB254
|
||||
|
|
@ -1 +0,0 @@
|
|||
8TS4VNFQRZTN6YWHE9CHVDH9NVWD474A
|
||||
|
|
@ -1 +0,0 @@
|
|||
LJ52Z32DF4LZ4ZJJXVKK3AZQA6GABLJB
|
||||
|
|
@ -1 +0,0 @@
|
|||
K6BDHY2ECUE2545YKNLBJPVYWHE7XYAG
|
||||
|
|
@ -1 +0,0 @@
|
|||
6VWCQTN8V3ZZMRUCZXV8A8CGUX2TAA8H
|
||||
|
|
@ -1 +0,0 @@
|
|||
S48B6CDTN5XEQAKQDJNDLJBJ73FDFM3U
|
||||
|
|
@ -1 +0,0 @@
|
|||
Y45MD3CAK4KXSSXHYD9VY64Z8EKJ4XFX
|
||||
|
|
@ -1 +0,0 @@
|
|||
G8MN8UDG6NA2ANGY6A3DNY82HRGF29ZH
|
||||
|
|
@ -1 +0,0 @@
|
|||
3DH5RE5NVM5GTFD85LXGWT6FK859ETR5
|
||||
|
|
@ -1 +0,0 @@
|
|||
8WLKUAXE94PFQU4Y249PAZ24N4R4XKTQ
|
||||
|
|
@ -1 +0,0 @@
|
|||
A34DXX3VHGGXSQBRFE5UFFDXMF9G4G54
|
||||
|
|
@ -1 +0,0 @@
|
|||
ZG7J9K938HJEFWPQUA768MA2PFER6EAJ
|
||||
|
|
@ -1 +0,0 @@
|
|||
NE7CUNNNTVAPXV7E3G2BSVBWGVMW8BL2
|
||||
|
|
@ -1 +0,0 @@
|
|||
3V9E2FTMBM9QQWK7U6MAMWAZWQDB838F
|
||||
|
|
@ -1 +0,0 @@
|
|||
2NSFB8MELULJ83U6YHA3UP6K4MQD48L6
|
||||
|
|
@ -1 +0,0 @@
|
|||
QA2TZ9EWZ4CUU8BMB5WXCTY65F9CSW4E
|
||||
|
|
@ -1 +0,0 @@
|
|||
VHB378W64BAT9SH7D68VV9NLQDK9YEGT
|
||||
|
|
@ -1 +0,0 @@
|
|||
U3NFQJV4M6GC7KBN9XQJ3BRDN3PLD9NE
|
||||
|
|
@ -1,618 +0,0 @@
|
|||
/*****************************************************************************/
|
||||
/* SBaseSubTypes.cpp Copyright (c) Ladislav Zezula 2013 */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Conversion routines for archive formats that are similar to MPQ format */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Date Ver Who Comment */
|
||||
/* -------- ---- --- ------- */
|
||||
/* 02.11.11 1.00 Lad The first version of SBaseSubTypes.cpp */
|
||||
/*****************************************************************************/
|
||||
|
||||
#define __STORMLIB_SELF__
|
||||
#include "StormLib.h"
|
||||
#include "StormCommon.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* Support for SQP file format (War of the Immortals) */
|
||||
/* */
|
||||
/*****************************************************************************/
|
||||
|
||||
typedef struct _TSQPHeader
|
||||
{
|
||||
// The ID_MPQ ('MPQ\x1A') signature
|
||||
DWORD dwID;
|
||||
|
||||
// Size of the archive header
|
||||
DWORD dwHeaderSize;
|
||||
|
||||
// 32-bit size of MPQ archive
|
||||
DWORD dwArchiveSize;
|
||||
|
||||
// Offset to the beginning of the hash table, relative to the beginning of the archive.
|
||||
DWORD dwHashTablePos;
|
||||
|
||||
// Offset to the beginning of the block table, relative to the beginning of the archive.
|
||||
DWORD dwBlockTablePos;
|
||||
|
||||
// Number of entries in the hash table. Must be a power of two, and must be less than 2^16 for
|
||||
// the original MoPaQ format, or less than 2^20 for the Burning Crusade format.
|
||||
DWORD dwHashTableSize;
|
||||
|
||||
// Number of entries in the block table
|
||||
DWORD dwBlockTableSize;
|
||||
|
||||
// Must be zero for SQP files
|
||||
USHORT wFormatVersion;
|
||||
|
||||
// Power of two exponent specifying the number of 512-byte disk sectors in each file sector
|
||||
// in the archive. The size of each file sector in the archive is 512 * 2 ^ wSectorSize.
|
||||
USHORT wSectorSize;
|
||||
|
||||
} TSQPHeader;
|
||||
|
||||
typedef struct _TSQPHash
|
||||
{
|
||||
// Most likely the lcLocale+wPlatform.
|
||||
DWORD dwAlwaysZero;
|
||||
|
||||
// If the hash table entry is valid, this is the index into the block table of the file.
|
||||
// Otherwise, one of the following two values:
|
||||
// - FFFFFFFFh: Hash table entry is empty, and has always been empty.
|
||||
// Terminates searches for a given file.
|
||||
// - FFFFFFFEh: Hash table entry is empty, but was valid at some point (a deleted file).
|
||||
// Does not terminate searches for a given file.
|
||||
DWORD dwBlockIndex;
|
||||
|
||||
// The hash of the file path, using method A.
|
||||
DWORD dwName1;
|
||||
|
||||
// The hash of the file path, using method B.
|
||||
DWORD dwName2;
|
||||
|
||||
} TSQPHash;
|
||||
|
||||
typedef struct _TSQPBlock
|
||||
{
|
||||
// Offset of the beginning of the file, relative to the beginning of the archive.
|
||||
DWORD dwFilePos;
|
||||
|
||||
// Flags for the file. See MPQ_FILE_XXXX constants
|
||||
DWORD dwFlags;
|
||||
|
||||
// Compressed file size
|
||||
DWORD dwCSize;
|
||||
|
||||
// Uncompressed file size
|
||||
DWORD dwFSize;
|
||||
|
||||
} TSQPBlock;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Functions - SQP file format
|
||||
|
||||
// This function converts SQP file header into MPQ file header
|
||||
int ConvertSqpHeaderToFormat4(
|
||||
TMPQArchive * ha,
|
||||
ULONGLONG FileSize,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
TSQPHeader * pSqpHeader = (TSQPHeader *)ha->HeaderData;
|
||||
TMPQHeader Header;
|
||||
|
||||
// SQP files from War of the Immortal use MPQ file format with slightly
|
||||
// modified structure. These fields have different position:
|
||||
//
|
||||
// Offset TMPQHeader TSQPHeader
|
||||
// ------ ---------- -----------
|
||||
// 000C wFormatVersion dwHashTablePos (lo)
|
||||
// 000E wSectorSize dwHashTablePos (hi)
|
||||
// 001C dwBlockTableSize (lo) wBlockSize
|
||||
// 001E dwHashTableSize (hi) wFormatVersion
|
||||
|
||||
// Can't open the archive with certain flags
|
||||
if(dwFlags & MPQ_OPEN_FORCE_MPQ_V1)
|
||||
return ERROR_FILE_CORRUPT;
|
||||
|
||||
// The file must not be greater than 4 GB
|
||||
if((FileSize >> 0x20) != 0)
|
||||
return ERROR_FILE_CORRUPT;
|
||||
|
||||
// Translate the SQP header into a MPQ header
|
||||
memset(&Header, 0, sizeof(TMPQHeader));
|
||||
Header.dwID = BSWAP_INT32_UNSIGNED(pSqpHeader->dwID);
|
||||
Header.dwHeaderSize = BSWAP_INT32_UNSIGNED(pSqpHeader->dwHeaderSize);
|
||||
Header.dwArchiveSize = BSWAP_INT32_UNSIGNED(pSqpHeader->dwArchiveSize);
|
||||
Header.dwHashTablePos = BSWAP_INT32_UNSIGNED(pSqpHeader->dwHashTablePos);
|
||||
Header.dwBlockTablePos = BSWAP_INT32_UNSIGNED(pSqpHeader->dwBlockTablePos);
|
||||
Header.dwHashTableSize = BSWAP_INT32_UNSIGNED(pSqpHeader->dwHashTableSize);
|
||||
Header.dwBlockTableSize = BSWAP_INT32_UNSIGNED(pSqpHeader->dwBlockTableSize);
|
||||
Header.wFormatVersion = BSWAP_INT16_UNSIGNED(pSqpHeader->wFormatVersion);
|
||||
Header.wSectorSize = BSWAP_INT16_UNSIGNED(pSqpHeader->wSectorSize);
|
||||
|
||||
// Verify the SQP header
|
||||
if(Header.dwID == ID_MPQ && Header.dwHeaderSize == sizeof(TSQPHeader) && Header.dwArchiveSize == FileSize)
|
||||
{
|
||||
// Check for fixed values of version and sector size
|
||||
if(Header.wFormatVersion == MPQ_FORMAT_VERSION_1 && Header.wSectorSize == 3)
|
||||
{
|
||||
// Initialize the fields of 3.0 header
|
||||
Header.ArchiveSize64 = Header.dwArchiveSize;
|
||||
Header.HashTableSize64 = Header.dwHashTableSize * sizeof(TMPQHash);
|
||||
Header.BlockTableSize64 = Header.dwBlockTableSize * sizeof(TMPQBlock);
|
||||
|
||||
// Copy the converted MPQ header back
|
||||
memcpy(ha->HeaderData, &Header, sizeof(TMPQHeader));
|
||||
|
||||
// Mark this file as SQP file
|
||||
ha->pfnHashString = HashStringSlash;
|
||||
ha->dwFlags |= MPQ_FLAG_READ_ONLY;
|
||||
ha->dwSubType = MPQ_SUBTYPE_SQP;
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
return ERROR_FILE_CORRUPT;
|
||||
}
|
||||
|
||||
void * LoadSqpTable(TMPQArchive * ha, DWORD dwByteOffset, DWORD cbTableSize, DWORD dwKey)
|
||||
{
|
||||
ULONGLONG ByteOffset;
|
||||
LPBYTE pbSqpTable;
|
||||
|
||||
// Allocate buffer for the table
|
||||
pbSqpTable = STORM_ALLOC(BYTE, cbTableSize);
|
||||
if(pbSqpTable != NULL)
|
||||
{
|
||||
// Load the table
|
||||
ByteOffset = ha->MpqPos + dwByteOffset;
|
||||
if(FileStream_Read(ha->pStream, &ByteOffset, pbSqpTable, cbTableSize))
|
||||
{
|
||||
// Decrypt the SQP table
|
||||
DecryptMpqBlock(pbSqpTable, cbTableSize, dwKey);
|
||||
return pbSqpTable;
|
||||
}
|
||||
|
||||
// Free the table
|
||||
STORM_FREE(pbSqpTable);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
TMPQHash * LoadSqpHashTable(TMPQArchive * ha)
|
||||
{
|
||||
TMPQHeader * pHeader = ha->pHeader;
|
||||
TSQPHash * pSqpHashTable;
|
||||
TSQPHash * pSqpHashEnd;
|
||||
TSQPHash * pSqpHash;
|
||||
TMPQHash * pMpqHash;
|
||||
int nError = ERROR_SUCCESS;
|
||||
|
||||
// Load the hash table
|
||||
pSqpHashTable = (TSQPHash *)LoadSqpTable(ha, pHeader->dwHashTablePos, pHeader->dwHashTableSize * sizeof(TSQPHash), MPQ_KEY_HASH_TABLE);
|
||||
if(pSqpHashTable != NULL)
|
||||
{
|
||||
// Parse the entire hash table and convert it to MPQ hash table
|
||||
pSqpHashEnd = pSqpHashTable + pHeader->dwHashTableSize;
|
||||
pMpqHash = (TMPQHash *)pSqpHashTable;
|
||||
for(pSqpHash = pSqpHashTable; pSqpHash < pSqpHashEnd; pSqpHash++, pMpqHash++)
|
||||
{
|
||||
// Ignore free entries
|
||||
if(pSqpHash->dwBlockIndex != HASH_ENTRY_FREE)
|
||||
{
|
||||
// Check block index against the size of the block table
|
||||
if(pHeader->dwBlockTableSize <= MPQ_BLOCK_INDEX(pSqpHash) && pSqpHash->dwBlockIndex < HASH_ENTRY_DELETED)
|
||||
nError = ERROR_FILE_CORRUPT;
|
||||
|
||||
// We do not support nonzero locale and platform ID
|
||||
if(pSqpHash->dwAlwaysZero != 0 && pSqpHash->dwAlwaysZero != HASH_ENTRY_FREE)
|
||||
nError = ERROR_FILE_CORRUPT;
|
||||
|
||||
// Store the file name hash
|
||||
pMpqHash->dwName1 = pSqpHash->dwName1;
|
||||
pMpqHash->dwName2 = pSqpHash->dwName2;
|
||||
|
||||
// Store the rest. Note that this must be done last,
|
||||
// because block index corresponds to pMpqHash->dwName2
|
||||
pMpqHash->dwBlockIndex = MPQ_BLOCK_INDEX(pSqpHash);
|
||||
pMpqHash->Platform = 0;
|
||||
pMpqHash->lcLocale = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// If an error occured, we need to free the hash table
|
||||
if(nError != ERROR_SUCCESS)
|
||||
{
|
||||
STORM_FREE(pSqpHashTable);
|
||||
pSqpHashTable = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// Return the converted hash table (or NULL on failure)
|
||||
return (TMPQHash *)pSqpHashTable;
|
||||
}
|
||||
|
||||
// Loads the SQP Block table and converts it to a MPQ block table
|
||||
TMPQBlock * LoadSqpBlockTable(TMPQArchive * ha)
|
||||
{
|
||||
TMPQHeader * pHeader = ha->pHeader;
|
||||
TSQPBlock * pSqpBlockTable;
|
||||
TSQPBlock * pSqpBlockEnd;
|
||||
TSQPBlock * pSqpBlock;
|
||||
TMPQBlock * pMpqBlock;
|
||||
DWORD dwFlags;
|
||||
int nError = ERROR_SUCCESS;
|
||||
|
||||
// Load the hash table
|
||||
pSqpBlockTable = (TSQPBlock *)LoadSqpTable(ha, pHeader->dwBlockTablePos, pHeader->dwBlockTableSize * sizeof(TSQPBlock), MPQ_KEY_BLOCK_TABLE);
|
||||
if(pSqpBlockTable != NULL)
|
||||
{
|
||||
// Parse the entire hash table and convert it to MPQ hash table
|
||||
pSqpBlockEnd = pSqpBlockTable + pHeader->dwBlockTableSize;
|
||||
pMpqBlock = (TMPQBlock *)pSqpBlockTable;
|
||||
for(pSqpBlock = pSqpBlockTable; pSqpBlock < pSqpBlockEnd; pSqpBlock++, pMpqBlock++)
|
||||
{
|
||||
// Check for valid flags
|
||||
if(pSqpBlock->dwFlags & ~MPQ_FILE_VALID_FLAGS)
|
||||
nError = ERROR_FILE_CORRUPT;
|
||||
|
||||
// Convert SQP block table entry to MPQ block table entry
|
||||
dwFlags = pSqpBlock->dwFlags;
|
||||
pMpqBlock->dwCSize = pSqpBlock->dwCSize;
|
||||
pMpqBlock->dwFSize = pSqpBlock->dwFSize;
|
||||
pMpqBlock->dwFlags = dwFlags;
|
||||
}
|
||||
|
||||
// If an error occured, we need to free the hash table
|
||||
if(nError != ERROR_SUCCESS)
|
||||
{
|
||||
STORM_FREE(pSqpBlockTable);
|
||||
pSqpBlockTable = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// Return the converted hash table (or NULL on failure)
|
||||
return (TMPQBlock *)pSqpBlockTable;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* */
|
||||
/* Support for MPK file format (Longwu Online) */
|
||||
/* */
|
||||
/*****************************************************************************/
|
||||
|
||||
#define MPK_FILE_UNKNOWN_0001 0x00000001 // Seems to be always present
|
||||
#define MPK_FILE_UNKNOWN_0010 0x00000010 // Seems to be always present
|
||||
#define MPK_FILE_COMPRESSED 0x00000100 // Indicates a compressed file
|
||||
#define MPK_FILE_UNKNOWN_2000 0x00002000 // Seems to be always present
|
||||
#define MPK_FILE_EXISTS 0x01000000 // Seems to be always present
|
||||
|
||||
typedef struct _TMPKHeader
|
||||
{
|
||||
// The ID_MPK ('MPK\x1A') signature
|
||||
DWORD dwID;
|
||||
|
||||
// Contains '2000'
|
||||
DWORD dwVersion;
|
||||
|
||||
// 32-bit size of the archive
|
||||
DWORD dwArchiveSize;
|
||||
|
||||
// Size of the archive header
|
||||
DWORD dwHeaderSize;
|
||||
|
||||
DWORD dwHashTablePos;
|
||||
DWORD dwHashTableSize;
|
||||
DWORD dwBlockTablePos;
|
||||
DWORD dwBlockTableSize;
|
||||
DWORD dwUnknownPos;
|
||||
DWORD dwUnknownSize;
|
||||
} TMPKHeader;
|
||||
|
||||
|
||||
typedef struct _TMPKHash
|
||||
{
|
||||
// The hash of the file path, using method A.
|
||||
DWORD dwName1;
|
||||
|
||||
// The hash of the file path, using method B.
|
||||
DWORD dwName2;
|
||||
|
||||
// The hash of the file path, using method C.
|
||||
DWORD dwName3;
|
||||
|
||||
// If the hash table entry is valid, this is the index into the block table of the file.
|
||||
// Otherwise, one of the following two values:
|
||||
// - FFFFFFFFh: Hash table entry is empty, and has always been empty.
|
||||
// Terminates searches for a given file.
|
||||
// - FFFFFFFEh: Hash table entry is empty, but was valid at some point (a deleted file).
|
||||
// Does not terminate searches for a given file.
|
||||
DWORD dwBlockIndex;
|
||||
|
||||
} TMPKHash;
|
||||
|
||||
typedef struct _TMPKBlock
|
||||
{
|
||||
DWORD dwFlags; // 0x1121 - Compressed , 0x1120 - Not compressed
|
||||
DWORD dwFilePos; // Offset of the beginning of the file, relative to the beginning of the archive.
|
||||
DWORD dwFSize; // Uncompressed file size
|
||||
DWORD dwCSize; // Compressed file size
|
||||
DWORD dwUnknown; // 0x86364E6D
|
||||
} TMPKBlock;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Local variables - MPK file format
|
||||
|
||||
static const unsigned char MpkDecryptionKey[512] =
|
||||
{
|
||||
0x60, 0x20, 0x29, 0xE1, 0x01, 0xCE, 0xAA, 0xFE, 0xA3, 0xAB, 0x8E, 0x30, 0xAF, 0x02, 0xD1, 0x7D,
|
||||
0x41, 0x24, 0x06, 0xBD, 0xAE, 0xBE, 0x43, 0xC3, 0xBA, 0xB7, 0x08, 0x13, 0x51, 0xCF, 0xF8, 0xF7,
|
||||
0x25, 0x42, 0xA5, 0x4A, 0xDA, 0x0F, 0x52, 0x1C, 0x90, 0x3B, 0x63, 0x49, 0x36, 0xF6, 0xDD, 0x1B,
|
||||
0xEA, 0x58, 0xD4, 0x40, 0x70, 0x61, 0x55, 0x09, 0xCD, 0x0B, 0xA2, 0x4B, 0x68, 0x2C, 0x8A, 0xF1,
|
||||
0x3C, 0x3A, 0x65, 0xBB, 0xA1, 0xA8, 0x23, 0x97, 0xFD, 0x15, 0x00, 0x94, 0x88, 0x33, 0x59, 0xE9,
|
||||
0xFB, 0x69, 0x21, 0xEF, 0x85, 0x5B, 0x57, 0x6C, 0xFA, 0xB5, 0xEE, 0xB8, 0x71, 0xDC, 0xB1, 0x38,
|
||||
0x0C, 0x0A, 0x5C, 0x56, 0xC9, 0xB4, 0x84, 0x17, 0x1E, 0xE5, 0xD3, 0x5A, 0xCC, 0xFC, 0x11, 0x86,
|
||||
0x7F, 0x45, 0x4F, 0x54, 0xC8, 0x8D, 0x73, 0x89, 0x79, 0x5D, 0xB3, 0xBF, 0xB9, 0xE3, 0x93, 0xE4,
|
||||
0x6F, 0x35, 0x2D, 0x46, 0xF2, 0x76, 0xC5, 0x7E, 0xE2, 0xA4, 0xE6, 0xD9, 0x6E, 0x48, 0x34, 0x2B,
|
||||
0xC6, 0x5F, 0xBC, 0xA0, 0x6D, 0x0D, 0x47, 0x6B, 0x95, 0x96, 0x92, 0x91, 0xB2, 0x27, 0xEB, 0x9E,
|
||||
0xEC, 0x8F, 0xDF, 0x9C, 0x74, 0x99, 0x64, 0xF5, 0xFF, 0x28, 0xB6, 0x37, 0xF3, 0x7C, 0x81, 0x03,
|
||||
0x44, 0x62, 0x1F, 0xDB, 0x04, 0x7B, 0xB0, 0x9B, 0x31, 0xA7, 0xDE, 0x78, 0x9F, 0xAD, 0x0E, 0x3F,
|
||||
0x3E, 0x4D, 0xC7, 0xD7, 0x39, 0x19, 0x5E, 0xC2, 0xD0, 0xAC, 0xE8, 0x1A, 0x87, 0x8B, 0x07, 0x05,
|
||||
0x22, 0xED, 0x72, 0x2E, 0x1D, 0xC1, 0xA9, 0xD6, 0xE0, 0x83, 0xD5, 0xD8, 0xCB, 0x80, 0xF0, 0x66,
|
||||
0x7A, 0x9D, 0x50, 0xF9, 0x10, 0x4E, 0x16, 0x14, 0x77, 0x75, 0x6A, 0x67, 0xD2, 0xC0, 0xA6, 0xC4,
|
||||
0x53, 0x8C, 0x32, 0xCA, 0x82, 0x2A, 0x18, 0x9A, 0xF4, 0x4C, 0x3D, 0x26, 0x12, 0xE7, 0x98, 0x2F,
|
||||
0x4A, 0x04, 0x0D, 0xAF, 0xB4, 0xCF, 0x12, 0xCE, 0x1A, 0x37, 0x61, 0x39, 0x60, 0x95, 0xBE, 0x25,
|
||||
0xE4, 0x6E, 0xFC, 0x1B, 0xE7, 0x49, 0xE6, 0x67, 0xF6, 0xC5, 0xCB, 0x2F, 0x27, 0xD4, 0x68, 0xB2,
|
||||
0x01, 0x52, 0xD0, 0x46, 0x11, 0x20, 0xFB, 0x9D, 0xA9, 0x02, 0xF5, 0x8F, 0x3D, 0x82, 0xD3, 0xFF,
|
||||
0x0B, 0xB8, 0xF2, 0x4D, 0x8E, 0x81, 0x2C, 0xAB, 0x5F, 0xC4, 0x41, 0x29, 0x40, 0xFA, 0xC0, 0xBF,
|
||||
0x33, 0x10, 0x21, 0x16, 0xB0, 0x71, 0x83, 0x96, 0x8D, 0x2B, 0x23, 0x3B, 0xF9, 0xC1, 0xE5, 0x72,
|
||||
0xE2, 0x1C, 0x26, 0xF0, 0x73, 0x36, 0x63, 0x56, 0x31, 0x4E, 0x6B, 0x55, 0x62, 0x79, 0xC6, 0x91,
|
||||
0x00, 0x35, 0xB1, 0x2A, 0xA6, 0x42, 0xDF, 0xEB, 0x3C, 0x51, 0xEA, 0x97, 0x57, 0x94, 0x8C, 0x80,
|
||||
0x34, 0x5C, 0xD2, 0x76, 0xA4, 0xE9, 0x85, 0xE8, 0xBB, 0x78, 0xE0, 0xB5, 0xAD, 0x0F, 0x87, 0x70,
|
||||
0xDD, 0xAE, 0xF4, 0xD9, 0x66, 0x54, 0x6F, 0xCC, 0x4C, 0x77, 0x3E, 0xCD, 0xF1, 0x75, 0x0A, 0xA1,
|
||||
0x28, 0x9B, 0x9A, 0x7E, 0x4B, 0x98, 0x99, 0x47, 0xFE, 0xA5, 0xF7, 0xB7, 0xA3, 0xE1, 0x9F, 0xBC,
|
||||
0x93, 0x44, 0x3A, 0x08, 0x89, 0x22, 0xEE, 0xB9, 0x45, 0xD6, 0x06, 0x09, 0xC9, 0xBD, 0x14, 0x0C,
|
||||
0xB6, 0x5E, 0x9C, 0x7A, 0x65, 0x59, 0xAA, 0x19, 0x5B, 0x7C, 0x18, 0x43, 0x92, 0x13, 0x15, 0x7B,
|
||||
0xED, 0xD5, 0xC7, 0x17, 0xEF, 0x86, 0x90, 0xC2, 0x74, 0x64, 0xF3, 0xDC, 0x6C, 0x38, 0x05, 0x1D,
|
||||
0xC8, 0x0E, 0xEC, 0x6A, 0x32, 0xDA, 0xD7, 0xC3, 0xDB, 0x8B, 0x24, 0xB3, 0x5D, 0x2E, 0xBA, 0xA2,
|
||||
0xD8, 0x03, 0x88, 0x7D, 0x7F, 0x69, 0x8A, 0xFD, 0xCA, 0x4F, 0x30, 0x9E, 0xA0, 0xD1, 0x5A, 0x53,
|
||||
0xDE, 0x3F, 0x84, 0xAC, 0xF8, 0xA7, 0x2D, 0x1F, 0x1E, 0xE3, 0x58, 0x50, 0x6D, 0x48, 0x07, 0xA8
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Functions - MPK file format
|
||||
|
||||
// This function converts MPK file header into MPQ file header
|
||||
int ConvertMpkHeaderToFormat4(
|
||||
TMPQArchive * ha,
|
||||
ULONGLONG FileSize,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
TMPKHeader * pMpkHeader = (TMPKHeader *)ha->HeaderData;
|
||||
TMPQHeader Header;
|
||||
|
||||
// Can't open the archive with certain flags
|
||||
if(dwFlags & MPQ_OPEN_FORCE_MPQ_V1)
|
||||
return ERROR_FILE_CORRUPT;
|
||||
|
||||
// Translate the MPK header into a MPQ header
|
||||
// Note: Hash table size and block table size are in bytes, not in entries
|
||||
memset(&Header, 0, sizeof(TMPQHeader));
|
||||
Header.dwID = BSWAP_INT32_UNSIGNED(pMpkHeader->dwID);
|
||||
Header.dwArchiveSize = BSWAP_INT32_UNSIGNED(pMpkHeader->dwArchiveSize);
|
||||
Header.dwHeaderSize = BSWAP_INT32_UNSIGNED(pMpkHeader->dwHeaderSize);
|
||||
Header.dwHashTablePos = BSWAP_INT32_UNSIGNED(pMpkHeader->dwHashTablePos);
|
||||
Header.dwHashTableSize = BSWAP_INT32_UNSIGNED(pMpkHeader->dwHashTableSize) / sizeof(TMPKHash);
|
||||
Header.dwBlockTablePos = BSWAP_INT32_UNSIGNED(pMpkHeader->dwBlockTablePos);
|
||||
Header.dwBlockTableSize = BSWAP_INT32_UNSIGNED(pMpkHeader->dwBlockTableSize) / sizeof(TMPKBlock);
|
||||
// Header.dwUnknownPos = BSWAP_INT32_UNSIGNED(pMpkHeader->dwUnknownPos);
|
||||
// Header.dwUnknownSize = BSWAP_INT32_UNSIGNED(pMpkHeader->dwUnknownSize);
|
||||
assert(Header.dwHeaderSize == sizeof(TMPKHeader));
|
||||
|
||||
// Verify the MPK header
|
||||
if(Header.dwID == ID_MPK && Header.dwHeaderSize == sizeof(TMPKHeader) && Header.dwArchiveSize == (DWORD)FileSize)
|
||||
{
|
||||
// The header ID must be ID_MPQ
|
||||
Header.dwID = ID_MPQ;
|
||||
Header.wFormatVersion = MPQ_FORMAT_VERSION_1;
|
||||
Header.wSectorSize = 3;
|
||||
|
||||
// Initialize the fields of 3.0 header
|
||||
Header.ArchiveSize64 = Header.dwArchiveSize;
|
||||
Header.HashTableSize64 = Header.dwHashTableSize * sizeof(TMPQHash);
|
||||
Header.BlockTableSize64 = Header.dwBlockTableSize * sizeof(TMPQBlock);
|
||||
|
||||
// Copy the converted MPQ header back
|
||||
memcpy(ha->HeaderData, &Header, sizeof(TMPQHeader));
|
||||
|
||||
// Mark this file as MPK file
|
||||
ha->pfnHashString = HashStringLower;
|
||||
ha->dwFlags |= MPQ_FLAG_READ_ONLY;
|
||||
ha->dwSubType = MPQ_SUBTYPE_MPK;
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
return ERROR_FILE_CORRUPT;
|
||||
}
|
||||
|
||||
// Attempts to search a free hash entry in the hash table being converted.
|
||||
// The created hash table must always be of nonzero size,
|
||||
// should have no duplicated items and no deleted entries
|
||||
TMPQHash * FindFreeHashEntry(TMPQHash * pHashTable, DWORD dwHashTableSize, DWORD dwStartIndex)
|
||||
{
|
||||
TMPQHash * pHash;
|
||||
DWORD dwIndex;
|
||||
|
||||
// Set the initial index
|
||||
dwStartIndex = dwIndex = (dwStartIndex & (dwHashTableSize - 1));
|
||||
assert(dwHashTableSize != 0);
|
||||
|
||||
// Search the hash table and return the found entries in the following priority:
|
||||
for(;;)
|
||||
{
|
||||
// We are not expecting to find matching entry in the hash table being built
|
||||
// We are not expecting to find deleted entry either
|
||||
pHash = pHashTable + dwIndex;
|
||||
|
||||
// If we found a free entry, we need to stop searching
|
||||
if(pHash->dwBlockIndex == HASH_ENTRY_FREE)
|
||||
return pHash;
|
||||
|
||||
// Move to the next hash entry.
|
||||
// If we reached the starting entry, it's failure.
|
||||
dwIndex = (dwIndex + 1) & (dwHashTableSize - 1);
|
||||
if(dwIndex == dwStartIndex)
|
||||
break;
|
||||
}
|
||||
|
||||
// We haven't found anything
|
||||
assert(false);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void DecryptMpkTable(void * pvMpkTable, size_t cbSize)
|
||||
{
|
||||
LPBYTE pbMpkTable = (LPBYTE)pvMpkTable;
|
||||
|
||||
for(size_t i = 0; i < cbSize; i++)
|
||||
pbMpkTable[i] = MpkDecryptionKey[pbMpkTable[i]];
|
||||
}
|
||||
|
||||
void * LoadMpkTable(TMPQArchive * ha, DWORD dwByteOffset, DWORD cbTableSize)
|
||||
{
|
||||
ULONGLONG ByteOffset;
|
||||
LPBYTE pbMpkTable = NULL;
|
||||
|
||||
// Allocate space for the table
|
||||
pbMpkTable = STORM_ALLOC(BYTE, cbTableSize);
|
||||
if(pbMpkTable != NULL)
|
||||
{
|
||||
// Load and the MPK hash table
|
||||
ByteOffset = ha->MpqPos + dwByteOffset;
|
||||
if(FileStream_Read(ha->pStream, &ByteOffset, pbMpkTable, cbTableSize))
|
||||
{
|
||||
// Decrypt the table
|
||||
DecryptMpkTable(pbMpkTable, cbTableSize);
|
||||
return pbMpkTable;
|
||||
}
|
||||
|
||||
// Free the MPK table
|
||||
STORM_FREE(pbMpkTable);
|
||||
pbMpkTable = NULL;
|
||||
}
|
||||
|
||||
// Return the table
|
||||
return pbMpkTable;
|
||||
}
|
||||
|
||||
TMPQHash * LoadMpkHashTable(TMPQArchive * ha)
|
||||
{
|
||||
TMPQHeader * pHeader = ha->pHeader;
|
||||
TMPQHash * pHashTable = NULL;
|
||||
TMPKHash * pMpkHash;
|
||||
TMPQHash * pHash = NULL;
|
||||
DWORD dwHashTableSize = pHeader->dwHashTableSize;
|
||||
|
||||
// MPKs use different hash table searching.
|
||||
// Instead of using MPQ_HASH_TABLE_INDEX hash as index,
|
||||
// they store the value directly in the hash table.
|
||||
// Also for faster searching, the hash table is sorted ascending by the value
|
||||
|
||||
// Load and decrypt the MPK hash table.
|
||||
pMpkHash = (TMPKHash *)LoadMpkTable(ha, pHeader->dwHashTablePos, pHeader->dwHashTableSize * sizeof(TMPKHash));
|
||||
if(pMpkHash != NULL)
|
||||
{
|
||||
// Calculate the hash table size as if it was real MPQ hash table
|
||||
pHeader->dwHashTableSize = GetNearestPowerOfTwo(pHeader->dwHashTableSize);
|
||||
pHeader->HashTableSize64 = pHeader->dwHashTableSize * sizeof(TMPQHash);
|
||||
|
||||
// Now allocate table that will serve like a true MPQ hash table,
|
||||
// so we translate the MPK hash table to MPQ hash table
|
||||
pHashTable = STORM_ALLOC(TMPQHash, pHeader->dwHashTableSize);
|
||||
if(pHashTable != NULL)
|
||||
{
|
||||
// Set the entire hash table to free
|
||||
memset(pHashTable, 0xFF, (size_t)pHeader->HashTableSize64);
|
||||
|
||||
// Copy the MPK hash table into MPQ hash table
|
||||
for(DWORD i = 0; i < dwHashTableSize; i++)
|
||||
{
|
||||
// Finds the free hash entry in the hash table
|
||||
// We don't expect any errors here, because we are putting files to empty hash table
|
||||
pHash = FindFreeHashEntry(pHashTable, pHeader->dwHashTableSize, pMpkHash[i].dwName1);
|
||||
assert(pHash->dwBlockIndex == HASH_ENTRY_FREE);
|
||||
|
||||
// Copy the MPK hash entry to the hash table
|
||||
pHash->dwBlockIndex = pMpkHash[i].dwBlockIndex;
|
||||
pHash->Platform = 0;
|
||||
pHash->lcLocale = 0;
|
||||
pHash->dwName1 = pMpkHash[i].dwName2;
|
||||
pHash->dwName2 = pMpkHash[i].dwName3;
|
||||
}
|
||||
}
|
||||
|
||||
// Free the temporary hash table
|
||||
STORM_FREE(pMpkHash);
|
||||
}
|
||||
|
||||
return pHashTable;
|
||||
}
|
||||
|
||||
static DWORD ConvertMpkFlagsToMpqFlags(DWORD dwMpkFlags)
|
||||
{
|
||||
DWORD dwMpqFlags = MPQ_FILE_EXISTS;
|
||||
|
||||
// Check for flags that are always present
|
||||
assert((dwMpkFlags & MPK_FILE_UNKNOWN_0001) != 0);
|
||||
assert((dwMpkFlags & MPK_FILE_UNKNOWN_0010) != 0);
|
||||
assert((dwMpkFlags & MPK_FILE_UNKNOWN_2000) != 0);
|
||||
assert((dwMpkFlags & MPK_FILE_EXISTS) != 0);
|
||||
|
||||
// Append the compressed flag
|
||||
dwMpqFlags |= (dwMpkFlags & MPK_FILE_COMPRESSED) ? MPQ_FILE_COMPRESS : 0;
|
||||
|
||||
// All files in the MPQ seem to be single unit files
|
||||
dwMpqFlags |= MPQ_FILE_ENCRYPTED | MPQ_FILE_SINGLE_UNIT;
|
||||
|
||||
return dwMpqFlags;
|
||||
}
|
||||
|
||||
TMPQBlock * LoadMpkBlockTable(TMPQArchive * ha)
|
||||
{
|
||||
TMPQHeader * pHeader = ha->pHeader;
|
||||
TMPKBlock * pMpkBlockTable;
|
||||
TMPKBlock * pMpkBlockEnd;
|
||||
TMPQBlock * pBlockTable = NULL;
|
||||
TMPKBlock * pMpkBlock;
|
||||
TMPQBlock * pMpqBlock;
|
||||
|
||||
// Load and decrypt the MPK block table
|
||||
pMpkBlockTable = pMpkBlock = (TMPKBlock *)LoadMpkTable(ha, pHeader->dwBlockTablePos, pHeader->dwBlockTableSize * sizeof(TMPKBlock));
|
||||
if(pMpkBlockTable != NULL)
|
||||
{
|
||||
// Allocate buffer for MPQ-like block table
|
||||
pBlockTable = pMpqBlock = STORM_ALLOC(TMPQBlock, pHeader->dwBlockTableSize);
|
||||
if(pBlockTable != NULL)
|
||||
{
|
||||
// Convert the MPK block table to MPQ block table
|
||||
pMpkBlockEnd = pMpkBlockTable + pHeader->dwBlockTableSize;
|
||||
while(pMpkBlock < pMpkBlockEnd)
|
||||
{
|
||||
// Translate the MPK block table entry to MPQ block table entry
|
||||
pMpqBlock->dwFilePos = pMpkBlock->dwFilePos;
|
||||
pMpqBlock->dwCSize = pMpkBlock->dwCSize;
|
||||
pMpqBlock->dwFSize = pMpkBlock->dwFSize;
|
||||
pMpqBlock->dwFlags = ConvertMpkFlagsToMpqFlags(pMpkBlock->dwFlags);
|
||||
|
||||
// Move both
|
||||
pMpkBlock++;
|
||||
pMpqBlock++;
|
||||
}
|
||||
}
|
||||
|
||||
// Free the MPK block table
|
||||
STORM_FREE(pMpkBlockTable);
|
||||
}
|
||||
|
||||
return pBlockTable;
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,358 +0,0 @@
|
|||
/*****************************************************************************/
|
||||
/* adpcm.cpp Copyright (c) Ladislav Zezula 2003 */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* This module contains implementation of adpcm decompression method used by */
|
||||
/* Storm.dll to decompress WAVE files. Thanks to Tom Amigo for releasing */
|
||||
/* his sources. */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Date Ver Who Comment */
|
||||
/* -------- ---- --- ------- */
|
||||
/* 11.03.03 1.00 Lad Splitted from Pkware.cpp */
|
||||
/* 20.05.03 2.00 Lad Added compression */
|
||||
/* 19.11.03 2.01 Dan Big endian handling */
|
||||
/*****************************************************************************/
|
||||
|
||||
#include "adpcm.h"
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Structures
|
||||
|
||||
typedef union _BYTE_AND_WORD_PTR
|
||||
{
|
||||
short * pw;
|
||||
unsigned char * pb;
|
||||
} BYTE_AND_WORD_PTR;
|
||||
|
||||
typedef union _WORD_AND_BYTE_ARRAY
|
||||
{
|
||||
short w;
|
||||
unsigned char b[2];
|
||||
} WORD_AND_BYTE_ARRAY;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Tables necessary dor decompression
|
||||
|
||||
static long Table1503F120[] =
|
||||
{
|
||||
0xFFFFFFFF, 0x00000000, 0xFFFFFFFF, 0x00000004, 0xFFFFFFFF, 0x00000002, 0xFFFFFFFF, 0x00000006,
|
||||
0xFFFFFFFF, 0x00000001, 0xFFFFFFFF, 0x00000005, 0xFFFFFFFF, 0x00000003, 0xFFFFFFFF, 0x00000007,
|
||||
0xFFFFFFFF, 0x00000001, 0xFFFFFFFF, 0x00000005, 0xFFFFFFFF, 0x00000003, 0xFFFFFFFF, 0x00000007,
|
||||
0xFFFFFFFF, 0x00000002, 0xFFFFFFFF, 0x00000004, 0xFFFFFFFF, 0x00000006, 0xFFFFFFFF, 0x00000008
|
||||
};
|
||||
|
||||
static long step_table[] =
|
||||
{
|
||||
0x00000007, 0x00000008, 0x00000009, 0x0000000A, 0x0000000B, 0x0000000C, 0x0000000D, 0x0000000E,
|
||||
0x00000010, 0x00000011, 0x00000013, 0x00000015, 0x00000017, 0x00000019, 0x0000001C, 0x0000001F,
|
||||
0x00000022, 0x00000025, 0x00000029, 0x0000002D, 0x00000032, 0x00000037, 0x0000003C, 0x00000042,
|
||||
0x00000049, 0x00000050, 0x00000058, 0x00000061, 0x0000006B, 0x00000076, 0x00000082, 0x0000008F,
|
||||
0x0000009D, 0x000000AD, 0x000000BE, 0x000000D1, 0x000000E6, 0x000000FD, 0x00000117, 0x00000133,
|
||||
0x00000151, 0x00000173, 0x00000198, 0x000001C1, 0x000001EE, 0x00000220, 0x00000256, 0x00000292,
|
||||
0x000002D4, 0x0000031C, 0x0000036C, 0x000003C3, 0x00000424, 0x0000048E, 0x00000502, 0x00000583,
|
||||
0x00000610, 0x000006AB, 0x00000756, 0x00000812, 0x000008E0, 0x000009C3, 0x00000ABD, 0x00000BD0,
|
||||
0x00000CFF, 0x00000E4C, 0x00000FBA, 0x0000114C, 0x00001307, 0x000014EE, 0x00001706, 0x00001954,
|
||||
0x00001BDC, 0x00001EA5, 0x000021B6, 0x00002515, 0x000028CA, 0x00002CDF, 0x0000315B, 0x0000364B,
|
||||
0x00003BB9, 0x000041B2, 0x00004844, 0x00004F7E, 0x00005771, 0x0000602F, 0x000069CE, 0x00007462,
|
||||
0x00007FFF
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// CompressWave
|
||||
|
||||
// 1500EF70
|
||||
int CompressADPCM(unsigned char * pbOutBuffer, int dwOutLength, short * pwInBuffer, int dwInLength, int nChannels, int nCmpLevel)
|
||||
// ECX EDX
|
||||
{
|
||||
WORD_AND_BYTE_ARRAY Wcmp;
|
||||
BYTE_AND_WORD_PTR out; // Pointer to the output buffer
|
||||
long SInt32Array1[2];
|
||||
long SInt32Array2[2];
|
||||
long SInt32Array3[2];
|
||||
long nBytesRemains = dwOutLength; // Number of bytes remaining
|
||||
long nWordsRemains; // Number of words remaining
|
||||
// unsigned char * pbSaveOutBuffer; // Copy of output buffer (actually not used)
|
||||
unsigned long dwBitBuff;
|
||||
unsigned long dwStopBit;
|
||||
unsigned long dwBit;
|
||||
unsigned long ebx;
|
||||
unsigned long esi;
|
||||
long nTableValue;
|
||||
long nOneWord;
|
||||
long var_1C;
|
||||
long var_2C;
|
||||
int nLength;
|
||||
int nIndex;
|
||||
int nValue;
|
||||
int i, chnl;
|
||||
|
||||
// If less than 2 bytes remain, don't decompress anything
|
||||
// pbSaveOutBuffer = pbOutBuffer;
|
||||
out.pb = pbOutBuffer;
|
||||
if(nBytesRemains < 2)
|
||||
return 2;
|
||||
|
||||
Wcmp.b[1] = (unsigned char)(nCmpLevel - 1);
|
||||
Wcmp.b[0] = (unsigned char)0;
|
||||
|
||||
*out.pw++ = BSWAP_INT16_SIGNED(Wcmp.w);
|
||||
if((out.pb - pbOutBuffer + (nChannels * 2)) > nBytesRemains)
|
||||
return (int)(out.pb - pbOutBuffer + (nChannels * 2));
|
||||
|
||||
SInt32Array1[0] = SInt32Array1[1] = 0x2C;
|
||||
|
||||
for(i = 0; i < nChannels; i++)
|
||||
{
|
||||
nOneWord = BSWAP_INT16_SIGNED(*pwInBuffer++);
|
||||
*out.pw++ = BSWAP_INT16_SIGNED((short)nOneWord);
|
||||
SInt32Array2[i] = nOneWord;
|
||||
}
|
||||
|
||||
// Weird. But it's there
|
||||
nLength = dwInLength;
|
||||
if(nLength < 0) // mov eax, dwInLength; cdq; sub eax, edx;
|
||||
nLength++;
|
||||
|
||||
nLength = (nLength / 2) - (int)(out.pb - pbOutBuffer);
|
||||
nLength = (nLength < 0) ? 0 : nLength;
|
||||
|
||||
nIndex = nChannels - 1; // edi
|
||||
nWordsRemains = dwInLength / 2; // eax
|
||||
|
||||
// ebx - nChannels
|
||||
// ecx - pwOutPos
|
||||
for(chnl = nChannels; chnl < nWordsRemains; chnl++)
|
||||
{
|
||||
// 1500F030
|
||||
if((out.pb - pbOutBuffer + 2) > nBytesRemains)
|
||||
return (int)(out.pb - pbOutBuffer + 2);
|
||||
|
||||
// Switch index
|
||||
if(nChannels == 2)
|
||||
nIndex = (nIndex == 0) ? 1 : 0;
|
||||
|
||||
// Load one word from the input stream
|
||||
nOneWord = BSWAP_INT16_SIGNED(*pwInBuffer++); // ecx - nOneWord
|
||||
SInt32Array3[nIndex] = nOneWord;
|
||||
|
||||
// esi - SInt32Array2[nIndex]
|
||||
// eax - nValue
|
||||
nValue = nOneWord - SInt32Array2[nIndex];
|
||||
nValue = (nValue < 0) ? ((nValue ^ 0xFFFFFFFF) + 1) : nValue;
|
||||
|
||||
ebx = (nOneWord >= SInt32Array2[nIndex]) ? 0 : 0x40;
|
||||
|
||||
// esi - SInt32Array2[nIndex]
|
||||
// edx - step_table[SInt32Array2[nIndex]]
|
||||
// edi - (step_table[SInt32Array1[nIndex]] >> nCmpLevel)
|
||||
nTableValue = step_table[SInt32Array1[nIndex]];
|
||||
dwStopBit = (unsigned long)nCmpLevel;
|
||||
|
||||
// edi - nIndex;
|
||||
if(nValue < (nTableValue >> nCmpLevel))
|
||||
{
|
||||
if(SInt32Array1[nIndex] != 0)
|
||||
SInt32Array1[nIndex]--;
|
||||
*out.pb++ = 0x80;
|
||||
}
|
||||
else
|
||||
{
|
||||
while(nValue > nTableValue * 2)
|
||||
{
|
||||
if(SInt32Array1[nIndex] >= 0x58 || nLength == 0)
|
||||
break;
|
||||
|
||||
SInt32Array1[nIndex] += 8;
|
||||
if(SInt32Array1[nIndex] > 0x58)
|
||||
SInt32Array1[nIndex] = 0x58;
|
||||
|
||||
nTableValue = step_table[SInt32Array1[nIndex]];
|
||||
*out.pb++ = 0x81;
|
||||
nLength--;
|
||||
}
|
||||
|
||||
var_2C = nTableValue >> Wcmp.b[1];
|
||||
dwBitBuff = 0;
|
||||
|
||||
esi = (1 << (dwStopBit - 2));
|
||||
dwStopBit = (esi <= 0x20) ? esi : 0x20;
|
||||
|
||||
for(var_1C = 0, dwBit = 1; ; dwBit <<= 1)
|
||||
{
|
||||
// esi = var_1C + nTableValue;
|
||||
if((var_1C + nTableValue) <= nValue)
|
||||
{
|
||||
var_1C += nTableValue;
|
||||
dwBitBuff |= dwBit;
|
||||
}
|
||||
if(dwBit == dwStopBit)
|
||||
break;
|
||||
|
||||
nTableValue >>= 1;
|
||||
}
|
||||
|
||||
nValue = SInt32Array2[nIndex];
|
||||
if(ebx != 0)
|
||||
{
|
||||
nValue -= (var_1C + var_2C);
|
||||
if(nValue < -32768)
|
||||
nValue = -32768;
|
||||
}
|
||||
else
|
||||
{
|
||||
nValue += (var_1C + var_2C);
|
||||
if(nValue > 32767)
|
||||
nValue = 32767;
|
||||
}
|
||||
|
||||
SInt32Array2[nIndex] = nValue;
|
||||
*out.pb++ = (unsigned char)(dwBitBuff | ebx);
|
||||
nTableValue = Table1503F120[dwBitBuff & 0x1F];
|
||||
SInt32Array1[nIndex] = SInt32Array1[nIndex] + nTableValue;
|
||||
if(SInt32Array1[nIndex] < 0)
|
||||
SInt32Array1[nIndex] = 0;
|
||||
else if(SInt32Array1[nIndex] > 0x58)
|
||||
SInt32Array1[nIndex] = 0x58;
|
||||
}
|
||||
}
|
||||
|
||||
return (int)(out.pb - pbOutBuffer);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// DecompressADPCM
|
||||
|
||||
// 1500F230
|
||||
int DecompressADPCM(unsigned char * pbOutBuffer, int dwOutLength, unsigned char * pbInBuffer, int dwInLength, int nChannels)
|
||||
{
|
||||
BYTE_AND_WORD_PTR out; // Output buffer
|
||||
BYTE_AND_WORD_PTR in;
|
||||
unsigned char * pbInBufferEnd = (pbInBuffer + dwInLength);
|
||||
long SInt32Array1[2];
|
||||
long SInt32Array2[2];
|
||||
long nOneWord;
|
||||
int nIndex;
|
||||
int i;
|
||||
|
||||
SInt32Array1[0] = SInt32Array1[1] = 0x2C;
|
||||
out.pb = pbOutBuffer;
|
||||
in.pb = pbInBuffer;
|
||||
in.pw++;
|
||||
|
||||
// Fill the Uint32Array2 array by channel values.
|
||||
for(i = 0; i < nChannels; i++)
|
||||
{
|
||||
nOneWord = BSWAP_INT16_SIGNED(*in.pw++);
|
||||
SInt32Array2[i] = nOneWord;
|
||||
if(dwOutLength < 2)
|
||||
return (int)(out.pb - pbOutBuffer);
|
||||
|
||||
*out.pw++ = BSWAP_INT16_SIGNED((short)nOneWord);
|
||||
dwOutLength -= sizeof(short);
|
||||
}
|
||||
|
||||
// Get the initial index
|
||||
nIndex = nChannels - 1;
|
||||
|
||||
// Perform the decompression
|
||||
while(in.pb < pbInBufferEnd)
|
||||
{
|
||||
unsigned char nOneByte = *in.pb++;
|
||||
|
||||
// Switch index
|
||||
if(nChannels == 2)
|
||||
nIndex = (nIndex == 0) ? 1 : 0;
|
||||
|
||||
// 1500F2A2: Get one byte from input buffer
|
||||
if(nOneByte & 0x80)
|
||||
{
|
||||
switch(nOneByte & 0x7F)
|
||||
{
|
||||
case 0: // 1500F315
|
||||
if(SInt32Array1[nIndex] != 0)
|
||||
SInt32Array1[nIndex]--;
|
||||
|
||||
if(dwOutLength < 2)
|
||||
return (int)(out.pb - pbOutBuffer);
|
||||
|
||||
*out.pw++ = BSWAP_INT16_SIGNED((unsigned short)SInt32Array2[nIndex]);
|
||||
dwOutLength -= sizeof(unsigned short);
|
||||
break;
|
||||
|
||||
case 1: // 1500F2E8
|
||||
SInt32Array1[nIndex] += 8;
|
||||
if(SInt32Array1[nIndex] > 0x58)
|
||||
SInt32Array1[nIndex] = 0x58;
|
||||
|
||||
if(nChannels == 2)
|
||||
nIndex = (nIndex == 0) ? 1 : 0;
|
||||
break;
|
||||
|
||||
case 2: // 1500F41E
|
||||
break;
|
||||
|
||||
default: // 1500F2C4
|
||||
SInt32Array1[nIndex] -= 8;
|
||||
if(SInt32Array1[nIndex] < 0)
|
||||
SInt32Array1[nIndex] = 0;
|
||||
|
||||
if(nChannels == 2)
|
||||
nIndex = (nIndex == 0) ? 1 : 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 1500F349
|
||||
long temp1 = step_table[SInt32Array1[nIndex]]; // EDI
|
||||
long temp2 = temp1 >> pbInBuffer[1]; // ESI
|
||||
long temp3 = SInt32Array2[nIndex]; // ECX
|
||||
|
||||
if(nOneByte & 0x01) // EBX = nOneByte
|
||||
temp2 += (temp1 >> 0);
|
||||
|
||||
if(nOneByte & 0x02)
|
||||
temp2 += (temp1 >> 1);
|
||||
|
||||
if(nOneByte & 0x04)
|
||||
temp2 += (temp1 >> 2);
|
||||
|
||||
if(nOneByte & 0x08)
|
||||
temp2 += (temp1 >> 3);
|
||||
|
||||
if(nOneByte & 0x10)
|
||||
temp2 += (temp1 >> 4);
|
||||
|
||||
if(nOneByte & 0x20)
|
||||
temp2 += (temp1 >> 5);
|
||||
|
||||
if(nOneByte & 0x40)
|
||||
{
|
||||
temp3 = temp3 - temp2;
|
||||
if(temp3 <= -32768)
|
||||
temp3 = -32768;
|
||||
}
|
||||
else
|
||||
{
|
||||
temp3 = temp3 + temp2;
|
||||
if(temp3 >= 32767)
|
||||
temp3 = 32767;
|
||||
}
|
||||
|
||||
SInt32Array2[nIndex] = temp3;
|
||||
if(dwOutLength < 2)
|
||||
break;
|
||||
|
||||
// Store the output 16-bit value
|
||||
*out.pw++ = BSWAP_INT16_SIGNED((short)SInt32Array2[nIndex]);
|
||||
dwOutLength -= 2;
|
||||
|
||||
SInt32Array1[nIndex] += Table1503F120[nOneByte & 0x1F];
|
||||
|
||||
if(SInt32Array1[nIndex] < 0)
|
||||
SInt32Array1[nIndex] = 0;
|
||||
else if(SInt32Array1[nIndex] > 0x58)
|
||||
SInt32Array1[nIndex] = 0x58;
|
||||
}
|
||||
}
|
||||
return (int)(out.pb - pbOutBuffer);
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
/*****************************************************************************/
|
||||
/* adpcm.h Copyright (c) Ladislav Zezula 2003 */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Header file for adpcm decompress functions */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Date Ver Who Comment */
|
||||
/* -------- ---- --- ------- */
|
||||
/* 31.03.03 1.00 Lad The first version of adpcm.h */
|
||||
/*****************************************************************************/
|
||||
|
||||
#ifndef __ADPCM_H__
|
||||
#define __ADPCM_H__
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Functions
|
||||
|
||||
#include <StormPort.h>
|
||||
|
||||
int CompressADPCM (unsigned char * pbOutBuffer, int dwOutLength, short * pwInBuffer, int dwInLength, int nCmpType, int nChannels);
|
||||
int DecompressADPCM(unsigned char * pbOutBuffer, int dwOutLength, unsigned char * pbInBuffer, int dwInLength, int nChannels);
|
||||
|
||||
#endif // __ADPCM_H__
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*
|
||||
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
|
||||
*/
|
||||
#include "../../headers/tomcrypt.h"
|
||||
|
||||
/**
|
||||
@file der_encode_bit_string.c
|
||||
ASN.1 DER, encode a BIT STRING, Tom St Denis
|
||||
*/
|
||||
|
||||
|
||||
#ifdef LTC_DER
|
||||
|
||||
/**
|
||||
Store a BIT STRING
|
||||
@param in The array of bits to store (one per char)
|
||||
@param inlen The number of bits tostore
|
||||
@param out [out] The destination for the DER encoded BIT STRING
|
||||
@param outlen [in/out] The max size and resulting size of the DER BIT STRING
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int der_encode_bit_string(const unsigned char *in, unsigned long inlen,
|
||||
unsigned char *out, unsigned long *outlen)
|
||||
{
|
||||
unsigned long len, x, y;
|
||||
unsigned char buf;
|
||||
int err;
|
||||
|
||||
LTC_ARGCHK(in != NULL);
|
||||
LTC_ARGCHK(out != NULL);
|
||||
LTC_ARGCHK(outlen != NULL);
|
||||
|
||||
/* avoid overflows */
|
||||
if ((err = der_length_bit_string(inlen, &len)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
if (len > *outlen) {
|
||||
*outlen = len;
|
||||
return CRYPT_BUFFER_OVERFLOW;
|
||||
}
|
||||
|
||||
/* store header (include bit padding count in length) */
|
||||
x = 0;
|
||||
y = (inlen >> 3) + ((inlen&7) ? 1 : 0) + 1;
|
||||
|
||||
out[x++] = 0x03;
|
||||
if (y < 128) {
|
||||
out[x++] = (unsigned char)y;
|
||||
} else if (y < 256) {
|
||||
out[x++] = 0x81;
|
||||
out[x++] = (unsigned char)y;
|
||||
} else if (y < 65536) {
|
||||
out[x++] = 0x82;
|
||||
out[x++] = (unsigned char)((y>>8)&255);
|
||||
out[x++] = (unsigned char)(y&255);
|
||||
}
|
||||
|
||||
/* store number of zero padding bits */
|
||||
out[x++] = (unsigned char)((8 - inlen) & 7);
|
||||
|
||||
/* store the bits in big endian format */
|
||||
for (y = buf = 0; y < inlen; y++) {
|
||||
buf |= (in[y] ? 1 : 0) << (7 - (y & 7));
|
||||
if ((y & 7) == 7) {
|
||||
out[x++] = buf;
|
||||
buf = 0;
|
||||
}
|
||||
}
|
||||
/* store last byte */
|
||||
if (inlen & 7) {
|
||||
out[x++] = buf;
|
||||
}
|
||||
*outlen = x;
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/bit/der_encode_bit_string.c,v $ */
|
||||
/* $Revision: 1.5 $ */
|
||||
/* $Date: 2006/12/28 01:27:24 $ */
|
||||
|
|
@ -1,51 +0,0 @@
|
|||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*
|
||||
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
|
||||
*/
|
||||
#include "../../headers/tomcrypt.h"
|
||||
|
||||
/**
|
||||
@file der_encode_boolean.c
|
||||
ASN.1 DER, encode a BOOLEAN, Tom St Denis
|
||||
*/
|
||||
|
||||
|
||||
#ifdef LTC_DER
|
||||
|
||||
/**
|
||||
Store a BOOLEAN
|
||||
@param in The boolean to encode
|
||||
@param out [out] The destination for the DER encoded BOOLEAN
|
||||
@param outlen [in/out] The max size and resulting size of the DER BOOLEAN
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int der_encode_boolean(int in,
|
||||
unsigned char *out, unsigned long *outlen)
|
||||
{
|
||||
LTC_ARGCHK(outlen != NULL);
|
||||
LTC_ARGCHK(out != NULL);
|
||||
|
||||
if (*outlen < 3) {
|
||||
*outlen = 3;
|
||||
return CRYPT_BUFFER_OVERFLOW;
|
||||
}
|
||||
|
||||
*outlen = 3;
|
||||
out[0] = 0x01;
|
||||
out[1] = 0x01;
|
||||
out[2] = in ? 0xFF : 0x00;
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/boolean/der_encode_boolean.c,v $ */
|
||||
/* $Revision: 1.4 $ */
|
||||
/* $Date: 2006/12/28 01:27:24 $ */
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*
|
||||
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
|
||||
*/
|
||||
#include "../../headers/tomcrypt.h"
|
||||
|
||||
/**
|
||||
@file der_encode_ia5_string.c
|
||||
ASN.1 DER, encode a IA5 STRING, Tom St Denis
|
||||
*/
|
||||
|
||||
#ifdef LTC_DER
|
||||
|
||||
/**
|
||||
Store an IA5 STRING
|
||||
@param in The array of IA5 to store (one per char)
|
||||
@param inlen The number of IA5 to store
|
||||
@param out [out] The destination for the DER encoded IA5 STRING
|
||||
@param outlen [in/out] The max size and resulting size of the DER IA5 STRING
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int der_encode_ia5_string(const unsigned char *in, unsigned long inlen,
|
||||
unsigned char *out, unsigned long *outlen)
|
||||
{
|
||||
unsigned long x, y, len;
|
||||
int err;
|
||||
|
||||
LTC_ARGCHK(in != NULL);
|
||||
LTC_ARGCHK(out != NULL);
|
||||
LTC_ARGCHK(outlen != NULL);
|
||||
|
||||
/* get the size */
|
||||
if ((err = der_length_ia5_string(in, inlen, &len)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
/* too big? */
|
||||
if (len > *outlen) {
|
||||
*outlen = len;
|
||||
return CRYPT_BUFFER_OVERFLOW;
|
||||
}
|
||||
|
||||
/* encode the header+len */
|
||||
x = 0;
|
||||
out[x++] = 0x16;
|
||||
if (inlen < 128) {
|
||||
out[x++] = (unsigned char)inlen;
|
||||
} else if (inlen < 256) {
|
||||
out[x++] = 0x81;
|
||||
out[x++] = (unsigned char)inlen;
|
||||
} else if (inlen < 65536UL) {
|
||||
out[x++] = 0x82;
|
||||
out[x++] = (unsigned char)((inlen>>8)&255);
|
||||
out[x++] = (unsigned char)(inlen&255);
|
||||
} else if (inlen < 16777216UL) {
|
||||
out[x++] = 0x83;
|
||||
out[x++] = (unsigned char)((inlen>>16)&255);
|
||||
out[x++] = (unsigned char)((inlen>>8)&255);
|
||||
out[x++] = (unsigned char)(inlen&255);
|
||||
} else {
|
||||
return CRYPT_INVALID_ARG;
|
||||
}
|
||||
|
||||
/* store octets */
|
||||
for (y = 0; y < inlen; y++) {
|
||||
out[x++] = der_ia5_char_encode(in[y]);
|
||||
}
|
||||
|
||||
/* retun length */
|
||||
*outlen = x;
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/ia5/der_encode_ia5_string.c,v $ */
|
||||
/* $Revision: 1.5 $ */
|
||||
/* $Date: 2006/12/28 01:27:24 $ */
|
||||
|
|
@ -1,130 +0,0 @@
|
|||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*
|
||||
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
|
||||
*/
|
||||
#include "../../headers/tomcrypt.h"
|
||||
|
||||
/**
|
||||
@file der_encode_integer.c
|
||||
ASN.1 DER, encode an integer, Tom St Denis
|
||||
*/
|
||||
|
||||
|
||||
#ifdef LTC_DER
|
||||
|
||||
/* Exports a positive bignum as DER format (upto 2^32 bytes in size) */
|
||||
/**
|
||||
Store a mp_int integer
|
||||
@param num The first mp_int to encode
|
||||
@param out [out] The destination for the DER encoded integers
|
||||
@param outlen [in/out] The max size and resulting size of the DER encoded integers
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int der_encode_integer(void *num, unsigned char *out, unsigned long *outlen)
|
||||
{
|
||||
unsigned long tmplen, y;
|
||||
int err, leading_zero;
|
||||
|
||||
LTC_ARGCHK(num != NULL);
|
||||
LTC_ARGCHK(out != NULL);
|
||||
LTC_ARGCHK(outlen != NULL);
|
||||
|
||||
/* find out how big this will be */
|
||||
if ((err = der_length_integer(num, &tmplen)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
if (*outlen < tmplen) {
|
||||
*outlen = tmplen;
|
||||
return CRYPT_BUFFER_OVERFLOW;
|
||||
}
|
||||
|
||||
if (mp_cmp_d(num, 0) != LTC_MP_LT) {
|
||||
/* we only need a leading zero if the msb of the first byte is one */
|
||||
if ((mp_count_bits(num) & 7) == 0 || mp_iszero(num) == LTC_MP_YES) {
|
||||
leading_zero = 1;
|
||||
} else {
|
||||
leading_zero = 0;
|
||||
}
|
||||
|
||||
/* get length of num in bytes (plus 1 since we force the msbyte to zero) */
|
||||
y = mp_unsigned_bin_size(num) + leading_zero;
|
||||
} else {
|
||||
leading_zero = 0;
|
||||
y = mp_count_bits(num);
|
||||
y = y + (8 - (y & 7));
|
||||
y = y >> 3;
|
||||
if (((mp_cnt_lsb(num)+1)==mp_count_bits(num)) && ((mp_count_bits(num)&7)==0)) --y;
|
||||
}
|
||||
|
||||
/* now store initial data */
|
||||
*out++ = 0x02;
|
||||
if (y < 128) {
|
||||
/* short form */
|
||||
*out++ = (unsigned char)y;
|
||||
} else if (y < 256) {
|
||||
*out++ = 0x81;
|
||||
*out++ = (unsigned char)y;
|
||||
} else if (y < 65536UL) {
|
||||
*out++ = 0x82;
|
||||
*out++ = (unsigned char)((y>>8)&255);
|
||||
*out++ = (unsigned char)y;
|
||||
} else if (y < 16777216UL) {
|
||||
*out++ = 0x83;
|
||||
*out++ = (unsigned char)((y>>16)&255);
|
||||
*out++ = (unsigned char)((y>>8)&255);
|
||||
*out++ = (unsigned char)y;
|
||||
} else {
|
||||
return CRYPT_INVALID_ARG;
|
||||
}
|
||||
|
||||
/* now store msbyte of zero if num is non-zero */
|
||||
if (leading_zero) {
|
||||
*out++ = 0x00;
|
||||
}
|
||||
|
||||
/* if it's not zero store it as big endian */
|
||||
if (mp_cmp_d(num, 0) == LTC_MP_GT) {
|
||||
/* now store the mpint */
|
||||
if ((err = mp_to_unsigned_bin(num, out)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
} else if (mp_iszero(num) != LTC_MP_YES) {
|
||||
void *tmp;
|
||||
|
||||
/* negative */
|
||||
if (mp_init(&tmp) != CRYPT_OK) {
|
||||
return CRYPT_MEM;
|
||||
}
|
||||
|
||||
/* 2^roundup and subtract */
|
||||
y = mp_count_bits(num);
|
||||
y = y + (8 - (y & 7));
|
||||
if (((mp_cnt_lsb(num)+1)==mp_count_bits(num)) && ((mp_count_bits(num)&7)==0)) y -= 8;
|
||||
if (mp_2expt(tmp, y) != CRYPT_OK || mp_add(tmp, num, tmp) != CRYPT_OK) {
|
||||
mp_clear(tmp);
|
||||
return CRYPT_MEM;
|
||||
}
|
||||
if ((err = mp_to_unsigned_bin(tmp, out)) != CRYPT_OK) {
|
||||
mp_clear(tmp);
|
||||
return err;
|
||||
}
|
||||
mp_clear(tmp);
|
||||
}
|
||||
|
||||
/* we good */
|
||||
*outlen = tmplen;
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/integer/der_encode_integer.c,v $ */
|
||||
/* $Revision: 1.9 $ */
|
||||
/* $Date: 2006/12/28 01:27:24 $ */
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*
|
||||
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
|
||||
*/
|
||||
#include "../../headers/tomcrypt.h"
|
||||
|
||||
/**
|
||||
@file der_encode_object_identifier.c
|
||||
ASN.1 DER, Encode Object Identifier, Tom St Denis
|
||||
*/
|
||||
|
||||
#ifdef LTC_DER
|
||||
/**
|
||||
Encode an OID
|
||||
@param words The words to encode (upto 32-bits each)
|
||||
@param nwords The number of words in the OID
|
||||
@param out [out] Destination of OID data
|
||||
@param outlen [in/out] The max and resulting size of the OID
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int der_encode_object_identifier(unsigned long *words, unsigned long nwords,
|
||||
unsigned char *out, unsigned long *outlen)
|
||||
{
|
||||
unsigned long i, x, y, z, t, mask, wordbuf;
|
||||
int err;
|
||||
|
||||
LTC_ARGCHK(words != NULL);
|
||||
LTC_ARGCHK(out != NULL);
|
||||
LTC_ARGCHK(outlen != NULL);
|
||||
|
||||
/* check length */
|
||||
if ((err = der_length_object_identifier(words, nwords, &x)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
if (x > *outlen) {
|
||||
*outlen = x;
|
||||
return CRYPT_BUFFER_OVERFLOW;
|
||||
}
|
||||
|
||||
/* compute length to store OID data */
|
||||
z = 0;
|
||||
wordbuf = words[0] * 40 + words[1];
|
||||
for (y = 1; y < nwords; y++) {
|
||||
t = der_object_identifier_bits(wordbuf);
|
||||
z += t/7 + ((t%7) ? 1 : 0) + (wordbuf == 0 ? 1 : 0);
|
||||
if (y < nwords - 1) {
|
||||
wordbuf = words[y + 1];
|
||||
}
|
||||
}
|
||||
|
||||
/* store header + length */
|
||||
x = 0;
|
||||
out[x++] = 0x06;
|
||||
if (z < 128) {
|
||||
out[x++] = (unsigned char)z;
|
||||
} else if (z < 256) {
|
||||
out[x++] = 0x81;
|
||||
out[x++] = (unsigned char)z;
|
||||
} else if (z < 65536UL) {
|
||||
out[x++] = 0x82;
|
||||
out[x++] = (unsigned char)((z>>8)&255);
|
||||
out[x++] = (unsigned char)(z&255);
|
||||
} else {
|
||||
return CRYPT_INVALID_ARG;
|
||||
}
|
||||
|
||||
/* store first byte */
|
||||
wordbuf = words[0] * 40 + words[1];
|
||||
for (i = 1; i < nwords; i++) {
|
||||
/* store 7 bit words in little endian */
|
||||
t = wordbuf & 0xFFFFFFFF;
|
||||
if (t) {
|
||||
y = x;
|
||||
mask = 0;
|
||||
while (t) {
|
||||
out[x++] = (unsigned char)((t & 0x7F) | mask);
|
||||
t >>= 7;
|
||||
mask |= 0x80; /* upper bit is set on all but the last byte */
|
||||
}
|
||||
/* now swap bytes y...x-1 */
|
||||
z = x - 1;
|
||||
while (y < z) {
|
||||
t = out[y]; out[y] = out[z]; out[z] = (unsigned char)t;
|
||||
++y;
|
||||
--z;
|
||||
}
|
||||
} else {
|
||||
/* zero word */
|
||||
out[x++] = 0x00;
|
||||
}
|
||||
|
||||
if (i < nwords - 1) {
|
||||
wordbuf = words[i + 1];
|
||||
}
|
||||
}
|
||||
|
||||
*outlen = x;
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/object_identifier/der_encode_object_identifier.c,v $ */
|
||||
/* $Revision: 1.7 $ */
|
||||
/* $Date: 2006/12/28 01:27:24 $ */
|
||||
|
|
@ -1,86 +0,0 @@
|
|||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*
|
||||
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
|
||||
*/
|
||||
#include "../../headers/tomcrypt.h"
|
||||
|
||||
/**
|
||||
@file der_encode_octet_string.c
|
||||
ASN.1 DER, encode a OCTET STRING, Tom St Denis
|
||||
*/
|
||||
|
||||
|
||||
#ifdef LTC_DER
|
||||
|
||||
/**
|
||||
Store an OCTET STRING
|
||||
@param in The array of OCTETS to store (one per char)
|
||||
@param inlen The number of OCTETS to store
|
||||
@param out [out] The destination for the DER encoded OCTET STRING
|
||||
@param outlen [in/out] The max size and resulting size of the DER OCTET STRING
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int der_encode_octet_string(const unsigned char *in, unsigned long inlen,
|
||||
unsigned char *out, unsigned long *outlen)
|
||||
{
|
||||
unsigned long x, y, len;
|
||||
int err;
|
||||
|
||||
LTC_ARGCHK(in != NULL);
|
||||
LTC_ARGCHK(out != NULL);
|
||||
LTC_ARGCHK(outlen != NULL);
|
||||
|
||||
/* get the size */
|
||||
if ((err = der_length_octet_string(inlen, &len)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
/* too big? */
|
||||
if (len > *outlen) {
|
||||
*outlen = len;
|
||||
return CRYPT_BUFFER_OVERFLOW;
|
||||
}
|
||||
|
||||
/* encode the header+len */
|
||||
x = 0;
|
||||
out[x++] = 0x04;
|
||||
if (inlen < 128) {
|
||||
out[x++] = (unsigned char)inlen;
|
||||
} else if (inlen < 256) {
|
||||
out[x++] = 0x81;
|
||||
out[x++] = (unsigned char)inlen;
|
||||
} else if (inlen < 65536UL) {
|
||||
out[x++] = 0x82;
|
||||
out[x++] = (unsigned char)((inlen>>8)&255);
|
||||
out[x++] = (unsigned char)(inlen&255);
|
||||
} else if (inlen < 16777216UL) {
|
||||
out[x++] = 0x83;
|
||||
out[x++] = (unsigned char)((inlen>>16)&255);
|
||||
out[x++] = (unsigned char)((inlen>>8)&255);
|
||||
out[x++] = (unsigned char)(inlen&255);
|
||||
} else {
|
||||
return CRYPT_INVALID_ARG;
|
||||
}
|
||||
|
||||
/* store octets */
|
||||
for (y = 0; y < inlen; y++) {
|
||||
out[x++] = in[y];
|
||||
}
|
||||
|
||||
/* retun length */
|
||||
*outlen = x;
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/octet/der_encode_octet_string.c,v $ */
|
||||
/* $Revision: 1.5 $ */
|
||||
/* $Date: 2006/12/28 01:27:24 $ */
|
||||
|
|
@ -1,85 +0,0 @@
|
|||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*
|
||||
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
|
||||
*/
|
||||
#include "../../headers/tomcrypt.h"
|
||||
|
||||
/**
|
||||
@file der_encode_printable_string.c
|
||||
ASN.1 DER, encode a printable STRING, Tom St Denis
|
||||
*/
|
||||
|
||||
#ifdef LTC_DER
|
||||
|
||||
/**
|
||||
Store an printable STRING
|
||||
@param in The array of printable to store (one per char)
|
||||
@param inlen The number of printable to store
|
||||
@param out [out] The destination for the DER encoded printable STRING
|
||||
@param outlen [in/out] The max size and resulting size of the DER printable STRING
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int der_encode_printable_string(const unsigned char *in, unsigned long inlen,
|
||||
unsigned char *out, unsigned long *outlen)
|
||||
{
|
||||
unsigned long x, y, len;
|
||||
int err;
|
||||
|
||||
LTC_ARGCHK(in != NULL);
|
||||
LTC_ARGCHK(out != NULL);
|
||||
LTC_ARGCHK(outlen != NULL);
|
||||
|
||||
/* get the size */
|
||||
if ((err = der_length_printable_string(in, inlen, &len)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
/* too big? */
|
||||
if (len > *outlen) {
|
||||
*outlen = len;
|
||||
return CRYPT_BUFFER_OVERFLOW;
|
||||
}
|
||||
|
||||
/* encode the header+len */
|
||||
x = 0;
|
||||
out[x++] = 0x13;
|
||||
if (inlen < 128) {
|
||||
out[x++] = (unsigned char)inlen;
|
||||
} else if (inlen < 256) {
|
||||
out[x++] = 0x81;
|
||||
out[x++] = (unsigned char)inlen;
|
||||
} else if (inlen < 65536UL) {
|
||||
out[x++] = 0x82;
|
||||
out[x++] = (unsigned char)((inlen>>8)&255);
|
||||
out[x++] = (unsigned char)(inlen&255);
|
||||
} else if (inlen < 16777216UL) {
|
||||
out[x++] = 0x83;
|
||||
out[x++] = (unsigned char)((inlen>>16)&255);
|
||||
out[x++] = (unsigned char)((inlen>>8)&255);
|
||||
out[x++] = (unsigned char)(inlen&255);
|
||||
} else {
|
||||
return CRYPT_INVALID_ARG;
|
||||
}
|
||||
|
||||
/* store octets */
|
||||
for (y = 0; y < inlen; y++) {
|
||||
out[x++] = der_printable_char_encode(in[y]);
|
||||
}
|
||||
|
||||
/* retun length */
|
||||
*outlen = x;
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/printable_string/der_encode_printable_string.c,v $ */
|
||||
/* $Revision: 1.5 $ */
|
||||
/* $Date: 2006/12/28 01:27:24 $ */
|
||||
|
|
@ -1,335 +0,0 @@
|
|||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*
|
||||
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
|
||||
*/
|
||||
#include "../../headers/tomcrypt.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
|
||||
/**
|
||||
@file der_encode_sequence_ex.c
|
||||
ASN.1 DER, encode a SEQUENCE, Tom St Denis
|
||||
*/
|
||||
|
||||
#ifdef LTC_DER
|
||||
|
||||
/**
|
||||
Encode a SEQUENCE
|
||||
@param list The list of items to encode
|
||||
@param inlen The number of items in the list
|
||||
@param out [out] The destination
|
||||
@param outlen [in/out] The size of the output
|
||||
@param type_of LTC_ASN1_SEQUENCE or LTC_ASN1_SET/LTC_ASN1_SETOF
|
||||
@return CRYPT_OK on success
|
||||
*/
|
||||
int der_encode_sequence_ex(ltc_asn1_list *list, unsigned long inlen,
|
||||
unsigned char *out, unsigned long *outlen, int type_of)
|
||||
{
|
||||
int err, type;
|
||||
unsigned long size, x, y, z, i;
|
||||
void *data;
|
||||
|
||||
LTC_ARGCHK(list != NULL);
|
||||
LTC_ARGCHK(out != NULL);
|
||||
LTC_ARGCHK(outlen != NULL);
|
||||
|
||||
/* get size of output that will be required */
|
||||
y = 0;
|
||||
for (i = 0; i < inlen; i++) {
|
||||
type = list[i].type;
|
||||
size = list[i].size;
|
||||
data = list[i].data;
|
||||
|
||||
if (type == LTC_ASN1_EOL) {
|
||||
break;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case LTC_ASN1_BOOLEAN:
|
||||
if ((err = der_length_boolean(&x)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
y += x;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_INTEGER:
|
||||
if ((err = der_length_integer(data, &x)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
y += x;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_SHORT_INTEGER:
|
||||
if ((err = der_length_short_integer(*((unsigned long*)data), &x)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
y += x;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_BIT_STRING:
|
||||
if ((err = der_length_bit_string(size, &x)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
y += x;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_OCTET_STRING:
|
||||
if ((err = der_length_octet_string(size, &x)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
y += x;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_NULL:
|
||||
y += 2;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_OBJECT_IDENTIFIER:
|
||||
if ((err = der_length_object_identifier(data, size, &x)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
y += x;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_IA5_STRING:
|
||||
if ((err = der_length_ia5_string(data, size, &x)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
y += x;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_PRINTABLE_STRING:
|
||||
if ((err = der_length_printable_string(data, size, &x)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
y += x;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_UTF8_STRING:
|
||||
if ((err = der_length_utf8_string(data, size, &x)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
y += x;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_UTCTIME:
|
||||
if ((err = der_length_utctime(data, &x)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
y += x;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_SET:
|
||||
case LTC_ASN1_SETOF:
|
||||
case LTC_ASN1_SEQUENCE:
|
||||
if ((err = der_length_sequence(data, size, &x)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
y += x;
|
||||
break;
|
||||
|
||||
default:
|
||||
err = CRYPT_INVALID_ARG;
|
||||
goto LBL_ERR;
|
||||
}
|
||||
}
|
||||
|
||||
/* calc header size */
|
||||
z = y;
|
||||
if (y < 128) {
|
||||
y += 2;
|
||||
} else if (y < 256) {
|
||||
/* 0x30 0x81 LL */
|
||||
y += 3;
|
||||
} else if (y < 65536UL) {
|
||||
/* 0x30 0x82 LL LL */
|
||||
y += 4;
|
||||
} else if (y < 16777216UL) {
|
||||
/* 0x30 0x83 LL LL LL */
|
||||
y += 5;
|
||||
} else {
|
||||
err = CRYPT_INVALID_ARG;
|
||||
goto LBL_ERR;
|
||||
}
|
||||
|
||||
/* too big ? */
|
||||
if (*outlen < y) {
|
||||
*outlen = y;
|
||||
err = CRYPT_BUFFER_OVERFLOW;
|
||||
goto LBL_ERR;
|
||||
}
|
||||
|
||||
/* store header */
|
||||
x = 0;
|
||||
out[x++] = (type_of == LTC_ASN1_SEQUENCE) ? 0x30 : 0x31;
|
||||
|
||||
if (z < 128) {
|
||||
out[x++] = (unsigned char)z;
|
||||
} else if (z < 256) {
|
||||
out[x++] = 0x81;
|
||||
out[x++] = (unsigned char)z;
|
||||
} else if (z < 65536UL) {
|
||||
out[x++] = 0x82;
|
||||
out[x++] = (unsigned char)((z>>8UL)&255);
|
||||
out[x++] = (unsigned char)(z&255);
|
||||
} else if (z < 16777216UL) {
|
||||
out[x++] = 0x83;
|
||||
out[x++] = (unsigned char)((z>>16UL)&255);
|
||||
out[x++] = (unsigned char)((z>>8UL)&255);
|
||||
out[x++] = (unsigned char)(z&255);
|
||||
}
|
||||
|
||||
/* store data */
|
||||
*outlen -= x;
|
||||
for (i = 0; i < inlen; i++) {
|
||||
type = list[i].type;
|
||||
size = list[i].size;
|
||||
data = list[i].data;
|
||||
|
||||
if (type == LTC_ASN1_EOL) {
|
||||
break;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case LTC_ASN1_BOOLEAN:
|
||||
z = *outlen;
|
||||
if ((err = der_encode_boolean(*((int *)data), out + x, &z)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
x += z;
|
||||
*outlen -= z;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_INTEGER:
|
||||
z = *outlen;
|
||||
if ((err = der_encode_integer(data, out + x, &z)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
x += z;
|
||||
*outlen -= z;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_SHORT_INTEGER:
|
||||
z = *outlen;
|
||||
if ((err = der_encode_short_integer(*((unsigned long*)data), out + x, &z)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
x += z;
|
||||
*outlen -= z;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_BIT_STRING:
|
||||
z = *outlen;
|
||||
if ((err = der_encode_bit_string(data, size, out + x, &z)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
x += z;
|
||||
*outlen -= z;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_OCTET_STRING:
|
||||
z = *outlen;
|
||||
if ((err = der_encode_octet_string(data, size, out + x, &z)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
x += z;
|
||||
*outlen -= z;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_NULL:
|
||||
out[x++] = 0x05;
|
||||
out[x++] = 0x00;
|
||||
*outlen -= 2;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_OBJECT_IDENTIFIER:
|
||||
z = *outlen;
|
||||
if ((err = der_encode_object_identifier(data, size, out + x, &z)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
x += z;
|
||||
*outlen -= z;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_IA5_STRING:
|
||||
z = *outlen;
|
||||
if ((err = der_encode_ia5_string(data, size, out + x, &z)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
x += z;
|
||||
*outlen -= z;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_PRINTABLE_STRING:
|
||||
z = *outlen;
|
||||
if ((err = der_encode_printable_string(data, size, out + x, &z)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
x += z;
|
||||
*outlen -= z;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_UTF8_STRING:
|
||||
z = *outlen;
|
||||
if ((err = der_encode_utf8_string(data, size, out + x, &z)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
x += z;
|
||||
*outlen -= z;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_UTCTIME:
|
||||
z = *outlen;
|
||||
if ((err = der_encode_utctime(data, out + x, &z)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
x += z;
|
||||
*outlen -= z;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_SET:
|
||||
z = *outlen;
|
||||
if ((err = der_encode_set(data, size, out + x, &z)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
x += z;
|
||||
*outlen -= z;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_SETOF:
|
||||
z = *outlen;
|
||||
if ((err = der_encode_setof(data, size, out + x, &z)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
x += z;
|
||||
*outlen -= z;
|
||||
break;
|
||||
|
||||
case LTC_ASN1_SEQUENCE:
|
||||
z = *outlen;
|
||||
if ((err = der_encode_sequence_ex(data, size, out + x, &z, type)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
x += z;
|
||||
*outlen -= z;
|
||||
break;
|
||||
|
||||
default:
|
||||
err = CRYPT_INVALID_ARG;
|
||||
goto LBL_ERR;
|
||||
}
|
||||
}
|
||||
*outlen = x;
|
||||
err = CRYPT_OK;
|
||||
|
||||
LBL_ERR:
|
||||
return err;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -1,138 +0,0 @@
|
|||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*
|
||||
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
|
||||
*/
|
||||
#include "../../headers/tomcrypt.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
|
||||
/**
|
||||
@file der_encode_sequence_multi.c
|
||||
ASN.1 DER, encode a SEQUENCE, Tom St Denis
|
||||
*/
|
||||
|
||||
#ifdef LTC_DER
|
||||
|
||||
/**
|
||||
Encode a SEQUENCE type using a VA list
|
||||
@param out [out] Destination for data
|
||||
@param outlen [in/out] Length of buffer and resulting length of output
|
||||
@remark <...> is of the form <type, size, data> (int, unsigned long, void*)
|
||||
@return CRYPT_OK on success
|
||||
*/
|
||||
int der_encode_sequence_multi(unsigned char *out, unsigned long *outlen, ...)
|
||||
{
|
||||
int err, type;
|
||||
unsigned long size, x;
|
||||
void *data;
|
||||
va_list args;
|
||||
ltc_asn1_list *list;
|
||||
|
||||
LTC_ARGCHK(out != NULL);
|
||||
LTC_ARGCHK(outlen != NULL);
|
||||
|
||||
/* get size of output that will be required */
|
||||
va_start(args, outlen);
|
||||
x = 0;
|
||||
for (;;) {
|
||||
type = va_arg(args, int);
|
||||
size = va_arg(args, unsigned long);
|
||||
data = va_arg(args, void*);
|
||||
|
||||
if (type == LTC_ASN1_EOL) {
|
||||
break;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case LTC_ASN1_BOOLEAN:
|
||||
case LTC_ASN1_INTEGER:
|
||||
case LTC_ASN1_SHORT_INTEGER:
|
||||
case LTC_ASN1_BIT_STRING:
|
||||
case LTC_ASN1_OCTET_STRING:
|
||||
case LTC_ASN1_NULL:
|
||||
case LTC_ASN1_OBJECT_IDENTIFIER:
|
||||
case LTC_ASN1_IA5_STRING:
|
||||
case LTC_ASN1_PRINTABLE_STRING:
|
||||
case LTC_ASN1_UTF8_STRING:
|
||||
case LTC_ASN1_UTCTIME:
|
||||
case LTC_ASN1_SEQUENCE:
|
||||
case LTC_ASN1_SET:
|
||||
case LTC_ASN1_SETOF:
|
||||
++x;
|
||||
break;
|
||||
|
||||
default:
|
||||
va_end(args);
|
||||
return CRYPT_INVALID_ARG;
|
||||
}
|
||||
}
|
||||
va_end(args);
|
||||
|
||||
/* allocate structure for x elements */
|
||||
if (x == 0) {
|
||||
return CRYPT_NOP;
|
||||
}
|
||||
|
||||
list = XCALLOC(sizeof(*list), x);
|
||||
if (list == NULL) {
|
||||
return CRYPT_MEM;
|
||||
}
|
||||
|
||||
/* fill in the structure */
|
||||
va_start(args, outlen);
|
||||
x = 0;
|
||||
for (;;) {
|
||||
type = va_arg(args, int);
|
||||
size = va_arg(args, unsigned long);
|
||||
data = va_arg(args, void*);
|
||||
|
||||
if (type == LTC_ASN1_EOL) {
|
||||
break;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case LTC_ASN1_BOOLEAN:
|
||||
case LTC_ASN1_INTEGER:
|
||||
case LTC_ASN1_SHORT_INTEGER:
|
||||
case LTC_ASN1_BIT_STRING:
|
||||
case LTC_ASN1_OCTET_STRING:
|
||||
case LTC_ASN1_NULL:
|
||||
case LTC_ASN1_OBJECT_IDENTIFIER:
|
||||
case LTC_ASN1_IA5_STRING:
|
||||
case LTC_ASN1_PRINTABLE_STRING:
|
||||
case LTC_ASN1_UTF8_STRING:
|
||||
case LTC_ASN1_UTCTIME:
|
||||
case LTC_ASN1_SEQUENCE:
|
||||
case LTC_ASN1_SET:
|
||||
case LTC_ASN1_SETOF:
|
||||
list[x].type = type;
|
||||
list[x].size = size;
|
||||
list[x++].data = data;
|
||||
break;
|
||||
|
||||
default:
|
||||
va_end(args);
|
||||
err = CRYPT_INVALID_ARG;
|
||||
goto LBL_ERR;
|
||||
}
|
||||
}
|
||||
va_end(args);
|
||||
|
||||
err = der_encode_sequence(list, x, out, outlen);
|
||||
LBL_ERR:
|
||||
XFREE(list);
|
||||
return err;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/sequence/der_encode_sequence_multi.c,v $ */
|
||||
/* $Revision: 1.12 $ */
|
||||
/* $Date: 2006/12/28 01:27:24 $ */
|
||||
|
|
@ -1,103 +0,0 @@
|
|||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*
|
||||
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
|
||||
*/
|
||||
#include "../../headers/tomcrypt.h"
|
||||
|
||||
/**
|
||||
@file der_encode_set.c
|
||||
ASN.1 DER, Encode a SET, Tom St Denis
|
||||
*/
|
||||
|
||||
#ifdef LTC_DER
|
||||
|
||||
/* LTC define to ASN.1 TAG */
|
||||
static int ltc_to_asn1(int v)
|
||||
{
|
||||
switch (v) {
|
||||
case LTC_ASN1_BOOLEAN: return 0x01;
|
||||
case LTC_ASN1_INTEGER:
|
||||
case LTC_ASN1_SHORT_INTEGER: return 0x02;
|
||||
case LTC_ASN1_BIT_STRING: return 0x03;
|
||||
case LTC_ASN1_OCTET_STRING: return 0x04;
|
||||
case LTC_ASN1_NULL: return 0x05;
|
||||
case LTC_ASN1_OBJECT_IDENTIFIER: return 0x06;
|
||||
case LTC_ASN1_UTF8_STRING: return 0x0C;
|
||||
case LTC_ASN1_PRINTABLE_STRING: return 0x13;
|
||||
case LTC_ASN1_IA5_STRING: return 0x16;
|
||||
case LTC_ASN1_UTCTIME: return 0x17;
|
||||
case LTC_ASN1_SEQUENCE: return 0x30;
|
||||
case LTC_ASN1_SET:
|
||||
case LTC_ASN1_SETOF: return 0x31;
|
||||
default: return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static int qsort_helper(const void *a, const void *b)
|
||||
{
|
||||
ltc_asn1_list *A = (ltc_asn1_list *)a, *B = (ltc_asn1_list *)b;
|
||||
int r;
|
||||
|
||||
r = ltc_to_asn1(A->type) - ltc_to_asn1(B->type);
|
||||
|
||||
/* for QSORT the order is UNDEFINED if they are "equal" which means it is NOT DETERMINISTIC. So we force it to be :-) */
|
||||
if (r == 0) {
|
||||
/* their order in the original list now determines the position */
|
||||
return A->used - B->used;
|
||||
} else {
|
||||
return r;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Encode a SET type
|
||||
@param list The list of items to encode
|
||||
@param inlen The number of items in the list
|
||||
@param out [out] The destination
|
||||
@param outlen [in/out] The size of the output
|
||||
@return CRYPT_OK on success
|
||||
*/
|
||||
int der_encode_set(ltc_asn1_list *list, unsigned long inlen,
|
||||
unsigned char *out, unsigned long *outlen)
|
||||
{
|
||||
ltc_asn1_list *copy;
|
||||
unsigned long x;
|
||||
int err;
|
||||
|
||||
/* make copy of list */
|
||||
copy = XCALLOC(inlen, sizeof(*copy));
|
||||
if (copy == NULL) {
|
||||
return CRYPT_MEM;
|
||||
}
|
||||
|
||||
/* fill in used member with index so we can fully sort it */
|
||||
for (x = 0; x < inlen; x++) {
|
||||
copy[x] = list[x];
|
||||
copy[x].used = x;
|
||||
}
|
||||
|
||||
/* sort it by the "type" field */
|
||||
XQSORT(copy, inlen, sizeof(*copy), &qsort_helper);
|
||||
|
||||
/* call der_encode_sequence_ex() */
|
||||
err = der_encode_sequence_ex(copy, inlen, out, outlen, LTC_ASN1_SET);
|
||||
|
||||
/* free list */
|
||||
XFREE(copy);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/set/der_encode_set.c,v $ */
|
||||
/* $Revision: 1.12 $ */
|
||||
/* $Date: 2006/12/28 01:27:24 $ */
|
||||
|
|
@ -1,162 +0,0 @@
|
|||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*
|
||||
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
|
||||
*/
|
||||
#include "../../headers/tomcrypt.h"
|
||||
|
||||
/**
|
||||
@file der_encode_setof.c
|
||||
ASN.1 DER, Encode SET OF, Tom St Denis
|
||||
*/
|
||||
|
||||
#ifdef LTC_DER
|
||||
|
||||
struct edge {
|
||||
unsigned char *start;
|
||||
unsigned long size;
|
||||
};
|
||||
|
||||
static int qsort_helper(const void *a, const void *b)
|
||||
{
|
||||
struct edge *A = (struct edge *)a, *B = (struct edge *)b;
|
||||
int r;
|
||||
unsigned long x;
|
||||
|
||||
/* compare min length */
|
||||
r = XMEMCMP(A->start, B->start, MIN(A->size, B->size));
|
||||
|
||||
if (r == 0 && A->size != B->size) {
|
||||
if (A->size > B->size) {
|
||||
for (x = B->size; x < A->size; x++) {
|
||||
if (A->start[x]) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (x = A->size; x < B->size; x++) {
|
||||
if (B->start[x]) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
/**
|
||||
Encode a SETOF stucture
|
||||
@param list The list of items to encode
|
||||
@param inlen The number of items in the list
|
||||
@param out [out] The destination
|
||||
@param outlen [in/out] The size of the output
|
||||
@return CRYPT_OK on success
|
||||
*/
|
||||
int der_encode_setof(ltc_asn1_list *list, unsigned long inlen,
|
||||
unsigned char *out, unsigned long *outlen)
|
||||
{
|
||||
unsigned long x, y, z, hdrlen;
|
||||
int err;
|
||||
struct edge *edges;
|
||||
unsigned char *ptr, *buf;
|
||||
|
||||
/* check that they're all the same type */
|
||||
for (x = 1; x < inlen; x++) {
|
||||
if (list[x].type != list[x-1].type) {
|
||||
return CRYPT_INVALID_ARG;
|
||||
}
|
||||
}
|
||||
|
||||
/* alloc buffer to store copy of output */
|
||||
buf = XCALLOC(1, *outlen);
|
||||
if (buf == NULL) {
|
||||
return CRYPT_MEM;
|
||||
}
|
||||
|
||||
/* encode list */
|
||||
if ((err = der_encode_sequence_ex(list, inlen, buf, outlen, LTC_ASN1_SETOF)) != CRYPT_OK) {
|
||||
XFREE(buf);
|
||||
return err;
|
||||
}
|
||||
|
||||
/* allocate edges */
|
||||
edges = XCALLOC(inlen, sizeof(*edges));
|
||||
if (edges == NULL) {
|
||||
XFREE(buf);
|
||||
return CRYPT_MEM;
|
||||
}
|
||||
|
||||
/* skip header */
|
||||
ptr = buf + 1;
|
||||
|
||||
/* now skip length data */
|
||||
x = *ptr++;
|
||||
if (x >= 0x80) {
|
||||
ptr += (x & 0x7F);
|
||||
}
|
||||
|
||||
/* get the size of the static header */
|
||||
hdrlen = (unsigned long)((size_t)ptr - (size_t)buf);
|
||||
|
||||
|
||||
/* scan for edges */
|
||||
x = 0;
|
||||
while (ptr < (buf + *outlen)) {
|
||||
/* store start */
|
||||
edges[x].start = ptr;
|
||||
|
||||
/* skip type */
|
||||
z = 1;
|
||||
|
||||
/* parse length */
|
||||
y = ptr[z++];
|
||||
if (y < 128) {
|
||||
edges[x].size = y;
|
||||
} else {
|
||||
y &= 0x7F;
|
||||
edges[x].size = 0;
|
||||
while (y--) {
|
||||
edges[x].size = (edges[x].size << 8) | ((unsigned long)ptr[z++]);
|
||||
}
|
||||
}
|
||||
|
||||
/* skip content */
|
||||
edges[x].size += z;
|
||||
ptr += edges[x].size;
|
||||
++x;
|
||||
}
|
||||
|
||||
/* sort based on contents (using edges) */
|
||||
XQSORT(edges, inlen, sizeof(*edges), &qsort_helper);
|
||||
|
||||
/* copy static header */
|
||||
XMEMCPY(out, buf, hdrlen);
|
||||
|
||||
/* copy+sort using edges+indecies to output from buffer */
|
||||
for (y = hdrlen, x = 0; x < inlen; x++) {
|
||||
XMEMCPY(out+y, edges[x].start, edges[x].size);
|
||||
y += edges[x].size;
|
||||
}
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
zeromem(buf, *outlen);
|
||||
#endif
|
||||
|
||||
/* free buffers */
|
||||
XFREE(edges);
|
||||
XFREE(buf);
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/set/der_encode_setof.c,v $ */
|
||||
/* $Revision: 1.12 $ */
|
||||
/* $Date: 2006/12/28 01:27:24 $ */
|
||||
|
|
@ -1,97 +0,0 @@
|
|||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*
|
||||
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
|
||||
*/
|
||||
#include "../../headers/tomcrypt.h"
|
||||
|
||||
/**
|
||||
@file der_encode_short_integer.c
|
||||
ASN.1 DER, encode an integer, Tom St Denis
|
||||
*/
|
||||
|
||||
|
||||
#ifdef LTC_DER
|
||||
|
||||
/**
|
||||
Store a short integer in the range (0,2^32-1)
|
||||
@param num The integer to encode
|
||||
@param out [out] The destination for the DER encoded integers
|
||||
@param outlen [in/out] The max size and resulting size of the DER encoded integers
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int der_encode_short_integer(unsigned long num, unsigned char *out, unsigned long *outlen)
|
||||
{
|
||||
unsigned long len, x, y, z;
|
||||
int err;
|
||||
|
||||
LTC_ARGCHK(out != NULL);
|
||||
LTC_ARGCHK(outlen != NULL);
|
||||
|
||||
/* force to 32 bits */
|
||||
num &= 0xFFFFFFFFUL;
|
||||
|
||||
/* find out how big this will be */
|
||||
if ((err = der_length_short_integer(num, &len)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
if (*outlen < len) {
|
||||
*outlen = len;
|
||||
return CRYPT_BUFFER_OVERFLOW;
|
||||
}
|
||||
|
||||
/* get len of output */
|
||||
z = 0;
|
||||
y = num;
|
||||
while (y) {
|
||||
++z;
|
||||
y >>= 8;
|
||||
}
|
||||
|
||||
/* handle zero */
|
||||
if (z == 0) {
|
||||
z = 1;
|
||||
}
|
||||
|
||||
/* see if msb is set */
|
||||
z += (num&(1UL<<((z<<3) - 1))) ? 1 : 0;
|
||||
|
||||
/* adjust the number so the msB is non-zero */
|
||||
for (x = 0; (z <= 4) && (x < (4 - z)); x++) {
|
||||
num <<= 8;
|
||||
}
|
||||
|
||||
/* store header */
|
||||
x = 0;
|
||||
out[x++] = 0x02;
|
||||
out[x++] = (unsigned char)z;
|
||||
|
||||
/* if 31st bit is set output a leading zero and decrement count */
|
||||
if (z == 5) {
|
||||
out[x++] = 0;
|
||||
--z;
|
||||
}
|
||||
|
||||
/* store values */
|
||||
for (y = 0; y < z; y++) {
|
||||
out[x++] = (unsigned char)((num >> 24) & 0xFF);
|
||||
num <<= 8;
|
||||
}
|
||||
|
||||
/* we good */
|
||||
*outlen = x;
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/short_integer/der_encode_short_integer.c,v $ */
|
||||
/* $Revision: 1.8 $ */
|
||||
/* $Date: 2006/12/28 01:27:24 $ */
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*
|
||||
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
|
||||
*/
|
||||
#include "../../headers/tomcrypt.h"
|
||||
|
||||
/**
|
||||
@file der_encode_utctime.c
|
||||
ASN.1 DER, encode a UTCTIME, Tom St Denis
|
||||
*/
|
||||
|
||||
#ifdef LTC_DER
|
||||
|
||||
static const char *baseten = "0123456789";
|
||||
|
||||
#define STORE_V(y) \
|
||||
out[x++] = der_ia5_char_encode(baseten[(y/10) % 10]); \
|
||||
out[x++] = der_ia5_char_encode(baseten[y % 10]);
|
||||
|
||||
/**
|
||||
Encodes a UTC time structure in DER format
|
||||
@param utctime The UTC time structure to encode
|
||||
@param out The destination of the DER encoding of the UTC time structure
|
||||
@param outlen [in/out] The length of the DER encoding
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int der_encode_utctime(ltc_utctime *utctime,
|
||||
unsigned char *out, unsigned long *outlen)
|
||||
{
|
||||
unsigned long x, tmplen;
|
||||
int err;
|
||||
|
||||
LTC_ARGCHK(utctime != NULL);
|
||||
LTC_ARGCHK(out != NULL);
|
||||
LTC_ARGCHK(outlen != NULL);
|
||||
|
||||
if ((err = der_length_utctime(utctime, &tmplen)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
if (tmplen > *outlen) {
|
||||
*outlen = tmplen;
|
||||
return CRYPT_BUFFER_OVERFLOW;
|
||||
}
|
||||
|
||||
/* store header */
|
||||
out[0] = 0x17;
|
||||
|
||||
/* store values */
|
||||
x = 2;
|
||||
STORE_V(utctime->YY);
|
||||
STORE_V(utctime->MM);
|
||||
STORE_V(utctime->DD);
|
||||
STORE_V(utctime->hh);
|
||||
STORE_V(utctime->mm);
|
||||
STORE_V(utctime->ss);
|
||||
|
||||
if (utctime->off_mm || utctime->off_hh) {
|
||||
out[x++] = der_ia5_char_encode(utctime->off_dir ? '-' : '+');
|
||||
STORE_V(utctime->off_hh);
|
||||
STORE_V(utctime->off_mm);
|
||||
} else {
|
||||
out[x++] = der_ia5_char_encode('Z');
|
||||
}
|
||||
|
||||
/* store length */
|
||||
out[1] = (unsigned char)(x - 2);
|
||||
|
||||
/* all good let's return */
|
||||
*outlen = x;
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/utctime/der_encode_utctime.c,v $ */
|
||||
/* $Revision: 1.10 $ */
|
||||
/* $Date: 2006/12/28 01:27:24 $ */
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*
|
||||
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
|
||||
*/
|
||||
#include "../../headers/tomcrypt.h"
|
||||
|
||||
/**
|
||||
@file der_encode_utf8_string.c
|
||||
ASN.1 DER, encode a UTF8 STRING, Tom St Denis
|
||||
*/
|
||||
|
||||
|
||||
#ifdef LTC_DER
|
||||
|
||||
/**
|
||||
Store an UTF8 STRING
|
||||
@param in The array of UTF8 to store (one per wchar_t)
|
||||
@param inlen The number of UTF8 to store
|
||||
@param out [out] The destination for the DER encoded UTF8 STRING
|
||||
@param outlen [in/out] The max size and resulting size of the DER UTF8 STRING
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int der_encode_utf8_string(const wchar_t *in, unsigned long inlen,
|
||||
unsigned char *out, unsigned long *outlen)
|
||||
{
|
||||
unsigned long x, y, len;
|
||||
|
||||
LTC_ARGCHK(in != NULL);
|
||||
LTC_ARGCHK(out != NULL);
|
||||
LTC_ARGCHK(outlen != NULL);
|
||||
|
||||
/* get the size */
|
||||
for (x = len = 0; x < inlen; x++) {
|
||||
if (in[x] < 0 || in[x] > 0x1FFFF) {
|
||||
return CRYPT_INVALID_ARG;
|
||||
}
|
||||
len += der_utf8_charsize(in[x]);
|
||||
}
|
||||
|
||||
if (len < 128) {
|
||||
y = 2 + len;
|
||||
} else if (len < 256) {
|
||||
y = 3 + len;
|
||||
} else if (len < 65536UL) {
|
||||
y = 4 + len;
|
||||
} else if (len < 16777216UL) {
|
||||
y = 5 + len;
|
||||
} else {
|
||||
return CRYPT_INVALID_ARG;
|
||||
}
|
||||
|
||||
/* too big? */
|
||||
if (y > *outlen) {
|
||||
*outlen = len;
|
||||
return CRYPT_BUFFER_OVERFLOW;
|
||||
}
|
||||
|
||||
/* encode the header+len */
|
||||
x = 0;
|
||||
out[x++] = 0x0C;
|
||||
if (len < 128) {
|
||||
out[x++] = (unsigned char)len;
|
||||
} else if (len < 256) {
|
||||
out[x++] = 0x81;
|
||||
out[x++] = (unsigned char)len;
|
||||
} else if (len < 65536UL) {
|
||||
out[x++] = 0x82;
|
||||
out[x++] = (unsigned char)((len>>8)&255);
|
||||
out[x++] = (unsigned char)(len&255);
|
||||
} else if (len < 16777216UL) {
|
||||
out[x++] = 0x83;
|
||||
out[x++] = (unsigned char)((len>>16)&255);
|
||||
out[x++] = (unsigned char)((len>>8)&255);
|
||||
out[x++] = (unsigned char)(len&255);
|
||||
} else {
|
||||
return CRYPT_INVALID_ARG;
|
||||
}
|
||||
|
||||
/* store UTF8 */
|
||||
for (y = 0; y < inlen; y++) {
|
||||
switch (der_utf8_charsize(in[y])) {
|
||||
case 1: out[x++] = (unsigned char)in[y]; break;
|
||||
case 2: out[x++] = 0xC0 | ((in[y] >> 6) & 0x1F); out[x++] = 0x80 | (in[y] & 0x3F); break;
|
||||
case 3: out[x++] = 0xE0 | ((in[y] >> 12) & 0x0F); out[x++] = 0x80 | ((in[y] >> 6) & 0x3F); out[x++] = 0x80 | (in[y] & 0x3F); break;
|
||||
case 4: out[x++] = 0xF0 | ((in[y] >> 18) & 0x07); out[x++] = 0x80 | ((in[y] >> 12) & 0x3F); out[x++] = 0x80 | ((in[y] >> 6) & 0x3F); out[x++] = 0x80 | (in[y] & 0x3F); break;
|
||||
}
|
||||
}
|
||||
|
||||
/* retun length */
|
||||
*outlen = x;
|
||||
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* $Source: /cvs/libtom/libtomcrypt/src/pk/asn1/der/utf8/der_encode_utf8_string.c,v $ */
|
||||
/* $Revision: 1.9 $ */
|
||||
/* $Date: 2006/12/28 01:27:24 $ */
|
||||
|
|
@ -1,175 +0,0 @@
|
|||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*
|
||||
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
|
||||
*/
|
||||
#include "../../headers/tomcrypt.h"
|
||||
|
||||
/**
|
||||
@file pkcs_1_pss_encode.c
|
||||
LTC_PKCS #1 PSS Signature Padding, Tom St Denis
|
||||
*/
|
||||
|
||||
#ifdef LTC_PKCS_1
|
||||
|
||||
/**
|
||||
LTC_PKCS #1 v2.00 Signature Encoding
|
||||
@param msghash The hash to encode
|
||||
@param msghashlen The length of the hash (octets)
|
||||
@param saltlen The length of the salt desired (octets)
|
||||
@param prng An active PRNG context
|
||||
@param prng_idx The index of the PRNG desired
|
||||
@param hash_idx The index of the hash desired
|
||||
@param modulus_bitlen The bit length of the RSA modulus
|
||||
@param out [out] The destination of the encoding
|
||||
@param outlen [in/out] The max size and resulting size of the encoded data
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int pkcs_1_pss_encode(const unsigned char *msghash, unsigned long msghashlen,
|
||||
unsigned long saltlen, prng_state *prng,
|
||||
int prng_idx, int hash_idx,
|
||||
unsigned long modulus_bitlen,
|
||||
unsigned char *out, unsigned long *outlen)
|
||||
{
|
||||
unsigned char *DB, *mask, *salt, *hash;
|
||||
unsigned long x, y, hLen, modulus_len;
|
||||
int err;
|
||||
hash_state md;
|
||||
|
||||
LTC_ARGCHK(msghash != NULL);
|
||||
LTC_ARGCHK(out != NULL);
|
||||
LTC_ARGCHK(outlen != NULL);
|
||||
|
||||
/* ensure hash and PRNG are valid */
|
||||
if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
if ((err = prng_is_valid(prng_idx)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
|
||||
hLen = hash_descriptor[hash_idx].hashsize;
|
||||
modulus_len = (modulus_bitlen>>3) + (modulus_bitlen & 7 ? 1 : 0);
|
||||
|
||||
/* check sizes */
|
||||
if ((saltlen > modulus_len) || (modulus_len < hLen + saltlen + 2)) {
|
||||
return CRYPT_PK_INVALID_SIZE;
|
||||
}
|
||||
|
||||
/* allocate ram for DB/mask/salt/hash of size modulus_len */
|
||||
DB = XMALLOC(modulus_len);
|
||||
mask = XMALLOC(modulus_len);
|
||||
salt = XMALLOC(modulus_len);
|
||||
hash = XMALLOC(modulus_len);
|
||||
if (DB == NULL || mask == NULL || salt == NULL || hash == NULL) {
|
||||
if (DB != NULL) {
|
||||
XFREE(DB);
|
||||
}
|
||||
if (mask != NULL) {
|
||||
XFREE(mask);
|
||||
}
|
||||
if (salt != NULL) {
|
||||
XFREE(salt);
|
||||
}
|
||||
if (hash != NULL) {
|
||||
XFREE(hash);
|
||||
}
|
||||
return CRYPT_MEM;
|
||||
}
|
||||
|
||||
|
||||
/* generate random salt */
|
||||
if (saltlen > 0) {
|
||||
if (prng_descriptor[prng_idx].read(salt, saltlen, prng) != saltlen) {
|
||||
err = CRYPT_ERROR_READPRNG;
|
||||
goto LBL_ERR;
|
||||
}
|
||||
}
|
||||
|
||||
/* M = (eight) 0x00 || msghash || salt, hash = H(M) */
|
||||
if ((err = hash_descriptor[hash_idx].init(&md)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
zeromem(DB, 8);
|
||||
if ((err = hash_descriptor[hash_idx].process(&md, DB, 8)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
if ((err = hash_descriptor[hash_idx].process(&md, msghash, msghashlen)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
if ((err = hash_descriptor[hash_idx].process(&md, salt, saltlen)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
if ((err = hash_descriptor[hash_idx].done(&md, hash)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
|
||||
/* generate DB = PS || 0x01 || salt, PS == modulus_len - saltlen - hLen - 2 zero bytes */
|
||||
x = 0;
|
||||
XMEMSET(DB + x, 0, modulus_len - saltlen - hLen - 2);
|
||||
x += modulus_len - saltlen - hLen - 2;
|
||||
DB[x++] = 0x01;
|
||||
XMEMCPY(DB + x, salt, saltlen);
|
||||
x += saltlen;
|
||||
|
||||
/* generate mask of length modulus_len - hLen - 1 from hash */
|
||||
if ((err = pkcs_1_mgf1(hash_idx, hash, hLen, mask, modulus_len - hLen - 1)) != CRYPT_OK) {
|
||||
goto LBL_ERR;
|
||||
}
|
||||
|
||||
/* xor against DB */
|
||||
for (y = 0; y < (modulus_len - hLen - 1); y++) {
|
||||
DB[y] ^= mask[y];
|
||||
}
|
||||
|
||||
/* output is DB || hash || 0xBC */
|
||||
if (*outlen < modulus_len) {
|
||||
*outlen = modulus_len;
|
||||
err = CRYPT_BUFFER_OVERFLOW;
|
||||
goto LBL_ERR;
|
||||
}
|
||||
|
||||
/* DB len = modulus_len - hLen - 1 */
|
||||
y = 0;
|
||||
XMEMCPY(out + y, DB, modulus_len - hLen - 1);
|
||||
y += modulus_len - hLen - 1;
|
||||
|
||||
/* hash */
|
||||
XMEMCPY(out + y, hash, hLen);
|
||||
y += hLen;
|
||||
|
||||
/* 0xBC */
|
||||
out[y] = 0xBC;
|
||||
|
||||
/* now clear the 8*modulus_len - modulus_bitlen most significant bits */
|
||||
out[0] &= 0xFF >> ((modulus_len<<3) - (modulus_bitlen-1));
|
||||
|
||||
/* store output size */
|
||||
*outlen = modulus_len;
|
||||
err = CRYPT_OK;
|
||||
LBL_ERR:
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
zeromem(DB, modulus_len);
|
||||
zeromem(mask, modulus_len);
|
||||
zeromem(salt, modulus_len);
|
||||
zeromem(hash, modulus_len);
|
||||
#endif
|
||||
|
||||
XFREE(hash);
|
||||
XFREE(salt);
|
||||
XFREE(mask);
|
||||
XFREE(DB);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
#endif /* LTC_PKCS_1 */
|
||||
|
||||
/* $Source: /cvs/libtom/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_encode.c,v $ */
|
||||
/* $Revision: 1.9 $ */
|
||||
/* $Date: 2007/05/12 14:32:35 $ */
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*
|
||||
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
|
||||
*/
|
||||
#include "../../headers/tomcrypt.h"
|
||||
|
||||
/*! \file pkcs_1_v1_5_encode.c
|
||||
*
|
||||
* LTC_PKCS #1 v1.5 Padding (Andreas Lange)
|
||||
*/
|
||||
|
||||
#ifdef LTC_PKCS_1
|
||||
|
||||
/*! \brief LTC_PKCS #1 v1.5 encode.
|
||||
*
|
||||
* \param msg The data to encode
|
||||
* \param msglen The length of the data to encode (octets)
|
||||
* \param block_type Block type to use in padding (\sa ltc_pkcs_1_v1_5_blocks)
|
||||
* \param modulus_bitlen The bit length of the RSA modulus
|
||||
* \param prng An active PRNG state (only for LTC_LTC_PKCS_1_EME)
|
||||
* \param prng_idx The index of the PRNG desired (only for LTC_LTC_PKCS_1_EME)
|
||||
* \param out [out] The destination for the encoded data
|
||||
* \param outlen [in/out] The max size and resulting size of the encoded data
|
||||
*
|
||||
* \return CRYPT_OK if successful
|
||||
*/
|
||||
int pkcs_1_v1_5_encode(const unsigned char *msg,
|
||||
unsigned long msglen,
|
||||
int block_type,
|
||||
unsigned long modulus_bitlen,
|
||||
prng_state *prng,
|
||||
int prng_idx,
|
||||
unsigned char *out,
|
||||
unsigned long *outlen)
|
||||
{
|
||||
unsigned long modulus_len, ps_len, i;
|
||||
unsigned char *ps;
|
||||
int result;
|
||||
|
||||
/* valid block_type? */
|
||||
if ((block_type != LTC_LTC_PKCS_1_EMSA) &&
|
||||
(block_type != LTC_LTC_PKCS_1_EME)) {
|
||||
return CRYPT_PK_INVALID_PADDING;
|
||||
}
|
||||
|
||||
if (block_type == LTC_LTC_PKCS_1_EME) { /* encryption padding, we need a valid PRNG */
|
||||
if ((result = prng_is_valid(prng_idx)) != CRYPT_OK) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
modulus_len = (modulus_bitlen >> 3) + (modulus_bitlen & 7 ? 1 : 0);
|
||||
|
||||
/* test message size */
|
||||
if ((msglen + 11) > modulus_len) {
|
||||
return CRYPT_PK_INVALID_SIZE;
|
||||
}
|
||||
|
||||
if (*outlen < modulus_len) {
|
||||
*outlen = modulus_len;
|
||||
result = CRYPT_BUFFER_OVERFLOW;
|
||||
goto bail;
|
||||
}
|
||||
|
||||
/* generate an octets string PS */
|
||||
ps = &out[2];
|
||||
ps_len = modulus_len - msglen - 3;
|
||||
|
||||
if (block_type == LTC_LTC_PKCS_1_EME) {
|
||||
/* now choose a random ps */
|
||||
if (prng_descriptor[prng_idx].read(ps, ps_len, prng) != ps_len) {
|
||||
result = CRYPT_ERROR_READPRNG;
|
||||
goto bail;
|
||||
}
|
||||
|
||||
/* transform zero bytes (if any) to non-zero random bytes */
|
||||
for (i = 0; i < ps_len; i++) {
|
||||
while (ps[i] == 0) {
|
||||
if (prng_descriptor[prng_idx].read(&ps[i], 1, prng) != 1) {
|
||||
result = CRYPT_ERROR_READPRNG;
|
||||
goto bail;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
XMEMSET(ps, 0xFF, ps_len);
|
||||
}
|
||||
|
||||
/* create string of length modulus_len */
|
||||
out[0] = 0x00;
|
||||
out[1] = (unsigned char)block_type; /* block_type 1 or 2 */
|
||||
out[2 + ps_len] = 0x00;
|
||||
XMEMCPY(&out[2 + ps_len + 1], msg, msglen);
|
||||
*outlen = modulus_len;
|
||||
|
||||
result = CRYPT_OK;
|
||||
bail:
|
||||
return result;
|
||||
} /* pkcs_1_v1_5_encode */
|
||||
|
||||
#endif /* #ifdef LTC_PKCS_1 */
|
||||
|
||||
/* $Source: /cvs/libtom/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_encode.c,v $ */
|
||||
/* $Revision: 1.4 $ */
|
||||
/* $Date: 2007/05/12 14:32:35 $ */
|
||||
|
|
@ -1,134 +0,0 @@
|
|||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*
|
||||
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
|
||||
*/
|
||||
#include "../../headers/tomcrypt.h"
|
||||
|
||||
/**
|
||||
@file rsa_sign_hash.c
|
||||
RSA LTC_PKCS #1 v1.5 and v2 PSS sign hash, Tom St Denis and Andreas Lange
|
||||
*/
|
||||
|
||||
#ifdef LTC_MRSA
|
||||
|
||||
/**
|
||||
LTC_PKCS #1 pad then sign
|
||||
@param in The hash to sign
|
||||
@param inlen The length of the hash to sign (octets)
|
||||
@param out [out] The signature
|
||||
@param outlen [in/out] The max size and resulting size of the signature
|
||||
@param padding Type of padding (LTC_LTC_PKCS_1_PSS or LTC_LTC_PKCS_1_V1_5)
|
||||
@param prng An active PRNG state
|
||||
@param prng_idx The index of the PRNG desired
|
||||
@param hash_idx The index of the hash desired
|
||||
@param saltlen The length of the salt desired (octets)
|
||||
@param key The private RSA key to use
|
||||
@return CRYPT_OK if successful
|
||||
*/
|
||||
int rsa_sign_hash_ex(const unsigned char *in, unsigned long inlen,
|
||||
unsigned char *out, unsigned long *outlen,
|
||||
int padding,
|
||||
prng_state *prng, int prng_idx,
|
||||
int hash_idx, unsigned long saltlen,
|
||||
rsa_key *key)
|
||||
{
|
||||
unsigned long modulus_bitlen, modulus_bytelen, x, y;
|
||||
int err;
|
||||
|
||||
LTC_ARGCHK(in != NULL);
|
||||
LTC_ARGCHK(out != NULL);
|
||||
LTC_ARGCHK(outlen != NULL);
|
||||
LTC_ARGCHK(key != NULL);
|
||||
|
||||
/* valid padding? */
|
||||
if ((padding != LTC_LTC_PKCS_1_V1_5) && (padding != LTC_LTC_PKCS_1_PSS)) {
|
||||
return CRYPT_PK_INVALID_PADDING;
|
||||
}
|
||||
|
||||
if (padding == LTC_LTC_PKCS_1_PSS) {
|
||||
/* valid prng and hash ? */
|
||||
if ((err = prng_is_valid(prng_idx)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
/* get modulus len in bits */
|
||||
modulus_bitlen = mp_count_bits((key->N));
|
||||
|
||||
/* outlen must be at least the size of the modulus */
|
||||
modulus_bytelen = mp_unsigned_bin_size((key->N));
|
||||
if (modulus_bytelen > *outlen) {
|
||||
*outlen = modulus_bytelen;
|
||||
return CRYPT_BUFFER_OVERFLOW;
|
||||
}
|
||||
|
||||
if (padding == LTC_LTC_PKCS_1_PSS) {
|
||||
/* PSS pad the key */
|
||||
x = *outlen;
|
||||
if ((err = pkcs_1_pss_encode(in, inlen, saltlen, prng, prng_idx,
|
||||
hash_idx, modulus_bitlen, out, &x)) != CRYPT_OK) {
|
||||
return err;
|
||||
}
|
||||
} else {
|
||||
/* LTC_PKCS #1 v1.5 pad the hash */
|
||||
unsigned char *tmpin;
|
||||
ltc_asn1_list digestinfo[2], siginfo[2];
|
||||
|
||||
/* not all hashes have OIDs... so sad */
|
||||
if (hash_descriptor[hash_idx].OIDlen == 0) {
|
||||
return CRYPT_INVALID_ARG;
|
||||
}
|
||||
|
||||
/* construct the SEQUENCE
|
||||
SEQUENCE {
|
||||
SEQUENCE {hashoid OID
|
||||
blah NULL
|
||||
}
|
||||
hash OCTET STRING
|
||||
}
|
||||
*/
|
||||
LTC_SET_ASN1(digestinfo, 0, LTC_ASN1_OBJECT_IDENTIFIER, hash_descriptor[hash_idx].OID, hash_descriptor[hash_idx].OIDlen);
|
||||
LTC_SET_ASN1(digestinfo, 1, LTC_ASN1_NULL, NULL, 0);
|
||||
LTC_SET_ASN1(siginfo, 0, LTC_ASN1_SEQUENCE, digestinfo, 2);
|
||||
LTC_SET_ASN1(siginfo, 1, LTC_ASN1_OCTET_STRING, in, inlen);
|
||||
|
||||
/* allocate memory for the encoding */
|
||||
y = mp_unsigned_bin_size(key->N);
|
||||
tmpin = XMALLOC(y);
|
||||
if (tmpin == NULL) {
|
||||
return CRYPT_MEM;
|
||||
}
|
||||
|
||||
if ((err = der_encode_sequence(siginfo, 2, tmpin, &y)) != CRYPT_OK) {
|
||||
XFREE(tmpin);
|
||||
return err;
|
||||
}
|
||||
|
||||
x = *outlen;
|
||||
if ((err = pkcs_1_v1_5_encode(tmpin, y, LTC_LTC_PKCS_1_EMSA,
|
||||
modulus_bitlen, NULL, 0,
|
||||
out, &x)) != CRYPT_OK) {
|
||||
XFREE(tmpin);
|
||||
return err;
|
||||
}
|
||||
XFREE(tmpin);
|
||||
}
|
||||
|
||||
/* RSA encode it */
|
||||
return ltc_mp.rsa_me(out, x, out, outlen, PK_PRIVATE, key);
|
||||
}
|
||||
|
||||
#endif /* LTC_MRSA */
|
||||
|
||||
/* $Source: /cvs/libtom/libtomcrypt/src/pk/rsa/rsa_sign_hash.c,v $ */
|
||||
/* $Revision: 1.11 $ */
|
||||
/* $Date: 2007/05/12 14:32:35 $ */
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*
|
||||
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
|
||||
*/
|
||||
#include "rsa_verify_simple.h"
|
||||
|
||||
/**
|
||||
@file rsa_verify_simple.c
|
||||
Created by Ladislav Zezula (zezula@volny.cz) as modification
|
||||
for Blizzard strong signature verification
|
||||
*/
|
||||
|
||||
#ifdef LTC_MRSA
|
||||
|
||||
/**
|
||||
Simple RSA decryption
|
||||
@param sig The signature data
|
||||
@param siglen The length of the signature data (octets)
|
||||
@param hash The hash of the message that was signed
|
||||
@param hashlen The length of the hash of the message that was signed (octets)
|
||||
@param stat [out] The result of the signature comparison, 1==valid, 0==invalid
|
||||
@param key The public RSA key corresponding
|
||||
@return Error code
|
||||
*/
|
||||
int rsa_verify_simple(const unsigned char *sig, unsigned long siglen,
|
||||
const unsigned char *hash, unsigned long hashlen,
|
||||
int *stat,
|
||||
rsa_key *key)
|
||||
{
|
||||
unsigned long modulus_bitlen, modulus_bytelen, x;
|
||||
unsigned char *tmpbuf;
|
||||
int err;
|
||||
|
||||
LTC_ARGCHK(sig != NULL);
|
||||
LTC_ARGCHK(hash != NULL);
|
||||
LTC_ARGCHK(stat != NULL);
|
||||
LTC_ARGCHK(key != NULL);
|
||||
|
||||
/* default to invalid */
|
||||
*stat = 0;
|
||||
|
||||
/* get modulus len in bits */
|
||||
modulus_bitlen = mp_count_bits( (key->N));
|
||||
|
||||
/* outlen must be at least the size of the modulus */
|
||||
modulus_bytelen = mp_unsigned_bin_size( (key->N));
|
||||
if (modulus_bytelen != siglen) {
|
||||
return CRYPT_INVALID_PACKET;
|
||||
}
|
||||
|
||||
/* allocate temp buffer for decoded sig */
|
||||
tmpbuf = XMALLOC(siglen);
|
||||
if (tmpbuf == NULL) {
|
||||
return CRYPT_MEM;
|
||||
}
|
||||
|
||||
/* RSA decode it */
|
||||
x = siglen;
|
||||
if ((err = ltc_mp.rsa_me(sig, siglen, tmpbuf, &x, PK_PUBLIC, key)) != CRYPT_OK) {
|
||||
XFREE(tmpbuf);
|
||||
return err;
|
||||
}
|
||||
|
||||
/* make sure the output is the right size */
|
||||
if (x != siglen) {
|
||||
XFREE(tmpbuf);
|
||||
return CRYPT_INVALID_PACKET;
|
||||
}
|
||||
|
||||
/* compare the decrypted signature with the given hash */
|
||||
if(x == hashlen && XMEMCMP(tmpbuf, hash, hashlen) == 0)
|
||||
*stat = 1;
|
||||
|
||||
#ifdef LTC_CLEAN_STACK
|
||||
zeromem(tmpbuf, siglen);
|
||||
#endif
|
||||
XFREE(tmpbuf);
|
||||
return CRYPT_OK;
|
||||
}
|
||||
|
||||
#endif /* LTC_MRSA */
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
|
||||
*
|
||||
* LibTomCrypt is a library that provides various cryptographic
|
||||
* algorithms in a highly modular and flexible manner.
|
||||
*
|
||||
* The library is free for all purposes without any express
|
||||
* guarantee it works.
|
||||
*
|
||||
* Tom St Denis, tomstdenis@gmail.com, http://libtom.org
|
||||
*/
|
||||
#ifndef __RSA_VERIFY_SIMPLE_H
|
||||
#define __RSA_VERIFY_SIMPLE_H
|
||||
|
||||
#include "tomcrypt.h"
|
||||
|
||||
/**
|
||||
@file rsa_verify_simple.c
|
||||
Created by Ladislav Zezula (zezula@volny.cz) as modification
|
||||
for Blizzard strong signature verification
|
||||
*/
|
||||
|
||||
#ifdef LTC_MRSA
|
||||
|
||||
/**
|
||||
Simple RSA decryption
|
||||
@param sig The signature data
|
||||
@param siglen The length of the signature data (octets)
|
||||
@param hash The hash of the message that was signed
|
||||
@param hashlen The length of the hash of the message that was signed (octets)
|
||||
@param stat [out] The result of the signature comparison, 1==valid, 0==invalid
|
||||
@param key The public RSA key corresponding
|
||||
@return Error code
|
||||
*/
|
||||
int rsa_verify_simple(const unsigned char *sig, unsigned long siglen,
|
||||
const unsigned char *hash, unsigned long hashlen,
|
||||
int *stat,
|
||||
rsa_key *key);
|
||||
#endif /* LTC_MRSA */
|
||||
|
||||
#endif
|
||||
|
|
@ -1,80 +0,0 @@
|
|||
/* compress.c -- compress a memory buffer
|
||||
* Copyright (C) 1995-2005 Jean-loup Gailly.
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* @(#) $Id$ */
|
||||
|
||||
#define ZLIB_INTERNAL
|
||||
#include "zlib.h"
|
||||
|
||||
/* ===========================================================================
|
||||
Compresses the source buffer into the destination buffer. The level
|
||||
parameter has the same meaning as in deflateInit. sourceLen is the byte
|
||||
length of the source buffer. Upon entry, destLen is the total size of the
|
||||
destination buffer, which must be at least 0.1% larger than sourceLen plus
|
||||
12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
|
||||
|
||||
compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
|
||||
memory, Z_BUF_ERROR if there was not enough room in the output buffer,
|
||||
Z_STREAM_ERROR if the level parameter is invalid.
|
||||
*/
|
||||
int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
|
||||
Bytef *dest;
|
||||
uLongf *destLen;
|
||||
const Bytef *source;
|
||||
uLong sourceLen;
|
||||
int level;
|
||||
{
|
||||
z_stream stream;
|
||||
int err;
|
||||
|
||||
stream.next_in = (Bytef*)source;
|
||||
stream.avail_in = (uInt)sourceLen;
|
||||
#ifdef MAXSEG_64K
|
||||
/* Check for source > 64K on 16-bit machine: */
|
||||
if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
|
||||
#endif
|
||||
stream.next_out = dest;
|
||||
stream.avail_out = (uInt)*destLen;
|
||||
if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
|
||||
|
||||
stream.zalloc = (alloc_func)0;
|
||||
stream.zfree = (free_func)0;
|
||||
stream.opaque = (voidpf)0;
|
||||
|
||||
err = deflateInit(&stream, level);
|
||||
if (err != Z_OK) return err;
|
||||
|
||||
err = deflate(&stream, Z_FINISH);
|
||||
if (err != Z_STREAM_END) {
|
||||
deflateEnd(&stream);
|
||||
return err == Z_OK ? Z_BUF_ERROR : err;
|
||||
}
|
||||
*destLen = stream.total_out;
|
||||
|
||||
err = deflateEnd(&stream);
|
||||
return err;
|
||||
}
|
||||
|
||||
/* ===========================================================================
|
||||
*/
|
||||
int ZEXPORT compress (dest, destLen, source, sourceLen)
|
||||
Bytef *dest;
|
||||
uLongf *destLen;
|
||||
const Bytef *source;
|
||||
uLong sourceLen;
|
||||
{
|
||||
return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION);
|
||||
}
|
||||
|
||||
/* ===========================================================================
|
||||
If the default memLevel or windowBits for deflateInit() is changed, then
|
||||
this function needs to be updated.
|
||||
*/
|
||||
uLong ZEXPORT compressBound (sourceLen)
|
||||
uLong sourceLen;
|
||||
{
|
||||
return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
|
||||
(sourceLen >> 25) + 13;
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
// Some compilers (e.g. Visual Studio 2012) don't like the name conflict between
|
||||
// zlib\compress.c and bzip2\compress.c. This file is plain wrapper for compress.c
|
||||
// in order to create obj file with a different name.
|
||||
|
||||
#include "compress.c"
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
Douglas C. Schmidt
|
||||
d.schmidt@vanderbilt.edu
|
||||
|
||||
Professor of Computer Science
|
||||
Associate Chair of Computer Science and Engineering
|
||||
Department of Electrical Engineering and Computer Science
|
||||
Senior Researcher at the Institute for Software Integrated Systems (ISIS)
|
||||
Vanderbilt University
|
||||
Nashville, TN 37203
|
||||
|
||||
www.dre.vanderbilt.edu/~schmidt
|
||||
TEL: (615) 343-8197
|
||||
FAX: (615) 343-7440
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
#
|
||||
# This code is part of MaNGOS. Contributor & Copyright details are in AUTHORS/THANKS.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under 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.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU 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
|
||||
#
|
||||
|
||||
add_subdirectory(ace)
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
|
||||
_________________________________________________________________
|
||||
|
||||
Copyright and Licensing Information for ACE(TM), TAO(TM), CIAO(TM),
|
||||
DAnCE(TM), and CoSMIC(TM)
|
||||
|
||||
[1]ACE(TM), [2]TAO(TM), [3]CIAO(TM), DAnCE(TM), and [4]CoSMIC(TM)
|
||||
(henceforth referred to as "DOC software") are copyrighted by
|
||||
[5]Douglas C. Schmidt and his [6]research group at [7]Washington
|
||||
University, [8]University of California, Irvine, and [9]Vanderbilt
|
||||
University, Copyright (c) 1993-2014, all rights reserved. Since DOC
|
||||
software is open-source, freely available software, you are free to
|
||||
use, modify, copy, and distribute--perpetually and irrevocably--the
|
||||
DOC software source code and object code produced from the source, as
|
||||
well as copy and distribute modified versions of this software. You
|
||||
must, however, include this copyright statement along with any code
|
||||
built using DOC software that you release. No copyright statement
|
||||
needs to be provided if you just ship binary executables of your
|
||||
software products.
|
||||
|
||||
You can use DOC software in commercial and/or binary software releases
|
||||
and are under no obligation to redistribute any of your source code
|
||||
that is built using DOC software. Note, however, that you may not
|
||||
misappropriate the DOC software code, such as copyrighting it yourself
|
||||
or claiming authorship of the DOC software code, in a way that will
|
||||
prevent DOC software from being distributed freely using an
|
||||
open-source development model. You needn't inform anyone that you're
|
||||
using DOC software in your software, though we encourage you to let
|
||||
[10]us know so we can promote your project in the [11]DOC software
|
||||
success stories.
|
||||
|
||||
The [12]ACE, [13]TAO, [14]CIAO, [15]DAnCE, and [16]CoSMIC web sites
|
||||
are maintained by the [17]DOC Group at the [18]Institute for Software
|
||||
Integrated Systems (ISIS) and the [19]Center for Distributed Object
|
||||
Computing of Washington University, St. Louis for the development of
|
||||
open-source software as part of the open-source software community.
|
||||
Submissions are provided by the submitter ``as is'' with no warranties
|
||||
whatsoever, including any warranty of merchantability, noninfringement
|
||||
of third party intellectual property, or fitness for any particular
|
||||
purpose. In no event shall the submitter be liable for any direct,
|
||||
indirect, special, exemplary, punitive, or consequential damages,
|
||||
including without limitation, lost profits, even if advised of the
|
||||
possibility of such damages. Likewise, DOC software is provided as is
|
||||
with no warranties of any kind, including the warranties of design,
|
||||
merchantability, and fitness for a particular purpose,
|
||||
noninfringement, or arising from a course of dealing, usage or trade
|
||||
practice. Washington University, UC Irvine, Vanderbilt University,
|
||||
their employees, and students shall have no liability with respect to
|
||||
the infringement of copyrights, trade secrets or any patents by DOC
|
||||
software or any part thereof. Moreover, in no event will Washington
|
||||
University, UC Irvine, or Vanderbilt University, their employees, or
|
||||
students be liable for any lost revenue or profits or other special,
|
||||
indirect and consequential damages.
|
||||
|
||||
DOC software is provided with no support and without any obligation on
|
||||
the part of Washington University, UC Irvine, Vanderbilt University,
|
||||
their employees, or students to assist in its use, correction,
|
||||
modification, or enhancement. A [20]number of companies around the
|
||||
world provide commercial support for DOC software, however. DOC
|
||||
software is Y2K-compliant, as long as the underlying OS platform is
|
||||
Y2K-compliant. Likewise, DOC software is compliant with the new US
|
||||
daylight savings rule passed by Congress as "The Energy Policy Act of
|
||||
2005," which established new daylight savings times (DST) rules for
|
||||
the United States that expand DST as of March 2007. Since DOC software
|
||||
obtains time/date and calendaring information from operating systems
|
||||
users will not be affected by the new DST rules as long as they
|
||||
upgrade their operating systems accordingly.
|
||||
|
||||
The names ACE(TM), TAO(TM), CIAO(TM), DAnCE(TM), CoSMIC(TM),
|
||||
Washington University, UC Irvine, and Vanderbilt University, may not
|
||||
be used to endorse or promote products or services derived from this
|
||||
source without express written permission from Washington University,
|
||||
UC Irvine, or Vanderbilt University. This license grants no permission
|
||||
to call products or services derived from this source ACE(TM),
|
||||
TAO(TM), CIAO(TM), DAnCE(TM), or CoSMIC(TM), nor does it grant
|
||||
permission for the name Washington University, UC Irvine, or
|
||||
Vanderbilt University to appear in their names.
|
||||
|
||||
If you have any suggestions, additions, comments, or questions, please
|
||||
let [21]me know.
|
||||
|
||||
[22]Douglas C. Schmidt
|
||||
_________________________________________________________________
|
||||
|
||||
Back to the [23]ACE home page.
|
||||
|
||||
References
|
||||
|
||||
1. http://www.cs.wustl.edu/~schmidt/ACE.html
|
||||
2. http://www.cs.wustl.edu/~schmidt/TAO.html
|
||||
3. http://www.dre.vanderbilt.edu/CIAO/
|
||||
4. http://www.dre.vanderbilt.edu/cosmic/
|
||||
5. http://www.dre.vanderbilt.edu/~schmidt/
|
||||
6. http://www.cs.wustl.edu/~schmidt/ACE-members.html
|
||||
7. http://www.wustl.edu/
|
||||
8. http://www.uci.edu/
|
||||
9. http://www.vanderbilt.edu/
|
||||
10. mailto:doc_group@cs.wustl.edu
|
||||
11. http://www.cs.wustl.edu/~schmidt/ACE-users.html
|
||||
12. http://www.cs.wustl.edu/~schmidt/ACE.html
|
||||
13. http://www.cs.wustl.edu/~schmidt/TAO.html
|
||||
14. http://www.dre.vanderbilt.edu/CIAO/
|
||||
15. http://www.dre.vanderbilt.edu/~schmidt/DOC_ROOT/DAnCE/
|
||||
16. http://www.dre.vanderbilt.edu/cosmic/
|
||||
17. http://www.dre.vanderbilt.edu/
|
||||
18. http://www.isis.vanderbilt.edu/
|
||||
19. http://www.cs.wustl.edu/~schmidt/doc-center.html
|
||||
20. http://www.cs.wustl.edu/~schmidt/commercial-support.html
|
||||
21. mailto:d.schmidt@vanderbilt.edu
|
||||
22. http://www.dre.vanderbilt.edu/~schmidt/
|
||||
23. http://www.cs.wustl.edu/ACE.html
|
||||
|
|
@ -1,256 +0,0 @@
|
|||
Fri Nov 14 08:38:16 CET 2014 Johnny Willemsen <jwillemsen@remedy.nl>
|
||||
|
||||
* ACE version 6.3.0 released.
|
||||
|
||||
Thu Nov 13 11:31:37 UTC 2014 Steve Huston <shuston@riverace.com>
|
||||
|
||||
* ace/config-lite.h: Adjust ACE_DECLARE_STL_REVERSE_ITERATORS to
|
||||
work with Solaris Studio 12.4.
|
||||
|
||||
* NEWS: Note support for Solaris Studio 12.4.
|
||||
|
||||
Mon Nov 10 15:45:42 UTC 2014 Johnny Willemsen <willemsen_j@remedy.nl>
|
||||
|
||||
* ace/CDR_Stream.h:
|
||||
Doxygen fixes
|
||||
|
||||
Mon Nov 10 12:39:18 UTC 2014 Martin Corino <mcorino@remedy.nl>
|
||||
|
||||
* NEWS:
|
||||
Updated.
|
||||
|
||||
Thu Nov 6 19:45:38 UTC 2014 Johnny Willemsen <willemsen_j@remedy.nl>
|
||||
|
||||
* bin/MakeProjectCreator/config/vc_warnings.mpb:
|
||||
Visual Studio 2013 Update 3 gives a lot of warnings on deprecated
|
||||
ascii winsock calls but they just work, so no need to change our
|
||||
code. Added new feature vc_avoid_winsock_warnings which is enabled
|
||||
by default, this adds _WINSOCK_DEPRECATED_NO_WARNINGS to the
|
||||
compiler falgs. If you want to see all warnings, set
|
||||
vc_avoid_winsock_warnings to 0 in your default.features file before
|
||||
generatin the project files
|
||||
|
||||
Tue Nov 4 14:37:56 UTC 2014 Johnny Willemsen <jwillemsen@remedy.nl>
|
||||
|
||||
* etc/ace_inet.doxygen:
|
||||
* etc/ace_qos.doxygen:
|
||||
* etc/ace_rmcast.doxygen:
|
||||
* etc/ace_ssl.doxygen:
|
||||
* etc/acexml.doxygen:
|
||||
Set UML_LOOK to NO, with UML look all members/methods are shown
|
||||
in the diagrams making them unusable
|
||||
|
||||
Mon Nov 3 12:50:28 UTC 2014 Martin Corino <mcorino@remedy.nl>
|
||||
|
||||
* ace/WIN32_Asynch_IO.cpp:
|
||||
Do not pass holder for bytes written when using OVERLAPPED IO.
|
||||
Pass NULL instead. Recommended by MSDN.
|
||||
|
||||
* tests/Proactor_File_Test.cpp:
|
||||
Circumvent problems with unreliable Async IO on older Win32
|
||||
(WinXP, Win2003/2008).
|
||||
|
||||
Fri Oct 31 14:10:52 UTC 2014 Johnny Willemsen <jwillemsen@remedy.nl>
|
||||
|
||||
* rpmbuild/ace-tao.spec:
|
||||
No need for lsb
|
||||
|
||||
Fri Oct 31 13:49:11 UTC 2014 Martin Corino <mcorino@remedy.nl>
|
||||
|
||||
* ace/WIN32_Asynch_IO.h:
|
||||
* ace/WIN32_Asynch_IO.cpp:
|
||||
Changed ACE_WIN32_Asynch_Write classes to not use shared_write() method
|
||||
for Stream and File IO but use specific write() implementations instead.
|
||||
This fixes Asynch File IO support (specifically writing) for Windows.
|
||||
Fixes Bugzilla #3762 and #3992.
|
||||
|
||||
* tests/Proactor_File_Test.cpp:
|
||||
* tests/run_test.lst:
|
||||
* tests/tests.mpc:
|
||||
Added new example/regression test for Asynch File IO using Proactor.
|
||||
|
||||
Wed Oct 29 20:22:38 UTC 2014 Steve Huston <shuston@riverace.com>
|
||||
|
||||
* bin/MakeProjectCreator/templates/gnu.mpd: Change LDFLAGS for HP-UX to do install_rpath correctly.
|
||||
Fixes Bugzilla #4170.
|
||||
|
||||
Tue Oct 28 09:51:14 UTC 2014 Martin Corino <mcorino@remedy.nl>
|
||||
|
||||
* bin/MakeProjectCreator/docs/templates/gnu.txt:
|
||||
* bin/MakeProjectCreator/templates/gnu.mpd:
|
||||
* include/makeinclude/wrapper_macros.GNU:
|
||||
Added (optional) support for per project output directories for
|
||||
object files. Fixes Bugzilla #3868.
|
||||
|
||||
Tue Oct 28 08:00:15 UTC 2014 Johnny Willemsen <jwillemsen@remedy.nl>
|
||||
|
||||
* tests/Bug_4189_Regression_Test.cpp:
|
||||
Use PF_INET, that is the default argument of ACE_SOCK_Dgram_Bcast
|
||||
|
||||
Mon Oct 27 18:06:17 UTC 2014 Johnny Willemsen <jwillemsen@remedy.nl>
|
||||
|
||||
* ace/config-win32-common.h:
|
||||
Don't define SO_REUSEPORT when it is not defined, the code
|
||||
that uses this as argument to call ACE_OS::setsockopt only works
|
||||
when this has been defined. Defining it here to a dummy value
|
||||
causes us to call the Windows API with an invalid argument
|
||||
|
||||
Mon Oct 27 12:32:17 UTC 2014 Johnny Willemsen <jwillemsen@remedy.nl>
|
||||
|
||||
* ace/config-win32-common.h:
|
||||
* ace/os_include/sys/os_types.h:
|
||||
Introduce new ACE_LACKS_PID_T which is set on Windows, but
|
||||
not with MinGW
|
||||
|
||||
Mon Oct 27 07:57:57 UTC 2014 Johnny Willemsen <jwillemsen@remedy.nl>
|
||||
|
||||
* ace/OS_NS_sys_socket.inl:
|
||||
Removed the ignore of SO_REUSEADDR on windows, this is needed
|
||||
for ACE_SOCK_Dgram_Bcast to work, see bugzilla 4189. Also removed
|
||||
the Windows specific change of SO_REUSEPORT to SO_REUSEADDR, this
|
||||
are different flags that we should not merge at this level.
|
||||
|
||||
Fri Oct 24 18:41:42 UTC 2014 Johnny Willemsen <jwillemsen@remedy.nl>
|
||||
|
||||
* tests/Bug_4189_Regression_Test.cpp:
|
||||
* tests/run_test.lst:
|
||||
* tests/tests.mpc:
|
||||
New test for bugzilla 4189, on Windows it is not possible
|
||||
at this moment to open a ACE_SOCK_Dgram_Bcast multiple times
|
||||
on the same port, even when reuse_addr has been set to 1
|
||||
|
||||
Thu Oct 23 19:41:00 UTC 2014 Steve Huston <shuston@riverace.com>
|
||||
|
||||
* tests/Naming_Test.cpp: Fixed data type warning for conversion on
|
||||
%d formatting for Mingw.
|
||||
|
||||
Tue Oct 21 15:45:59 UTC 2014 Phil Mesnier <mesnier_p@ociweb.com>
|
||||
|
||||
* ace/ETCL/ETCL_l.cpp:
|
||||
Scoreboard cleanup.
|
||||
|
||||
Mon Oct 20 15:37:35 UTC 2014 Phil Mesnier <mesnier_p@ociweb.com>
|
||||
|
||||
* ACEXML/common/XMLFilterImpl.h:
|
||||
* ACEXML/common/XMLFilterImpl.cpp:
|
||||
* ACEXML/parser/parser/Entity_Manager.h:
|
||||
* ace/ETCL/ETCL_l.cpp:
|
||||
* protocols/ace/RMCast/Flow.h:
|
||||
* protocols/ace/RMCast/Flow.cpp:
|
||||
* protocols/ace/RMCast/Reassemble.h:
|
||||
* protocols/ace/RMCast/Reassemble.cpp:
|
||||
* protocols/ace/TMCast/TransactionController.hpp:
|
||||
Clean up unused member warnings identified by clang 6.0.
|
||||
|
||||
* bin/PerlACE/Process_Unix.pm:
|
||||
increase the valgrind wait factor to accommodate slower machines.
|
||||
|
||||
Mon Oct 13 18:59:00 UTC 2014 Steve Huston <shuston@riverace.com>
|
||||
|
||||
* apps/mkcsregdb/mkcsregdb.cpp: Fix data type error on Windows.
|
||||
|
||||
Mon Oct 13 17:24:21 UTC 2014 Johnny Willemsen <jwillemsen@remedy.nl>
|
||||
|
||||
* docs/bczar/bczar.html:
|
||||
Added package for killall
|
||||
|
||||
Sat Oct 11 21:09:07 UTC 2014 Steve Huston <shuston@.riverace.com>
|
||||
|
||||
* ace/Process.cpp (ACE_Process_Options::setenv (const ACE_TCHAR *, ...):
|
||||
Avoid the secret, magic number buried in ACE_OS::vsprintf() for
|
||||
platforms that support ACE_OS::vsnprintf. Allows full use of
|
||||
DEFAULT_COMMAND_LINE_BUF_LEN as well as customizing that value
|
||||
to a higher size. Thanks to John Lilley for this improvement.
|
||||
|
||||
Sat Oct 11 20:45:03 UTC 2014 Steve Huston <shuston@riverace.com>
|
||||
|
||||
* apps/drwho/File_Manager.cpp: Fixed const-ness compile warning.
|
||||
|
||||
Thu Oct 9 16:21:38 UTC 2014 Steve Huston <shuston@riverace.com>
|
||||
|
||||
* NEWS: Add description of the below changes.
|
||||
|
||||
* ace/OS_NS_stdlib.{h inl cpp}:
|
||||
* ace/OS_NS_stdio.{h inl}:
|
||||
* ace/README:
|
||||
Added new feature config macros ACE_DISABLE_MKTEMP and
|
||||
ACE_DISABLE_TEMPNAM. These disable the ACE wrappers for
|
||||
mktemp() and tempnam(), respectively. Those functions are
|
||||
considered insecure and better replaced by the use of mkstemp().
|
||||
|
||||
* ace/FILE_Addr.cpp (set): Call to set(const ACE_FILE_Addr&) using
|
||||
the default "any" address will now fail if ACE_DISABLE_MKTEMP is
|
||||
set.
|
||||
|
||||
* ace/FILE_Connector.cpp (connect): Specifying 'any' for the
|
||||
address now uses ACE_OS::mkstemp(). Contrast this with setting a
|
||||
ACE_FILE_Addr with 'any', above.
|
||||
|
||||
* ace/MMAP_Memory_Pool.cpp (constructor): Using the 'unique' option
|
||||
will no longer work if ACE_DISABLE_MKTEMP is set.
|
||||
|
||||
* tests/MM_Shared_Memory_Test.cpp:
|
||||
Will not work if ACE_DISABLE_MKTEMP is set.
|
||||
|
||||
* tests/Naming_Test.cpp:
|
||||
Changed to avoid use of ACE_OS::tempnam.
|
||||
|
||||
* tests/Svc_Handler_Test.cpp: Modified to work with or without
|
||||
ACE_DISABLE_MKTEMP.
|
||||
|
||||
* apps/mkcsregdb/mkcsregdb.cpp:
|
||||
* apps/drwho/File_Manager.cpp:
|
||||
Use ACE_OS::mkstemp.
|
||||
|
||||
* examples/OS/Process/imore.cpp:
|
||||
* examples/Service_Configurator/IPC-tests/client/local_dgram_client.cpp:
|
||||
Won't work if ACE_DISABLE_TEMPNAM is set.
|
||||
|
||||
Tue Oct 7 21:55:51 UTC 2014 Steve Huston <shuston@riverace.com>
|
||||
|
||||
Set of changes applicable to VxWorks, particularly 6.9. These changes
|
||||
were contributed by Jeff Fowler and Gordon Hulpieu at NetApp. Feel
|
||||
free to contact me with any issues.
|
||||
|
||||
* ace/OS_NS_Thread.{h cpp inl}: Change from using the VxWorks TCB
|
||||
spare4 value to a new static member of ACE_TSS_Emulation. This
|
||||
mechanism covers both VxWorks multicore (SMP) using the __thread
|
||||
attribute and single core using Task Var. This change gets ACE out
|
||||
of the way of the applications that use spare4 for their own
|
||||
purposes.
|
||||
Also fixes for various compiler warnings.
|
||||
|
||||
* ace/OS_NS_sys_socket.inl (accept): Add IPv6 case to the
|
||||
ACE_HAS_BROKEN_ACCEPT_ADDR case.
|
||||
|
||||
* ace/config-vxworks6.9.h: Correct the ACE_HAS_BROKEN_ACCEPT_ADDR
|
||||
setting for VxWorks 6.9+.
|
||||
|
||||
* ace/OS_NS_dlfcn.inl (dlsym): For VxWorks, use the symFind() call
|
||||
instead of the deprecated symFindByName().
|
||||
|
||||
* ace/Process.cpp: Fix a weird compile diagnostic by adding what should
|
||||
be a needless space.
|
||||
|
||||
* include/makeinclude/platform_vxworks6.9.GNU: Update MUNCH_FLAGS
|
||||
for this version.
|
||||
|
||||
Tue Sep 30 13:34:34 UTC 2014 Johnny Willemsen <jwillemsen@remedy.nl>
|
||||
|
||||
* include/makeinclude/platform_g++_common.GNU:
|
||||
Add -Wnon-virtual-dtor to the default CCFLAGS
|
||||
|
||||
Fri Sep 26 09:58:57 UTC 2014 Olli Savia <ops@iki.fi>
|
||||
|
||||
* tests/Message_Block_Large_Copy_Test.cpp:
|
||||
Fixed compile error on LynxOS.
|
||||
|
||||
Wed Sep 24 19:51:44 CEST 2014 Johnny Willemsen <jwillemsen@remedy.nl>
|
||||
|
||||
* ACE version 6.2.8 released.
|
||||
|
||||
Local Variables:
|
||||
mode: change-log
|
||||
add-log-time-format: (lambda () (progn (setq tz (getenv "TZ")) (set-time-zone-rule "UTC") (setq time (format-time-string "%a %b %e %H:%M:%S %Z %Y" (current-time))) (set-time-zone-rule tz) time))
|
||||
indent-tabs-mode: nil
|
||||
End:
|
||||
2048
dep/acelite/NEWS
2048
dep/acelite/NEWS
File diff suppressed because it is too large
Load diff
|
|
@ -1,87 +0,0 @@
|
|||
[Please use the PRF form below to submit bug reports, problem reports,
|
||||
etc., to the ACE developers and interested users. Send it to
|
||||
ace-bugs@list.isis.vanderbilt.edu, you must be subscribed to the list
|
||||
in order to be able to post to it. If you are using OCI, PrismTech, or
|
||||
Riverace's versions of ACE do not send bugs to this mailing list, but
|
||||
instead contact those companies for support. Please also send your
|
||||
PRF as plain ASCII text, _not_ uuencoded or as an attachment.
|
||||
|
||||
We prefer that all bug reports be submitted through our bug tracking
|
||||
system. See $ACE_ROOT/docs/usage-bugzilla.html for more information
|
||||
about how to do this. If you are unsure as to whether your problem
|
||||
is a real bug or not then please submit your question to the mailing
|
||||
list using the following form. Not using the problem report form
|
||||
will make it harder or impossible to identify the problem, and in
|
||||
many cases we will be unable to help at all. Also please try to
|
||||
browse bugzilla and the ChangeLog files to find out if your problem
|
||||
has been solved in a more recent version of ACE.
|
||||
|
||||
To subscribe to the list see
|
||||
http://www.dre.vanderbilt.edu/~schmidt/ACE-mail.html
|
||||
|
||||
Replace/remove all the explanatory text in brackets before mailing.
|
||||
|
||||
Please send this form as ASCII text only. Do _not_ send it as an
|
||||
attachment, or as tar'ed, compressed and/or uuencoded text. And
|
||||
limit line lengths to less than 80 characters.
|
||||
|
||||
PLEASE make your Subject: line as descriptive as possible.
|
||||
Subjects like "ACE bug" or "bug report" are not helpful!
|
||||
Also, do _not_ include the word "help" in the Subject!]
|
||||
|
||||
When including your config.h and platform_macros.GNU files as requested
|
||||
below, only include the contents if you use the recommended method of
|
||||
including the platform-specific file in your file. If you use a link
|
||||
to the platform-specific file, simply state which one - DO NOT
|
||||
include an entire platform-specific configuration file in the form.
|
||||
|
||||
8<----------8<----------8<----------8<----------8<----------8<----------8<----
|
||||
|
||||
To: ace-bugs@list.isis.vanderbilt.edu
|
||||
Subject: [area]: [synopsis]
|
||||
|
||||
ACE VERSION: 6.3.0
|
||||
|
||||
HOST MACHINE and OPERATING SYSTEM:
|
||||
If on Windows based OS's, which version of WINSOCK do you
|
||||
use?:
|
||||
|
||||
TARGET MACHINE and OPERATING SYSTEM, if different from HOST:
|
||||
COMPILER NAME AND VERSION (AND PATCHLEVEL):
|
||||
|
||||
THE $ACE_ROOT/ace/config.h FILE [if you use a link to a platform-
|
||||
specific file, simply state which one]:
|
||||
|
||||
THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE [if you
|
||||
use a link to a platform-specific file, simply state which one
|
||||
(unless this isn't used in this case, e.g., with Microsoft Visual
|
||||
C++)]:
|
||||
|
||||
CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/default.features
|
||||
(used by MPC when you generate your own makefiles):
|
||||
|
||||
AREA/CLASS/EXAMPLE AFFECTED:
|
||||
[What example failed? What module failed to compile?]
|
||||
|
||||
DOES THE PROBLEM AFFECT:
|
||||
COMPILATION?
|
||||
LINKING?
|
||||
On Unix systems, did you run make realclean first?
|
||||
EXECUTION?
|
||||
OTHER (please specify)?
|
||||
[Please indicate whether ACE, your application, or both are affected.]
|
||||
|
||||
SYNOPSIS:
|
||||
[Brief description of the problem]
|
||||
|
||||
DESCRIPTION:
|
||||
[Detailed description of problem. Don't just say "<blah>
|
||||
doesn't work, here's a fix," explain what your program does
|
||||
to get to the <blah> state. ]
|
||||
|
||||
REPEAT BY:
|
||||
[What you did to get the error; include test program or session
|
||||
transcript if at all possible. ]
|
||||
|
||||
SAMPLE FIX/WORKAROUND:
|
||||
[If available ]
|
||||
|
|
@ -1,222 +0,0 @@
|
|||
$Id: README 96983 2013-04-11 11:14:11Z schmidt $
|
||||
|
||||
This document is also available at the following URL:
|
||||
|
||||
http://www.dre.vanderbilt.edu/~schmidt/ACE.html
|
||||
|
||||
All software and documentation is available via both anonymous ftp and
|
||||
the http.]
|
||||
|
||||
THE ADAPTIVE COMMUNICATION ENVIRONMENT (ACE)
|
||||
|
||||
An Object-Oriented Network Programming Toolkit
|
||||
|
||||
----------------------------------------
|
||||
|
||||
Overview of ACE
|
||||
|
||||
The ADAPTIVE Communication Environment (ACE) is an object-oriented
|
||||
(OO) toolkit that implements fundamental design patterns for
|
||||
communication software. ACE provides a rich set of reusable C++
|
||||
wrappers and frameworks that perform common communication software
|
||||
tasks across a range of OS platforms, including Win32/Win64, most
|
||||
versions of UNIX (e.g., SunOS, HP-UX , AIX, Linux, NetBSD, and FreeBSD),
|
||||
real-time operating systems (e.g., VxWorks, Chorus, LynxOS, and QNX),
|
||||
OpenVMS, and MVS OpenEdition. A single source tree is used for all
|
||||
these platforms and porting ACE to other platforms is relatively easy.
|
||||
|
||||
The communication software components provided by ACE include event
|
||||
demultiplexing and event handler dispatching, service initialization,
|
||||
interprocess communication, shared memory management, message routing,
|
||||
dynamic (re)configuration of distributed services, multi-threading,
|
||||
and concurrency control. There are both C++ and Java versions of ACE
|
||||
available.
|
||||
|
||||
ACE is targeted for developers of high-performance and real-time
|
||||
communication services and applications on UNIX, POSIX, and Win32
|
||||
platforms. ACE simplifies the development of OO network applications
|
||||
and services that utilize interprocess communication, event
|
||||
demultiplexing, explicit dynamic linking, and concurrency. ACE
|
||||
automates system configuration and reconfiguration by dynamically
|
||||
linking services into applications at run-time and executing these
|
||||
services in one or more processes or threads.
|
||||
|
||||
ACE is currently used in commercial projects and products by dozens of
|
||||
companies including Ericsson, Bellcore, Siemens, Motorola, Kodak,
|
||||
Boeing, Lucent, DEC, Lockheed Martin, and SAIC. Commercial support
|
||||
for ACE is available from several companies as listed at
|
||||
http://www.cs.wustl.edu/~schmidt/commercial-support.html
|
||||
|
||||
----------------------------------------
|
||||
|
||||
C++ Wrappers for OS Interfaces
|
||||
|
||||
The lower-level portions of ACE provide a set of portable and
|
||||
type-secure C++ wrappers that encapsulate the following C language OS
|
||||
interfaces:
|
||||
|
||||
. IPC mechanisms
|
||||
-- e.g., Internet- and UNIX-domain sockets, TLI, Named
|
||||
Pipes (for UNIX and Win32) and STREAM pipes;
|
||||
|
||||
. Event demultiplexing
|
||||
-- e.g., select(), poll(), and Win32
|
||||
WaitForMultipleObjects and I/O completion ports;
|
||||
|
||||
. Multi-threading and synchronization
|
||||
-- e.g., Solaris threads, POSIX Pthreads, and Win32
|
||||
threads;
|
||||
|
||||
. Explicit dynamic linking
|
||||
-- e.g., dlopen/dlsym on UNIX and LoadLibrary/GetProc
|
||||
on Win32;
|
||||
|
||||
. Memory-mapped files and shared memory management
|
||||
-- e.g., BSD mmap(), SYSV shared memory, and Win32
|
||||
shared memory;
|
||||
|
||||
. System V IPC
|
||||
-- e.g., shared memory, semaphores, message queues.
|
||||
|
||||
The OS Adaptation Layer shields the upper levels of ACE from platform
|
||||
dependencies associated with the underlying OS interfaces.
|
||||
|
||||
----------------------------------------
|
||||
|
||||
Frameworks and Class Categories
|
||||
|
||||
ACE also contains a higher-level network programming framework that
|
||||
integrates and enhances the lower-level C++ wrappers. This framework
|
||||
supports the dynamic configuration of concurrent distributed services
|
||||
into applications. The framework portion of ACE contains the
|
||||
following class categories:
|
||||
|
||||
. The Reactor
|
||||
-- Supports both Reactive and Proactive I/O;
|
||||
|
||||
. The Service Configurator
|
||||
-- Support dynamic (re)configuration of objects;
|
||||
|
||||
. The ADAPTIVE Service Executive
|
||||
-- A user-level implementation of System V STREAMS,
|
||||
that supports modular integration of
|
||||
hierarchically-related communicaion services;
|
||||
|
||||
. Concurrency
|
||||
-- Various types of higher-level concurrency
|
||||
control and synchronization patterns (such as
|
||||
Polymorphic Futures and Active Objects);
|
||||
|
||||
. Shared Malloc
|
||||
-- Components for managing dynamically allocation
|
||||
of shared and local memory;
|
||||
|
||||
----------------------------------------
|
||||
|
||||
Distributed Services and Components
|
||||
|
||||
Finally, ACE provides a standard library of distributed services that
|
||||
are packaged as components. These service components play two roles
|
||||
in ACE:
|
||||
|
||||
1. They provide reusable components for common distributed
|
||||
system tasks such as logging, naming, locking, and time
|
||||
synchronization.
|
||||
|
||||
2. They illustrate how to utilize ACE features such as the
|
||||
Reactor, Service Configurator, Service Initialization,
|
||||
Concurrency, and IPC components.
|
||||
|
||||
----------------------------------------
|
||||
|
||||
Middleware Applications
|
||||
|
||||
ACE has been used in research and development projects at many
|
||||
universities and companies. For instance, it has been used to build
|
||||
avionics systems at Boeing, telecommunication systems at Bellcore,
|
||||
Ericsson, Motorola, and Lucent; medical imaging systems at Siemens and
|
||||
Kodak; and many academic research projects. Two example middleware
|
||||
applications provided with the ACE release include:
|
||||
|
||||
1. The ACE ORB (TAO) -- TAO is a real-time implementation of
|
||||
CORBA built using the framework components and patterns
|
||||
provided by ACE.
|
||||
|
||||
2. JAWS -- JAWS is a high-performance, adaptive Web server
|
||||
built using the components in ACE.
|
||||
|
||||
----------------------------------------
|
||||
|
||||
OBTAINING ACE
|
||||
|
||||
ACE may be obtained electronically from
|
||||
http://download.dre.vanderbilt.edu. This release contains the source
|
||||
code, test drivers, and example applications (including JAWS) for C++
|
||||
wrapper libraries and the higher-level ACE network programming
|
||||
framework developed as part of the ADAPTIVE project at the University
|
||||
of California, Irvine, Washington University, St. Louis, and
|
||||
Vanderbilt University.
|
||||
|
||||
You can get The ACE ORB (TAO) in a companion release at the same URL.
|
||||
|
||||
----------------------------------------
|
||||
|
||||
ACE DOCUMENTATION AND TUTORIALS
|
||||
|
||||
Many of the C++ wrappers and higher-level components have been
|
||||
described in issues of the C++ Report, as well as in proceedings of
|
||||
many journals, conferences, and workshops.
|
||||
|
||||
A collection of white papers and tutorial handouts are included at
|
||||
|
||||
http://www.dre.vanderbilt.edu/~schmidt/ACE-papers.html
|
||||
|
||||
This page contains PDF versions of various papers that describe
|
||||
different aspects of ACE.
|
||||
|
||||
This material is also available available via the WWW at URL:
|
||||
|
||||
http://www.dre.vanderbilt.edu/~schmidt/ACE.html
|
||||
|
||||
----------------------------------------
|
||||
|
||||
ACE MAILING LIST AND NEWSGROUP
|
||||
|
||||
A mailing list, ace-users@list.isis.vanderbilt.edu, is available for
|
||||
discussing bug fixes, enhancements, and porting issues regarding ACE.
|
||||
Please send mail to me at the
|
||||
ace-users-request@list.isis.vanderbilt.edu if you'd like to join the
|
||||
mailing list. There is also a USENET newsgroup called
|
||||
comp.soft-sys.ace. Please see
|
||||
http://www.dre.vanderbilt.edu/~schmidt/ACE-mail.html for details on
|
||||
how to subscribe to the mailing list.
|
||||
|
||||
----------------------------------------
|
||||
|
||||
BUILDING AND INSTALLING ACE
|
||||
|
||||
Please refer to the
|
||||
http://www.dre.vanderbilt.edu/~schmidt/ACE-install.html file for
|
||||
information on how to build and test the ACE wrappers. The
|
||||
BIBLIOGRAPHY file contains information on where to obtain articles
|
||||
that describe the ACE wrappers and the ADAPTIVE system in more detail.
|
||||
|
||||
The current release has been tested extensively, but if you find any
|
||||
bugs, please report them to the ACE mailing list
|
||||
ace-users@list.isis.vanderbilt.edu using the
|
||||
$ACE_ROOT/PROBLEM-REPORT-FORM. Please use the same form to submit
|
||||
questions, comments, etc. To ensure that you see responses, please do
|
||||
one of the following:
|
||||
|
||||
1) Subscribe to the ace-users mail list, by sending email with
|
||||
contents "subscribe ace-users" to
|
||||
ace-users-request@list.isis.vanderbilt.edu.
|
||||
|
||||
2) Or, monitor the comp.soft-sys.ace newsgroup for responses.
|
||||
|
||||
----------------------------------------
|
||||
|
||||
ACKNOWLEDGEMENTS
|
||||
|
||||
Please see the file `$ACE_ROOT/THANKS' for a list of the thousands of
|
||||
people who've contributed to ACE and TAO over the years.
|
||||
2422
dep/acelite/THANKS
2422
dep/acelite/THANKS
File diff suppressed because it is too large
Load diff
|
|
@ -1,8 +0,0 @@
|
|||
This is ACE version 6.3.0, released Fri Nov 14 08:38:16 CET 2014
|
||||
|
||||
If you have any problems with or questions about ACE, please send
|
||||
e-mail to the ACE mailing list (ace-bugs@list.isis.vanderbilt.edu),
|
||||
using the form found in the file PROBLEM-REPORT-FORM. In order
|
||||
to post to the list you must subscribe to it.
|
||||
|
||||
See http://www.dre.vanderbilt.edu/~schmidt/ACE-mail.html
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,886 +0,0 @@
|
|||
// -*- C++ -*-
|
||||
|
||||
//=============================================================================
|
||||
/**
|
||||
* @file ACE.h
|
||||
*
|
||||
* $Id: ACE.h 97308 2013-09-01 00:58:08Z mesnier_p $
|
||||
*
|
||||
* This file contains value added ACE functions that extend the
|
||||
* behavior of the UNIX and Win32 OS calls.
|
||||
*
|
||||
* All these ACE static functions are consolidated in a single place
|
||||
* in order to manage the namespace better. These functions are put
|
||||
* here rather than in @c ACE_OS in order to separate concerns.
|
||||
*
|
||||
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ACE_ACE_H
|
||||
#define ACE_ACE_H
|
||||
|
||||
#include /**/ "ace/pre.h"
|
||||
|
||||
#include /**/ "ace/config-lite.h"
|
||||
|
||||
#if !defined (ACE_LACKS_PRAGMA_ONCE)
|
||||
# pragma once
|
||||
#endif /* ACE_LACKS_PRAGMA_ONCE */
|
||||
|
||||
#include "ace/Basic_Types.h"
|
||||
#include "ace/Default_Constants.h"
|
||||
|
||||
#if defined (ACE_EXPORT_MACRO)
|
||||
# undef ACE_EXPORT_MACRO
|
||||
#endif
|
||||
#define ACE_EXPORT_MACRO ACE_Export
|
||||
|
||||
// Open versioned namespace, if enabled by the user.
|
||||
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
|
||||
|
||||
// Forward declarations.
|
||||
class ACE_Time_Value;
|
||||
class ACE_Message_Block;
|
||||
class ACE_Handle_Set;
|
||||
|
||||
/**
|
||||
* @namespace ACE
|
||||
*
|
||||
* @brief The namespace containing the ACE framework itself.
|
||||
*
|
||||
* The ACE namespace contains all types (classes, structures,
|
||||
* typedefs, etc), and global functions and variables in the ACE
|
||||
* framework.
|
||||
*/
|
||||
namespace ACE
|
||||
{
|
||||
// = ACE version information.
|
||||
/// e.g., the "5" in ACE 5.1.12.
|
||||
extern ACE_Export u_int major_version (void);
|
||||
|
||||
/// e.g., the "1" in ACE 5.1.12.
|
||||
extern ACE_Export u_int minor_version (void);
|
||||
|
||||
/// e.g., the "12" in ACE 5.1.12.
|
||||
/// Returns 0 for "stable" (non-beta) releases.
|
||||
extern ACE_Export u_int beta_version (void);
|
||||
|
||||
// = C++ compiler version information.
|
||||
/// E.g., the "SunPro C++" in SunPro C++ 4.32.0
|
||||
extern ACE_Export const ACE_TCHAR * compiler_name (void);
|
||||
|
||||
/// E.g., the "4" in SunPro C++ 4.32.0
|
||||
extern ACE_Export u_int compiler_major_version (void);
|
||||
|
||||
/// E.g., the "32" in SunPro C++ 4.32.0
|
||||
extern ACE_Export u_int compiler_minor_version (void);
|
||||
|
||||
/// E.g., the "0" in SunPro C++ 4.32.0
|
||||
extern ACE_Export u_int compiler_beta_version (void);
|
||||
|
||||
/// Check if error indicates the process being out of handles (file
|
||||
/// descriptors).
|
||||
extern ACE_Export int out_of_handles (int error);
|
||||
|
||||
/// Simple wildcard matching function supporting '*' and '?'
|
||||
/// return true if string s matches pattern.
|
||||
/// If @a character_classes is true, '[' is treated as a wildcard character
|
||||
/// as described in the fnmatch() POSIX API. The following POSIX "bracket
|
||||
/// expression" features are not implemented: collating symbols, equivalence
|
||||
/// class expressions, and character class expressions. The POSIX locale is
|
||||
/// assumed.
|
||||
extern ACE_Export bool wild_match(const char* s, const char* pattern,
|
||||
bool case_sensitive = true, bool character_classes = false);
|
||||
|
||||
/**
|
||||
* @name I/O operations
|
||||
*
|
||||
* Notes on common parameters:
|
||||
*
|
||||
* @a handle is the connected endpoint that will be used for I/O.
|
||||
*
|
||||
* @a buf is the buffer to write from or receive into.
|
||||
*
|
||||
* @a len is the number of bytes to transfer.
|
||||
*
|
||||
* The @a timeout parameter in the following methods indicates how
|
||||
* long to blocking trying to transfer data. If @a timeout == 0,
|
||||
* then the call behaves as a normal send/recv call, i.e., for
|
||||
* blocking sockets, the call will block until action is possible;
|
||||
* for non-blocking sockets, @c EWOULDBLOCK will be returned if no
|
||||
* action is immediately possible.
|
||||
*
|
||||
* If @a timeout != 0, the call will wait until the relative time
|
||||
* specified in @a *timeout elapses.
|
||||
*
|
||||
* The "_n()" I/O methods keep looping until all the data has been
|
||||
* transferred. These methods also work for sockets in non-blocking
|
||||
* mode i.e., they keep looping on @c EWOULDBLOCK. @a timeout is
|
||||
* used to make sure we keep making progress, i.e., the same timeout
|
||||
* value is used for every I/O operation in the loop and the timeout
|
||||
* is not counted down.
|
||||
*
|
||||
* The return values for the "*_n()" methods match the return values
|
||||
* from the non "_n()" methods and are specified as follows:
|
||||
*
|
||||
* - On complete transfer, the number of bytes transferred is returned.
|
||||
* - On timeout, -1 is returned, @c errno == @c ETIME.
|
||||
* - On error, -1 is returned, @c errno is set to appropriate error.
|
||||
* - On @c EOF, 0 is returned, @c errno is irrelevant.
|
||||
*
|
||||
* On partial transfers, i.e., if any data is transferred before
|
||||
* timeout / error / @c EOF, @a bytes_transferred> will contain the
|
||||
* number of bytes transferred.
|
||||
*
|
||||
* Methods with @a iovec parameter are I/O vector variants of the
|
||||
* I/O operations.
|
||||
*
|
||||
* Methods with the extra @a flags argument will always result in
|
||||
* @c send getting called. Methods without the extra @a flags
|
||||
* argument will result in @c send getting called on Win32
|
||||
* platforms, and @c write getting called on non-Win32 platforms.
|
||||
*/
|
||||
//@{
|
||||
extern ACE_Export ssize_t recv (ACE_HANDLE handle,
|
||||
void *buf,
|
||||
size_t len,
|
||||
int flags,
|
||||
const ACE_Time_Value *timeout = 0);
|
||||
|
||||
#if defined (ACE_HAS_TLI)
|
||||
|
||||
extern ACE_Export ssize_t t_rcv (ACE_HANDLE handle,
|
||||
void *buf,
|
||||
size_t len,
|
||||
int *flags,
|
||||
const ACE_Time_Value *timeout = 0);
|
||||
|
||||
#endif /* ACE_HAS_TLI */
|
||||
|
||||
extern ACE_Export ssize_t recv (ACE_HANDLE handle,
|
||||
void *buf,
|
||||
size_t len,
|
||||
const ACE_Time_Value *timeout = 0);
|
||||
|
||||
extern ACE_Export ssize_t recvmsg (ACE_HANDLE handle,
|
||||
struct msghdr *msg,
|
||||
int flags,
|
||||
const ACE_Time_Value *timeout = 0);
|
||||
|
||||
extern ACE_Export ssize_t recvfrom (ACE_HANDLE handle,
|
||||
char *buf,
|
||||
int len,
|
||||
int flags,
|
||||
struct sockaddr *addr,
|
||||
int *addrlen,
|
||||
const ACE_Time_Value *timeout = 0);
|
||||
|
||||
ACE_NAMESPACE_INLINE_FUNCTION
|
||||
ssize_t recv_n (ACE_HANDLE handle,
|
||||
void *buf,
|
||||
size_t len,
|
||||
int flags,
|
||||
const ACE_Time_Value *timeout = 0,
|
||||
size_t *bytes_transferred = 0);
|
||||
|
||||
#if defined (ACE_HAS_TLI)
|
||||
|
||||
ACE_NAMESPACE_INLINE_FUNCTION
|
||||
ssize_t t_rcv_n (ACE_HANDLE handle,
|
||||
void *buf,
|
||||
size_t len,
|
||||
int *flags,
|
||||
const ACE_Time_Value *timeout = 0,
|
||||
size_t *bytes_transferred = 0);
|
||||
|
||||
#endif /* ACE_HAS_TLI */
|
||||
|
||||
ACE_NAMESPACE_INLINE_FUNCTION
|
||||
ssize_t recv_n (ACE_HANDLE handle,
|
||||
void *buf,
|
||||
size_t len,
|
||||
const ACE_Time_Value *timeout = 0,
|
||||
size_t *bytes_transferred = 0);
|
||||
|
||||
/// Receive into a variable number of pieces.
|
||||
/**
|
||||
* Accepts a variable, caller-specified, number of pointer/length
|
||||
* pairs. Arguments following @a n are char *, size_t pairs.
|
||||
*
|
||||
* @param handle The I/O handle to receive on
|
||||
* @param n The total number of char *, size_t pairs following @a n.
|
||||
*
|
||||
* @return -1 on error, else total number of bytes received.
|
||||
*/
|
||||
extern ACE_Export ssize_t recv (ACE_HANDLE handle, size_t n, ...);
|
||||
|
||||
extern ACE_Export ssize_t recvv (ACE_HANDLE handle,
|
||||
iovec *iov,
|
||||
int iovcnt,
|
||||
const ACE_Time_Value *timeout = 0);
|
||||
|
||||
ACE_NAMESPACE_INLINE_FUNCTION
|
||||
ssize_t recvv_n (ACE_HANDLE handle,
|
||||
iovec *iov,
|
||||
int iovcnt,
|
||||
const ACE_Time_Value *timeout = 0,
|
||||
size_t *bytes_transferred = 0);
|
||||
|
||||
extern ACE_Export ssize_t recv_n (ACE_HANDLE handle,
|
||||
ACE_Message_Block *message_block,
|
||||
const ACE_Time_Value *timeout = 0,
|
||||
size_t *bytes_transferred = 0);
|
||||
|
||||
extern ACE_Export ssize_t send (ACE_HANDLE handle,
|
||||
const void *buf,
|
||||
size_t len,
|
||||
int flags,
|
||||
const ACE_Time_Value *timeout = 0);
|
||||
|
||||
#if defined (ACE_HAS_TLI)
|
||||
|
||||
extern ACE_Export ssize_t t_snd (ACE_HANDLE handle,
|
||||
const void *buf,
|
||||
size_t len,
|
||||
int flags,
|
||||
const ACE_Time_Value *timeout = 0);
|
||||
|
||||
#endif /* ACE_HAS_TLI */
|
||||
|
||||
extern ACE_Export ssize_t send (ACE_HANDLE handle,
|
||||
const void *buf,
|
||||
size_t len,
|
||||
const ACE_Time_Value *timeout = 0);
|
||||
|
||||
extern ACE_Export ssize_t sendmsg (ACE_HANDLE handle,
|
||||
const struct msghdr *msg,
|
||||
int flags,
|
||||
const ACE_Time_Value *timeout = 0);
|
||||
|
||||
extern ACE_Export ssize_t sendto (ACE_HANDLE handle,
|
||||
const char *buf,
|
||||
int len,
|
||||
int flags,
|
||||
const struct sockaddr *addr,
|
||||
int addrlen,
|
||||
const ACE_Time_Value *timeout = 0);
|
||||
|
||||
ACE_NAMESPACE_INLINE_FUNCTION
|
||||
ssize_t send_n (ACE_HANDLE handle,
|
||||
const void *buf,
|
||||
size_t len,
|
||||
int flags,
|
||||
const ACE_Time_Value *timeout = 0,
|
||||
size_t *bytes_transferred = 0);
|
||||
|
||||
#if defined (ACE_HAS_TLI)
|
||||
|
||||
ACE_NAMESPACE_INLINE_FUNCTION
|
||||
ssize_t t_snd_n (ACE_HANDLE handle,
|
||||
const void *buf,
|
||||
size_t len,
|
||||
int flags,
|
||||
const ACE_Time_Value *timeout = 0,
|
||||
size_t *bytes_transferred = 0);
|
||||
|
||||
#endif /* ACE_HAS_TLI */
|
||||
|
||||
ACE_NAMESPACE_INLINE_FUNCTION
|
||||
ssize_t send_n (ACE_HANDLE handle,
|
||||
const void *buf,
|
||||
size_t len,
|
||||
const ACE_Time_Value *timeout = 0,
|
||||
size_t *bytes_transferred = 0);
|
||||
|
||||
/// Varargs variant.
|
||||
extern ACE_Export ssize_t send (ACE_HANDLE handle, size_t n, ...);
|
||||
|
||||
extern ACE_Export ssize_t sendv (ACE_HANDLE handle,
|
||||
const iovec *iov,
|
||||
int iovcnt,
|
||||
const ACE_Time_Value *timeout = 0);
|
||||
|
||||
ACE_NAMESPACE_INLINE_FUNCTION
|
||||
ssize_t sendv_n (ACE_HANDLE handle,
|
||||
const iovec *iov,
|
||||
int iovcnt,
|
||||
const ACE_Time_Value *timeout = 0,
|
||||
size_t *bytes_transferred = 0);
|
||||
|
||||
/// Send all the @a message_blocks chained through their @c next and
|
||||
/// @c cont pointers. This call uses the underlying OS gather-write
|
||||
/// operation to reduce the domain-crossing penalty.
|
||||
extern ACE_Export ssize_t send_n (ACE_HANDLE handle,
|
||||
const ACE_Message_Block *message_block,
|
||||
const ACE_Time_Value *timeout = 0,
|
||||
size_t *bytes_transferred = 0);
|
||||
|
||||
// = File system I/O functions (these don't support timeouts).
|
||||
|
||||
ACE_NAMESPACE_INLINE_FUNCTION
|
||||
ssize_t read_n (ACE_HANDLE handle,
|
||||
void *buf,
|
||||
size_t len,
|
||||
size_t *bytes_transferred = 0);
|
||||
|
||||
ACE_NAMESPACE_INLINE_FUNCTION
|
||||
ssize_t write_n (ACE_HANDLE handle,
|
||||
const void *buf,
|
||||
size_t len,
|
||||
size_t *bytes_transferred = 0);
|
||||
|
||||
/// Write all the @a message_blocks chained through their @c next
|
||||
/// and @c cont pointers. This call uses the underlying OS
|
||||
/// gather-write operation to reduce the domain-crossing penalty.
|
||||
extern ACE_Export ssize_t write_n (ACE_HANDLE handle,
|
||||
const ACE_Message_Block *message_block,
|
||||
size_t *bytes_transferred = 0);
|
||||
|
||||
extern ACE_Export ssize_t readv_n (ACE_HANDLE handle,
|
||||
iovec *iov,
|
||||
int iovcnt,
|
||||
size_t *bytes_transferred = 0);
|
||||
|
||||
extern ACE_Export ssize_t writev_n (ACE_HANDLE handle,
|
||||
const iovec *iov,
|
||||
int iovcnt,
|
||||
size_t *bytes_transferred = 0);
|
||||
//@}
|
||||
|
||||
/**
|
||||
* Wait up to @a timeout amount of time to passively establish a
|
||||
* connection. This method doesn't perform the @c accept, it just
|
||||
* does the timed wait.
|
||||
*/
|
||||
extern ACE_Export int handle_timed_accept (ACE_HANDLE listener,
|
||||
ACE_Time_Value *timeout,
|
||||
bool restart);
|
||||
|
||||
/**
|
||||
* Wait up to @a timeout amount of time to complete an actively
|
||||
* established non-blocking connection. If @a is_tli is non-0 then
|
||||
* we are being called by a TLI wrapper (which behaves slightly
|
||||
* differently from a socket wrapper).
|
||||
*/
|
||||
extern ACE_Export ACE_HANDLE handle_timed_complete (
|
||||
ACE_HANDLE listener,
|
||||
const ACE_Time_Value *timeout,
|
||||
int is_tli = 0);
|
||||
|
||||
/**
|
||||
* Reset the limit on the number of open handles. If @a new_limit
|
||||
* == -1 set the limit to the maximum allowable. Otherwise, set
|
||||
* the limit value to @a new_limit. If @a increase_limit_only is
|
||||
* non-0 then only allow increases to the limit.
|
||||
*/
|
||||
extern ACE_Export int set_handle_limit (int new_limit = -1,
|
||||
int increase_limit_only = 0);
|
||||
|
||||
/**
|
||||
* Returns the maximum number of open handles currently permitted in
|
||||
* this process. This maximum may be extended using
|
||||
* @c ACE::set_handle_limit.
|
||||
*/
|
||||
extern ACE_Export int max_handles (void);
|
||||
|
||||
// = String functions
|
||||
/**
|
||||
* Return a dynamically allocated duplicate of @a str, substituting
|
||||
* the environment variable if @c str[0] @c == @c '$'. Note that
|
||||
* the pointer is allocated with @c ACE_OS::malloc and must be freed
|
||||
* by @c ACE_OS::free.
|
||||
*/
|
||||
extern ACE_Export ACE_TCHAR *strenvdup (const ACE_TCHAR *str);
|
||||
|
||||
/// Returns a pointer to the "end" of the string, i.e., the character
|
||||
/// past the '\0'.
|
||||
extern ACE_Export const char *strend (const char *s);
|
||||
|
||||
/// This method is just like @c strdup, except that it uses
|
||||
/// @c operator @c new rather than @c malloc. If @a s is NULL
|
||||
/// returns NULL rather than segfaulting.
|
||||
extern ACE_Export char *strnew (const char *s);
|
||||
|
||||
/// Delete the memory allocated by @c strnew.
|
||||
ACE_NAMESPACE_INLINE_FUNCTION void strdelete (char *s);
|
||||
|
||||
/// Create a fresh new copy of @a str, up to @a n chars long. Uses
|
||||
/// @c ACE_OS::malloc to allocate the new string.
|
||||
extern ACE_Export char *strndup (const char *str, size_t n);
|
||||
|
||||
/// Create a fresh new copy of @a str, up to @a n chars long. Uses
|
||||
/// @c ACE_OS::malloc to allocate the new string.
|
||||
extern ACE_Export char *strnnew (const char *str, size_t n);
|
||||
|
||||
/// Determine if a specified pathname is "dot dir" (ie. "." or "..").
|
||||
ACE_NAMESPACE_INLINE_FUNCTION bool isdotdir (const char *s);
|
||||
|
||||
#if defined (ACE_HAS_WCHAR)
|
||||
extern ACE_Export const wchar_t *strend (const wchar_t *s);
|
||||
|
||||
extern ACE_Export wchar_t *strnew (const wchar_t *s);
|
||||
|
||||
ACE_NAMESPACE_INLINE_FUNCTION void strdelete (wchar_t *s);
|
||||
|
||||
extern ACE_Export wchar_t *strndup (const wchar_t *str, size_t n);
|
||||
|
||||
extern ACE_Export wchar_t *strnnew (const wchar_t *str, size_t n);
|
||||
|
||||
ACE_NAMESPACE_INLINE_FUNCTION bool isdotdir (const wchar_t *s);
|
||||
|
||||
#endif /* ACE_HAS_WCHAR */
|
||||
|
||||
/**
|
||||
* On Windows, determines if a specified pathname ends with ".exe"
|
||||
* (not case sensitive). If on Windows and there is no ".exe" suffix,
|
||||
* a new ACE_TCHAR array is allocated and a copy of @c pathname with
|
||||
* the ".exe" suffix is copied into it. In this case, the caller is
|
||||
* responsible for calling delete [] on the returned pointer.
|
||||
*
|
||||
* @param pathname The name to check for a proper suffix.
|
||||
*
|
||||
* @retval @c pathname if there is a proper suffix for Windows. This is
|
||||
* always the return value for non-Windows platforms.
|
||||
* @retval If a suffix needs to be added, returns a pointer to new[]
|
||||
* allocated memory containing the original @c pathname plus
|
||||
* a ".exe" suffix. The caller is responsible for freeing the
|
||||
* memory using delete [].
|
||||
*/
|
||||
extern ACE_Export const ACE_TCHAR *execname (const ACE_TCHAR *pathname);
|
||||
|
||||
/**
|
||||
* Returns the "basename" of a @a pathname separated by @a delim.
|
||||
* For instance, the basename of "/tmp/foo.cpp" is "foo.cpp" when
|
||||
* @a delim is @a '/'.
|
||||
*/
|
||||
extern ACE_Export const ACE_TCHAR *basename (const ACE_TCHAR *pathname,
|
||||
ACE_TCHAR delim =
|
||||
ACE_DIRECTORY_SEPARATOR_CHAR);
|
||||
|
||||
/**
|
||||
* Returns the "dirname" of a @a pathname. For instance, the
|
||||
* dirname of "/tmp/foo.cpp" is "/tmp" when @a delim is @a '/'. If
|
||||
* @a pathname has no @a delim ".\0" is returned. This method does
|
||||
* not modify @a pathname and is not reentrant.
|
||||
*/
|
||||
extern ACE_Export const ACE_TCHAR *dirname (const ACE_TCHAR *pathname,
|
||||
ACE_TCHAR delim =
|
||||
ACE_DIRECTORY_SEPARATOR_CHAR);
|
||||
|
||||
/**
|
||||
* Translate the given timestamp to ISO-8601 format.
|
||||
*
|
||||
* @param time_value ACE_Time_Value to format. This is assumed to be
|
||||
* an absolute time value.
|
||||
* @param date_and_time Array to hold the timestamp.
|
||||
* @param time_len Size of @a date_and_time in ACE_TCHARs.
|
||||
* Must be greater than or equal to 27.
|
||||
* @param return_pointer_to_first_digit If true, returned pointer value
|
||||
* is to the first time digit, else to the space
|
||||
* prior to the first time digit. See Return Values.
|
||||
*
|
||||
* @retval 0 if unsuccessful, with errno set. If @a time_len is less than
|
||||
* 27 errno will be EINVAL.
|
||||
* @retval If successful, pointer to beginning of the "time" portion of
|
||||
* @a date_and_time. If @a return_pointer_to_first_digit is false
|
||||
* the pointer is actually to the space before the time, else
|
||||
* the pointer is to the first time digit.
|
||||
*/
|
||||
extern ACE_Export ACE_TCHAR *timestamp (const ACE_Time_Value& time_value,
|
||||
ACE_TCHAR date_and_time[],
|
||||
size_t time_len,
|
||||
bool return_pointer_to_first_digit = false);
|
||||
|
||||
/**
|
||||
* Translate the current time to ISO-8601 timestamp format.
|
||||
*
|
||||
* @param date_and_time Array to hold the timestamp.
|
||||
* @param time_len Size of @a date_and_time in ACE_TCHARs.
|
||||
* Must be greater than or equal to 27.
|
||||
* @param return_pointer_to_first_digit If true, returned pointer value
|
||||
* is to the first time digit, else to the space
|
||||
* prior to the first time digit. See Return Values.
|
||||
*
|
||||
* @retval 0 if unsuccessful, with errno set. If @a time_len is less than
|
||||
* 27 errno will be EINVAL.
|
||||
* @retval If successful, pointer to beginning of the "time" portion of
|
||||
* @a date_and_time. If @a return_pointer_to_first_digit is false
|
||||
* the pointer is actually to the space before the time, else
|
||||
* the pointer is to the first time digit.
|
||||
*/
|
||||
extern ACE_Export ACE_TCHAR *timestamp (ACE_TCHAR date_and_time[],
|
||||
size_t time_len,
|
||||
bool return_pointer_to_first_digit = false);
|
||||
|
||||
/**
|
||||
* if @a avoid_zombies == 0 call @c ACE_OS::fork directly, else
|
||||
* create an orphan process that's inherited by the init process;
|
||||
* init cleans up when the orphan process terminates so we don't
|
||||
* create zombies. Returns -1 on failure and either the child PID
|
||||
* on success if @a avoid_zombies == 0 or 1 on success if @a
|
||||
* avoid_zombies != 0 (this latter behavior is a known bug that
|
||||
* needs to be fixed).
|
||||
*/
|
||||
extern ACE_Export pid_t fork (
|
||||
const ACE_TCHAR *program_name = ACE_TEXT ("<unknown>"),
|
||||
int avoid_zombies = 0);
|
||||
|
||||
/**
|
||||
* Become a daemon process using the algorithm in Richard Stevens
|
||||
* "Advanced Programming in the UNIX Environment." If
|
||||
* @a close_all_handles is non-zero then all open file handles are
|
||||
* closed.
|
||||
*/
|
||||
extern ACE_Export int daemonize (
|
||||
const ACE_TCHAR pathname[] = ACE_TEXT ("/"),
|
||||
bool close_all_handles = ACE_DEFAULT_CLOSE_ALL_HANDLES,
|
||||
const ACE_TCHAR program_name[] = ACE_TEXT ("<unknown>"));
|
||||
|
||||
// = Miscellaneous functions.
|
||||
/// Rounds the request to a multiple of the page size.
|
||||
extern ACE_Export size_t round_to_pagesize (size_t len);
|
||||
|
||||
/// Rounds the request to a multiple of the allocation granularity.
|
||||
extern ACE_Export size_t round_to_allocation_granularity (size_t len);
|
||||
|
||||
// @@ UNICODE what about buffer?
|
||||
/// Format buffer into printable format. This is useful for
|
||||
/// debugging.
|
||||
extern ACE_Export size_t format_hexdump (const char *buffer, size_t size,
|
||||
ACE_TCHAR *obuf, size_t obuf_sz);
|
||||
|
||||
/// Computes the hash value of {str} using the "Hash PJW" routine.
|
||||
extern ACE_Export u_long hash_pjw (const char *str);
|
||||
|
||||
/// Computes the hash value of {str} using the "Hash PJW" routine.
|
||||
extern ACE_Export u_long hash_pjw (const char *str, size_t len);
|
||||
|
||||
#if defined (ACE_HAS_WCHAR)
|
||||
/// Computes the hash value of {str} using the "Hash PJW" routine.
|
||||
extern ACE_Export u_long hash_pjw (const wchar_t *str);
|
||||
|
||||
/// Computes the hash value of {str} using the "Hash PJW" routine.
|
||||
extern ACE_Export u_long hash_pjw (const wchar_t *str, size_t len);
|
||||
#endif /* ACE_HAS_WCHAR */
|
||||
|
||||
/// Computes CRC-CCITT for the string.
|
||||
extern ACE_Export ACE_UINT16 crc_ccitt(const char *str);
|
||||
|
||||
/// Computes CRC-CCITT for the buffer.
|
||||
extern ACE_Export ACE_UINT16 crc_ccitt(const void *buf, size_t len,
|
||||
ACE_UINT16 crc = 0);
|
||||
|
||||
/// Computes CRC-CCITT for the @ len iovec buffers.
|
||||
extern ACE_Export ACE_UINT16 crc_ccitt(const iovec *iov, int len,
|
||||
ACE_UINT16 crc = 0);
|
||||
|
||||
/// Computes the ISO 8802-3 standard 32 bits CRC for the string.
|
||||
extern ACE_Export ACE_UINT32 crc32 (const char *str);
|
||||
|
||||
/// Computes the ISO 8802-3 standard 32 bits CRC for the buffer.
|
||||
extern ACE_Export ACE_UINT32 crc32 (const void *buf, size_t len,
|
||||
ACE_UINT32 crc = 0);
|
||||
|
||||
/// Computes the ISO 8802-3 standard 32 bits CRC for the
|
||||
/// @ len iovec buffers.
|
||||
extern ACE_Export ACE_UINT32 crc32 (const iovec *iov, int len,
|
||||
ACE_UINT32 crc = 0);
|
||||
|
||||
/// Euclid's greatest common divisor algorithm.
|
||||
extern ACE_Export u_long gcd (u_long x, u_long y);
|
||||
|
||||
/// Calculates the minimum enclosing frame size for the given values.
|
||||
extern ACE_Export u_long minimum_frame_size (u_long period1, u_long period2);
|
||||
|
||||
/**
|
||||
* Function that can burn up noticeable CPU time: brute-force
|
||||
* determination of whether number @a n is prime. Returns 0 if
|
||||
* it is prime, or the smallest factor if it is not prime.
|
||||
* @a min_factor and @a max_factor can be used to partition the work
|
||||
* among threads. For just one thread, typical values are 2 and
|
||||
* n/2.
|
||||
*/
|
||||
extern ACE_Export u_long is_prime (const u_long n,
|
||||
const u_long min_factor,
|
||||
const u_long max_factor);
|
||||
|
||||
/// Map troublesome win32 errno values to values that standard C
|
||||
/// strerr function understands. Thank you Microsoft.
|
||||
extern ACE_Export int map_errno (int error);
|
||||
|
||||
/// Returns a string containing the error message corresponding to a
|
||||
/// WinSock error. This works around an omission in the Win32 API.
|
||||
/// @internal
|
||||
extern ACE_Export const ACE_TCHAR * sock_error (int error);
|
||||
|
||||
/// Determins whether the given error code corresponds to to a
|
||||
/// WinSock error. If so returns true, false otherwise.
|
||||
/// @internal
|
||||
extern ACE_Export bool is_sock_error (int error);
|
||||
|
||||
/**
|
||||
* Checks if process with {pid} is still alive. Returns 1 if it is
|
||||
* still alive, 0 if it isn't alive, and -1 if something weird
|
||||
* happened.
|
||||
*/
|
||||
extern ACE_Export int process_active (pid_t pid);
|
||||
|
||||
/**
|
||||
* Terminate the process abruptly with id @a pid. On Win32 platforms
|
||||
* this uses {TerminateProcess} and on POSIX platforms is uses
|
||||
* {kill} with the -9 (SIGKILL) signal, which cannot be caught or
|
||||
* ignored. Note that this call is potentially dangerous to use
|
||||
* since the process being terminated may not have a chance to
|
||||
* cleanup before it shuts down.
|
||||
*/
|
||||
extern ACE_Export int terminate_process (pid_t pid);
|
||||
|
||||
/**
|
||||
* This method uses process id and object pointer to come up with a
|
||||
* machine wide unique name. The process ID will provide uniqueness
|
||||
* between processes on the same machine. The "this" pointer of the
|
||||
* {object} will provide uniqueness between other "live" objects in
|
||||
* the same process. The uniqueness of this name is therefore only
|
||||
* valid for the life of {object}.
|
||||
*/
|
||||
ACE_NAMESPACE_INLINE_FUNCTION void unique_name (const void *object,
|
||||
ACE_TCHAR *name,
|
||||
size_t length);
|
||||
|
||||
/// Computes the base 2 logarithm of {num}.
|
||||
ACE_NAMESPACE_INLINE_FUNCTION u_long log2 (u_long num);
|
||||
|
||||
/// Helper to avoid comparing floating point values with ==
|
||||
/// (uses < and > operators).
|
||||
template <typename T>
|
||||
bool is_equal (const T& a, const T& b)
|
||||
{
|
||||
return !((a < b) || (a > b));
|
||||
}
|
||||
|
||||
/// Helper to avoid comparing floating point values with !=
|
||||
/// (uses < and > operators).
|
||||
template <typename T>
|
||||
bool is_inequal (const T& a, const T& b)
|
||||
{
|
||||
return !is_equal (a, b);
|
||||
}
|
||||
|
||||
/// Hex conversion utility.
|
||||
extern ACE_Export ACE_TCHAR nibble2hex (u_int n);
|
||||
|
||||
/// Convert a hex character to its byte representation.
|
||||
ACE_NAMESPACE_INLINE_FUNCTION u_char hex2byte (ACE_TCHAR c);
|
||||
|
||||
// = Set/get the debug level.
|
||||
extern ACE_Export bool debug (void);
|
||||
extern ACE_Export void debug (bool onoff);
|
||||
|
||||
/// Wrapper facade for @c select that uses @c ACE_Handle_Sets.
|
||||
extern ACE_Export int select (int width,
|
||||
ACE_Handle_Set *readfds,
|
||||
ACE_Handle_Set *writefds = 0,
|
||||
ACE_Handle_Set *exceptfds = 0,
|
||||
const ACE_Time_Value *timeout = 0);
|
||||
|
||||
/// Wrapper facade for the most common use of @c select that uses
|
||||
/// @c ACE_Handle_Sets.
|
||||
extern ACE_Export int select (int width,
|
||||
ACE_Handle_Set &readfds,
|
||||
const ACE_Time_Value *timeout = 0);
|
||||
|
||||
/// Timed wait for handle to get read ready.
|
||||
/// @retval -1 for error
|
||||
/// @retval 0 for timeout
|
||||
/// @retval 1 the handle is ready
|
||||
ACE_NAMESPACE_INLINE_FUNCTION
|
||||
int handle_read_ready (ACE_HANDLE handle,
|
||||
const ACE_Time_Value *timeout);
|
||||
|
||||
/// Timed wait for handle to get write ready.
|
||||
/// @retval -1 for error
|
||||
/// @retval 0 for timeout
|
||||
/// @retval 1 the handle is ready
|
||||
ACE_NAMESPACE_INLINE_FUNCTION
|
||||
int handle_write_ready (ACE_HANDLE handle,
|
||||
const ACE_Time_Value *timeout);
|
||||
|
||||
/// Timed wait for handle to get exception ready.
|
||||
/// @retval -1 for error
|
||||
/// @retval 0 for timeout
|
||||
/// @retval 1 the handle is ready
|
||||
ACE_NAMESPACE_INLINE_FUNCTION
|
||||
int handle_exception_ready (ACE_HANDLE handle,
|
||||
const ACE_Time_Value *timeout);
|
||||
|
||||
/// Timed wait for handle to get read, write, or exception ready.
|
||||
/// @retval -1 for error
|
||||
/// @retval 0 for timeout
|
||||
/// @retval 1 the handle is ready
|
||||
extern ACE_Export int handle_ready (ACE_HANDLE handle,
|
||||
const ACE_Time_Value *timeout,
|
||||
int read_ready,
|
||||
int write_ready,
|
||||
int exception_ready);
|
||||
|
||||
/// Wait for @a timeout before proceeding to a @c recv operation.
|
||||
/// @a val keeps track of whether we're in non-blocking mode or
|
||||
/// not.
|
||||
extern ACE_Export int enter_recv_timedwait (ACE_HANDLE handle,
|
||||
const ACE_Time_Value *timeout,
|
||||
int &val);
|
||||
|
||||
/// Wait for @a timeout before proceeding to a @c send operation.
|
||||
/// @a val keeps track of whether we're in non-blocking mode or
|
||||
/// not.
|
||||
extern ACE_Export int enter_send_timedwait (ACE_HANDLE handle,
|
||||
const ACE_Time_Value* timeout,
|
||||
int &val);
|
||||
|
||||
/// This makes sure that @a handle is set into non-blocking mode.
|
||||
/// @a val keeps track of whether were in non-blocking mode or not.
|
||||
extern ACE_Export void record_and_set_non_blocking_mode (ACE_HANDLE handle,
|
||||
int &val);
|
||||
|
||||
/// Cleanup after a timed operation, restore the appropriate
|
||||
/// non-blocking status of @a handle.
|
||||
extern ACE_Export void restore_non_blocking_mode (ACE_HANDLE handle,
|
||||
int val);
|
||||
|
||||
// private:
|
||||
// These functions aren't meant to be used internally, so they are
|
||||
// not exported.
|
||||
|
||||
//
|
||||
// = Recv_n helpers
|
||||
//
|
||||
|
||||
ACE_NAMESPACE_INLINE_FUNCTION ssize_t recv_i (ACE_HANDLE handle,
|
||||
void *buf,
|
||||
size_t len);
|
||||
|
||||
extern ACE_Export ssize_t recv_n_i (ACE_HANDLE handle,
|
||||
void *buf,
|
||||
size_t len,
|
||||
int flags,
|
||||
size_t *bytes_transferred);
|
||||
|
||||
extern ACE_Export ssize_t recv_n_i (ACE_HANDLE handle,
|
||||
void *buf,
|
||||
size_t len,
|
||||
int flags,
|
||||
const ACE_Time_Value *timeout,
|
||||
size_t *bytes_transferred);
|
||||
|
||||
#if defined (ACE_HAS_TLI)
|
||||
|
||||
extern ACE_Export ssize_t t_rcv_n_i (ACE_HANDLE handle,
|
||||
void *buf,
|
||||
size_t len,
|
||||
int *flags,
|
||||
size_t *bytes_transferred);
|
||||
|
||||
extern ACE_Export ssize_t t_rcv_n_i (ACE_HANDLE handle,
|
||||
void *buf,
|
||||
size_t len,
|
||||
int *flags,
|
||||
const ACE_Time_Value *timeout,
|
||||
size_t *bytes_transferred);
|
||||
|
||||
#endif /* ACE_HAS_TLI */
|
||||
|
||||
extern ACE_Export ssize_t recv_n_i (ACE_HANDLE handle,
|
||||
void *buf,
|
||||
size_t len,
|
||||
size_t *bytes_transferred);
|
||||
|
||||
extern ACE_Export ssize_t recv_n_i (ACE_HANDLE handle,
|
||||
void *buf,
|
||||
size_t len,
|
||||
const ACE_Time_Value *timeout,
|
||||
size_t *bytes_transferred);
|
||||
|
||||
extern ACE_Export ssize_t recvv_n_i (ACE_HANDLE handle,
|
||||
iovec *iov,
|
||||
int iovcnt,
|
||||
size_t *bytes_transferred);
|
||||
|
||||
extern ACE_Export ssize_t recvv_n_i (ACE_HANDLE handle,
|
||||
iovec *iov,
|
||||
int iovcnt,
|
||||
const ACE_Time_Value *timeout,
|
||||
size_t *bytes_transferred);
|
||||
|
||||
//
|
||||
// = Send_n helpers
|
||||
//
|
||||
|
||||
ACE_NAMESPACE_INLINE_FUNCTION ssize_t send_i (ACE_HANDLE handle,
|
||||
const void *buf,
|
||||
size_t len);
|
||||
|
||||
extern ACE_Export ssize_t send_n_i (ACE_HANDLE handle,
|
||||
const void *buf,
|
||||
size_t len,
|
||||
int flags,
|
||||
size_t *bytes_transferred);
|
||||
|
||||
extern ACE_Export ssize_t send_n_i (ACE_HANDLE handle,
|
||||
const void *buf,
|
||||
size_t len,
|
||||
int flags,
|
||||
const ACE_Time_Value *timeout,
|
||||
size_t *bytes_transferred);
|
||||
|
||||
#if defined (ACE_HAS_TLI)
|
||||
|
||||
extern ACE_Export ssize_t t_snd_n_i (ACE_HANDLE handle,
|
||||
const void *buf,
|
||||
size_t len,
|
||||
int flags,
|
||||
size_t *bytes_transferred);
|
||||
|
||||
extern ACE_Export ssize_t t_snd_n_i (ACE_HANDLE handle,
|
||||
const void *buf,
|
||||
size_t len,
|
||||
int flags,
|
||||
const ACE_Time_Value *timeout,
|
||||
size_t *bytes_transferred);
|
||||
|
||||
#endif /* ACE_HAS_TLI */
|
||||
|
||||
extern ACE_Export ssize_t send_n_i (ACE_HANDLE handle,
|
||||
const void *buf,
|
||||
size_t len,
|
||||
size_t *bytes_transferred);
|
||||
|
||||
extern ACE_Export ssize_t send_n_i (ACE_HANDLE handle,
|
||||
const void *buf,
|
||||
size_t len,
|
||||
const ACE_Time_Value *timeout,
|
||||
size_t *bytes_transferred);
|
||||
|
||||
extern ACE_Export ssize_t sendv_n_i (ACE_HANDLE handle,
|
||||
const iovec *iov,
|
||||
int iovcnt,
|
||||
size_t *bytes_transferred);
|
||||
|
||||
extern ACE_Export ssize_t sendv_n_i (ACE_HANDLE handle,
|
||||
const iovec *iov,
|
||||
int iovcnt,
|
||||
const ACE_Time_Value *timeout,
|
||||
size_t *bytes_transferred);
|
||||
|
||||
}
|
||||
|
||||
// Close versioned namespace, if enabled by the user.
|
||||
ACE_END_VERSIONED_NAMESPACE_DECL
|
||||
|
||||
#if defined (__ACE_INLINE__)
|
||||
#include "ace/ACE.inl"
|
||||
#endif /* __ACE_INLINE__ */
|
||||
|
||||
#include /**/ "ace/post.h"
|
||||
|
||||
#endif /* ACE_ACE_H */
|
||||
|
|
@ -1,333 +0,0 @@
|
|||
// -*- C++ -*-
|
||||
//
|
||||
// $Id: ACE.inl 95761 2012-05-15 18:23:04Z johnnyw $
|
||||
|
||||
#include "ace/OS_NS_unistd.h"
|
||||
#include "ace/OS_NS_Thread.h"
|
||||
#include "ace/OS_NS_ctype.h"
|
||||
#include "ace/OS_NS_sys_socket.h"
|
||||
|
||||
// Open versioned namespace, if enabled by the user.
|
||||
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
|
||||
|
||||
|
||||
// Wrappers for methods that have been moved to ACE_OS.
|
||||
|
||||
ACE_INLINE ssize_t
|
||||
ACE::read_n (ACE_HANDLE handle,
|
||||
void *buf,
|
||||
size_t len,
|
||||
size_t *bytes_transferred)
|
||||
{
|
||||
return ACE_OS::read_n (handle,
|
||||
buf,
|
||||
len,
|
||||
bytes_transferred);
|
||||
}
|
||||
|
||||
ACE_INLINE ssize_t
|
||||
ACE::write_n (ACE_HANDLE handle,
|
||||
const void *buf,
|
||||
size_t len,
|
||||
size_t *bytes_transferred)
|
||||
{
|
||||
return ACE_OS::write_n (handle,
|
||||
buf,
|
||||
len,
|
||||
bytes_transferred);
|
||||
}
|
||||
|
||||
ACE_INLINE ssize_t
|
||||
ACE::recv_n (ACE_HANDLE handle,
|
||||
void *buf,
|
||||
size_t len,
|
||||
int flags,
|
||||
const ACE_Time_Value *timeout,
|
||||
size_t *bytes_transferred)
|
||||
{
|
||||
if (timeout == 0)
|
||||
return ACE::recv_n_i (handle,
|
||||
buf,
|
||||
len,
|
||||
flags,
|
||||
bytes_transferred);
|
||||
else
|
||||
return ACE::recv_n_i (handle,
|
||||
buf,
|
||||
len,
|
||||
flags,
|
||||
timeout,
|
||||
bytes_transferred);
|
||||
}
|
||||
|
||||
#if defined (ACE_HAS_TLI)
|
||||
|
||||
ACE_INLINE ssize_t
|
||||
ACE::t_rcv_n (ACE_HANDLE handle,
|
||||
void *buf,
|
||||
size_t len,
|
||||
int *flags,
|
||||
const ACE_Time_Value *timeout,
|
||||
size_t *bytes_transferred)
|
||||
{
|
||||
if (timeout == 0)
|
||||
return ACE::t_rcv_n_i (handle,
|
||||
buf,
|
||||
len,
|
||||
flags,
|
||||
bytes_transferred);
|
||||
else
|
||||
return ACE::t_rcv_n_i (handle,
|
||||
buf,
|
||||
len,
|
||||
flags,
|
||||
timeout,
|
||||
bytes_transferred);
|
||||
}
|
||||
|
||||
#endif /* ACE_HAS_TLI */
|
||||
|
||||
ACE_INLINE ssize_t
|
||||
ACE::recv_n (ACE_HANDLE handle,
|
||||
void *buf,
|
||||
size_t len,
|
||||
const ACE_Time_Value *timeout,
|
||||
size_t *bytes_transferred)
|
||||
{
|
||||
if (timeout == 0)
|
||||
return ACE::recv_n_i (handle,
|
||||
buf,
|
||||
len,
|
||||
bytes_transferred);
|
||||
else
|
||||
return ACE::recv_n_i (handle,
|
||||
buf,
|
||||
len,
|
||||
timeout,
|
||||
bytes_transferred);
|
||||
}
|
||||
|
||||
ACE_INLINE ssize_t
|
||||
ACE::recvv_n (ACE_HANDLE handle,
|
||||
iovec *iov,
|
||||
int iovcnt,
|
||||
const ACE_Time_Value *timeout,
|
||||
size_t *bytes_transferred)
|
||||
{
|
||||
if (timeout == 0)
|
||||
return ACE::recvv_n_i (handle,
|
||||
iov,
|
||||
iovcnt,
|
||||
bytes_transferred);
|
||||
else
|
||||
return ACE::recvv_n_i (handle,
|
||||
iov,
|
||||
iovcnt,
|
||||
timeout,
|
||||
bytes_transferred);
|
||||
}
|
||||
|
||||
ACE_INLINE ssize_t
|
||||
ACE::send_n (ACE_HANDLE handle,
|
||||
const void *buf,
|
||||
size_t len,
|
||||
int flags,
|
||||
const ACE_Time_Value *timeout,
|
||||
size_t *bytes_transferred)
|
||||
{
|
||||
if (timeout == 0)
|
||||
return ACE::send_n_i (handle,
|
||||
buf,
|
||||
len,
|
||||
flags,
|
||||
bytes_transferred);
|
||||
else
|
||||
return ACE::send_n_i (handle,
|
||||
buf,
|
||||
len,
|
||||
flags,
|
||||
timeout,
|
||||
bytes_transferred);
|
||||
}
|
||||
|
||||
#if defined (ACE_HAS_TLI)
|
||||
|
||||
ACE_INLINE ssize_t
|
||||
ACE::t_snd_n (ACE_HANDLE handle,
|
||||
const void *buf,
|
||||
size_t len,
|
||||
int flags,
|
||||
const ACE_Time_Value *timeout,
|
||||
size_t *bytes_transferred)
|
||||
{
|
||||
if (timeout == 0)
|
||||
return ACE::t_snd_n_i (handle,
|
||||
buf,
|
||||
len,
|
||||
flags,
|
||||
bytes_transferred);
|
||||
else
|
||||
return ACE::t_snd_n_i (handle,
|
||||
buf,
|
||||
len,
|
||||
flags,
|
||||
timeout,
|
||||
bytes_transferred);
|
||||
}
|
||||
|
||||
#endif /* ACE_HAS_TLI */
|
||||
|
||||
ACE_INLINE ssize_t
|
||||
ACE::send_n (ACE_HANDLE handle,
|
||||
const void *buf,
|
||||
size_t len,
|
||||
const ACE_Time_Value *timeout,
|
||||
size_t *bytes_transferred)
|
||||
{
|
||||
if (timeout == 0)
|
||||
return ACE::send_n_i (handle,
|
||||
buf,
|
||||
len,
|
||||
bytes_transferred);
|
||||
else
|
||||
return ACE::send_n_i (handle,
|
||||
buf,
|
||||
len,
|
||||
timeout,
|
||||
bytes_transferred);
|
||||
}
|
||||
|
||||
ACE_INLINE ssize_t
|
||||
ACE::sendv_n (ACE_HANDLE handle,
|
||||
const iovec *iov,
|
||||
int iovcnt,
|
||||
const ACE_Time_Value *timeout,
|
||||
size_t *bytes_transferred)
|
||||
{
|
||||
if (timeout == 0)
|
||||
return ACE::sendv_n_i (handle,
|
||||
iov,
|
||||
iovcnt,
|
||||
bytes_transferred);
|
||||
else
|
||||
return ACE::sendv_n_i (handle,
|
||||
iov,
|
||||
iovcnt,
|
||||
timeout,
|
||||
bytes_transferred);
|
||||
}
|
||||
|
||||
ACE_INLINE ssize_t
|
||||
ACE::send_i (ACE_HANDLE handle, const void *buf, size_t len)
|
||||
{
|
||||
#if defined (ACE_WIN32) || defined (HPUX)
|
||||
return ACE_OS::send (handle, (const char *) buf, len);
|
||||
#else
|
||||
return ACE_OS::write (handle, (const char *) buf, len);
|
||||
#endif /* ACE_WIN32 */
|
||||
}
|
||||
|
||||
ACE_INLINE ssize_t
|
||||
ACE::recv_i (ACE_HANDLE handle, void *buf, size_t len)
|
||||
{
|
||||
#if defined (ACE_WIN32) || defined (ACE_OPENVMS)
|
||||
return ACE_OS::recv (handle, (char *) buf, len);
|
||||
#else
|
||||
return ACE_OS::read (handle, (char *) buf, len);
|
||||
#endif /* ACE_WIN32 */
|
||||
}
|
||||
|
||||
ACE_INLINE int
|
||||
ACE::handle_read_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout)
|
||||
{
|
||||
return ACE::handle_ready (handle, timeout, 1, 0, 0);
|
||||
}
|
||||
|
||||
ACE_INLINE int
|
||||
ACE::handle_write_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout)
|
||||
{
|
||||
return ACE::handle_ready (handle, timeout, 0, 1, 0);
|
||||
}
|
||||
|
||||
ACE_INLINE int
|
||||
ACE::handle_exception_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout)
|
||||
{
|
||||
return ACE::handle_ready (handle, timeout, 0, 0, 1);
|
||||
}
|
||||
|
||||
ACE_INLINE void
|
||||
ACE::strdelete (char *s)
|
||||
{
|
||||
delete [] s;
|
||||
}
|
||||
|
||||
#if defined (ACE_HAS_WCHAR)
|
||||
ACE_INLINE void
|
||||
ACE::strdelete (wchar_t *s)
|
||||
{
|
||||
delete [] s;
|
||||
}
|
||||
#endif /* ACE_HAS_WCHAR */
|
||||
|
||||
ACE_INLINE bool
|
||||
ACE::isdotdir (const char *s)
|
||||
{
|
||||
return (s[0] == '.' &&
|
||||
((s[1] == 0) || (s[1] == '.' && s[2] == 0)));
|
||||
}
|
||||
|
||||
#if defined (ACE_HAS_WCHAR)
|
||||
ACE_INLINE bool
|
||||
ACE::isdotdir (const wchar_t *s)
|
||||
{
|
||||
return (s[0] == ACE_TEXT ('.') &&
|
||||
((s[1] == 0) || (s[1] == ACE_TEXT ('.') && s[2] == 0)));
|
||||
}
|
||||
#endif /* ACE_HAS_WCHAR */
|
||||
|
||||
ACE_INLINE void
|
||||
ACE::unique_name (const void *object,
|
||||
ACE_TCHAR *name,
|
||||
size_t length)
|
||||
{
|
||||
ACE_OS::unique_name (object, name, length);
|
||||
}
|
||||
|
||||
ACE_INLINE u_long
|
||||
ACE::log2 (u_long num)
|
||||
{
|
||||
u_long log = 0;
|
||||
|
||||
for (; num > 1; ++log)
|
||||
num >>= 1;
|
||||
|
||||
return log;
|
||||
}
|
||||
|
||||
ACE_INLINE int
|
||||
ACE::map_errno (int error)
|
||||
{
|
||||
#if defined (ACE_WIN32)
|
||||
switch (error)
|
||||
{
|
||||
case WSAEWOULDBLOCK:
|
||||
return EAGAIN; // Same as UNIX errno EWOULDBLOCK.
|
||||
}
|
||||
#endif /* ACE_WIN32 */
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
ACE_INLINE u_char
|
||||
ACE::hex2byte (ACE_TCHAR c)
|
||||
{
|
||||
if (ACE_OS::ace_isdigit (c))
|
||||
return (u_char) (c - ACE_TEXT ('0'));
|
||||
else if (ACE_OS::ace_islower (c))
|
||||
return (u_char) (10 + c - ACE_TEXT ('a'));
|
||||
else
|
||||
return (u_char) (10 + c - ACE_TEXT ('A'));
|
||||
}
|
||||
|
||||
// Close versioned namespace, if enabled by the user.
|
||||
ACE_END_VERSIONED_NAMESPACE_DECL
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue