Compare commits
22
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b07022379 | ||
|
|
a4fce0b3b1 | ||
|
|
79ad1f8d51 | ||
|
|
73aef11554 | ||
|
|
318916abc9 | ||
|
|
164a9d604a | ||
|
|
7696b115ae | ||
|
|
b8ecaf336c | ||
|
|
1ea8ebf84c | ||
|
|
9f70fe5373 | ||
|
|
9695ede7c2 | ||
|
|
a5cd72d5db | ||
|
|
f87e282981 | ||
|
|
4b15972543 | ||
|
|
d5753bb15a | ||
|
|
a92e5b3f7b | ||
|
|
72d2357560 | ||
|
|
d306b560b1 | ||
|
|
4d331d9c9f | ||
|
|
932f6d83f7 | ||
|
|
d57783aa3a | ||
|
|
1d79854d3b |
No files matched your search
+7
-8
@@ -13,17 +13,16 @@ Win32_LIB_ASM_Release
|
||||
*.dgb
|
||||
*.debug
|
||||
*.debug.txt
|
||||
/bin/VC10/
|
||||
/objs/VC10/
|
||||
*.user
|
||||
*.db
|
||||
*.opendb
|
||||
/.vs
|
||||
/debian
|
||||
/assets/debian
|
||||
/make
|
||||
/bin
|
||||
/build
|
||||
/build/*
|
||||
/CMakeUserPresets.json
|
||||
/out
|
||||
/objs/VC10
|
||||
*.kate-swp
|
||||
compile.sh
|
||||
*.gz
|
||||
.vscode/
|
||||
out
|
||||
build
|
||||
@@ -1,346 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e # Enable auto-exit for debugging :))
|
||||
|
||||
# Make Linux AppImage program data
|
||||
# https://docs.appimage.org/reference/appdir.html
|
||||
|
||||
# PWD: {repo_root}/build
|
||||
# See deployer.sh for usage
|
||||
|
||||
# Terminal stuff
|
||||
RESET="$(tput sgr0)" #"\e[0m" # Resets terminal colors
|
||||
|
||||
# Colors for various information types
|
||||
FAILURE="$(tput setaf 1)" #"\e[91m"
|
||||
SUCCESS="$(tput setaf 2)" #"\e[92m"
|
||||
NOTICE="$(tput setaf 3)" #"\e[93m"
|
||||
VERBOSE="$(tput setaf 4)" #"\e[94m"
|
||||
|
||||
verbosity=0 # By default don't print anything unless it's *ultra* important.
|
||||
quiet=0 # Also don't print anything if they supplied the quiet argument
|
||||
|
||||
# URL from which to download appimagetool if there isn't one available in your $PATH
|
||||
# at time of writing only aarch64, armhf, i686, and x86_64 versions are available via this method
|
||||
# in those cases, and honestly even outside of those cases, it's better to just put a working one in your $PATH yourself..
|
||||
url="https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-$(uname -m).AppImage"
|
||||
|
||||
# A whitelist of libraries to include into SRB2's AppImage if SRB2 is dynamically linked.
|
||||
# please don't add a newline at the end of this or i will cry :(
|
||||
libraryWhitelist="
|
||||
libbacktrace
|
||||
libnsl
|
||||
libSDL2
|
||||
libSDL2_mixer
|
||||
libgme
|
||||
libopenmpt
|
||||
libpng
|
||||
libfluidsynth
|
||||
libpulse
|
||||
libmodplug
|
||||
libvorbisfile
|
||||
libopusfile
|
||||
libFLAC
|
||||
libmad
|
||||
libmpg123
|
||||
libvorbis
|
||||
libpulsecommon
|
||||
libsndfile
|
||||
libsndio
|
||||
libogg
|
||||
libvorbisenc
|
||||
libjson
|
||||
libreadline
|
||||
libwrap
|
||||
libtinfo
|
||||
libtirpc
|
||||
libpng16"
|
||||
|
||||
# these kinda look like macros don't they
|
||||
function print { (( "$quiet" == 0 )) && echo "$@" || :; } # echo if not quiet
|
||||
function coloredText { printf "$1"; print "${@:2}"; printf "$RESET"; } # use print to inherit quiet
|
||||
function success { coloredText "$SUCCESS" "$@"; } # use coloredText to inherit quiet
|
||||
function important { coloredText "$NOTICE" "$@"; } # use coloredText to inherit quiet
|
||||
function verboseOnly { (( "$verbosity" >= $1 )) && (coloredText "$VERBOSE" "${@:2}") || :; } # use coloredText to inherit quiet
|
||||
|
||||
# Parses an argument with a single dash
|
||||
function parseSingleDashArg() {
|
||||
while read -n 1 char; do
|
||||
if [[ "$char" == '-' || "$char" == '' ]]; then
|
||||
:
|
||||
elif [[ "$char" == 'h' ]]; then
|
||||
helppassed=1
|
||||
elif [[ "$char" == 'q' ]]; then
|
||||
quiet=1
|
||||
elif [[ "$char" == 'v' ]]; then
|
||||
verbosity="$((verbosity + 1))"
|
||||
elif [[ "$char" == 'd' ]]; then
|
||||
dry=1
|
||||
elif [[ "$char" == 's' ]]; then
|
||||
small=1
|
||||
else
|
||||
echo "$0: invalid option -- '$1'"
|
||||
echo "Try '$0 --help' for more information."
|
||||
return 1
|
||||
fi
|
||||
done <<<"$1"
|
||||
}
|
||||
|
||||
# Simple help argument checker.
|
||||
currentarg=1; # Which argument is --help...
|
||||
|
||||
# For $arg in the argument array...
|
||||
for arg in "$@"; do
|
||||
# Is it a help argument?
|
||||
if [[ "$arg" == "--help" ]]; then
|
||||
helppassed=1; # Help is passed, set $helppassed!
|
||||
set -- "${@:1:$currentarg-1}" "${@:$currentarg+1}" # Remove argument from list
|
||||
elif [[ "$arg" == "--quiet" ]]; then
|
||||
quiet=1
|
||||
set -- "${@:1:$currentarg-1}" "${@:$currentarg+1}"
|
||||
elif [[ "$arg" == "--verbose" ]]; then
|
||||
verbosity="$((verbosity + 1))" # Increase verbosity!
|
||||
set -- "${@:1:$currentarg-1}" "${@:$currentarg+1}"
|
||||
elif [[ "$arg" == "--dry" ]]; then
|
||||
dry=1; # Show parameters instead of using them.
|
||||
set -- "${@:1:$currentarg-1}" "${@:$currentarg+1}"
|
||||
elif [[ "$arg" == "--small" ]]; then
|
||||
small=1; # Don't copy assets to save on bandwidth.
|
||||
set -- "${@:1:$currentarg-1}" "${@:$currentarg+1}"
|
||||
elif [[ ! "$arg" == *'--'* && "$arg" == *'-'* ]]; then
|
||||
parseSingleDashArg "$arg"
|
||||
|
||||
if [[ "$?" == 0 ]]; then
|
||||
set -- "${@:1:$currentarg-1}" "${@:$currentarg+1}" # Remove argument from list
|
||||
fi
|
||||
elif [[ $arg == *'--'* ]]; then
|
||||
print "$0: invalid option -- '$1'"
|
||||
print "Try '$0 --help' for more information."
|
||||
return 1
|
||||
else
|
||||
currentarg="$((currentarg+1))" # Increment current argument number otherwise...
|
||||
fi
|
||||
done
|
||||
|
||||
important "SRB2Kart AppImage Packager v1.0 modified for kart by NepDisk."
|
||||
important "Orignal for SRB2 my mazmazz and Golden."
|
||||
|
||||
# Get root directory from the full path of this script.
|
||||
__ROOT_DIR="$3"
|
||||
|
||||
if [[ -z "$3" ]]; then
|
||||
# finds out where this script is and goes to that directory and goes up one for the root
|
||||
|
||||
scriptdir="$(dirname "${BASH_SOURCE[0]}")"
|
||||
scriptbase="$(basename "${BASH_SOURCE[0]}")"
|
||||
|
||||
__ROOT_DIR="$(cd "$scriptdir" && pwd -P)"
|
||||
fi
|
||||
|
||||
# If it starts with '.', put the current working directory behind it so things work.
|
||||
if [[ "$__ROOT_DIR" == '.' || "$__ROOT_DIR" == '..' ]]; then
|
||||
__ROOT_DIR="$PWD/$__ROOT_DIR"
|
||||
fi
|
||||
|
||||
# Set up defaults
|
||||
__PROGRAM_NAME="${PROGRAM_NAME:-"SRB2Kart Saturn"}"
|
||||
__PROGRAM_DESCRIPTION="${PROGRAM_DESCRIPTION:-"Modded version of SRB2kart with more features."}"
|
||||
__PROGRAM_FILENAME="${PROGRAM_FILENAME:-"lsdl2srb2kart"}"
|
||||
__PROGRAM_ASSETS="${PROGRAM_ASSETS:-"$__ROOT_DIR/assets/installer"}"
|
||||
|
||||
__BUILD_DIR="${1:-"$__ROOT_DIR/bin"}"
|
||||
__OUTPUT_FILENAME="${2:-"$__PROGRAM_FILENAME.AppImage"}"
|
||||
|
||||
__APPIMAGETOOL="${4:-"appimagetool"}"
|
||||
|
||||
if (! command -v "$__APPIMAGETOOL" &> /dev/null); then
|
||||
__APPIMAGETOOL=
|
||||
fi
|
||||
|
||||
# Stuff that prints and exits.
|
||||
|
||||
# Prints setup text using method given by arguments.
|
||||
# Example: printSetup "print" # print "Setup for AppImage...
|
||||
function printSetup {
|
||||
$@ "Setup for AppImage in BUILD_DIR: '$__BUILD_DIR'..."
|
||||
$@ "With the OUTPUT_FILENAME: '$__OUTPUT_FILENAME'"
|
||||
$@ "And SRB2 Repository Root ROOT_DIR: '$__ROOT_DIR'"
|
||||
$@ "Using APPIMAGETOOL: '$([ -z "$__APPIMAGETOOL" ] && echo '(download)' || echo $__APPIMAGETOOL)'"
|
||||
$@ ""
|
||||
$@ "This should be run from a Makefile or from the directory of the build. If it is not, then change to that directory or specify that directory as an argument."
|
||||
$@ "If ROOT_DIR isn't SRB2's repository root, specify that as an argument too."
|
||||
$@ "Make must have built the program before you run this script."
|
||||
$@ ""
|
||||
$@ "Make sure these Environment Variables are correct."
|
||||
$@ "If not, then enter: export PROGRAM_VARIABLE=value"
|
||||
$@ "PROGRAM_NAME: $__PROGRAM_NAME"
|
||||
$@ "PROGRAM_DESCRIPTION: $__PROGRAM_DESCRIPTION"
|
||||
$@ "PROGRAM_FILENAME: $__PROGRAM_FILENAME"
|
||||
$@ "PROGRAM_ASSETS: $__PROGRAM_ASSETS"
|
||||
}
|
||||
|
||||
if [[ "$helppassed" ]]; then
|
||||
print "Usage: $(basename "$0") [OPTION]... [BUILD_DIR] [OUTPUT_NAME] [ROOT_DIR] [APPIMAGETOOL]"
|
||||
print "Packages a SRB2 binary into an AppImage."
|
||||
print "OPTIONs may be included anywhere within the arguments."
|
||||
print ""
|
||||
print "Arguments:"
|
||||
print " -h, --help display this help and exit."
|
||||
print " -q, --quiet don't display any text."
|
||||
print " -v, --verbose make commands more verbose, will always print."
|
||||
print " -s, --small don't copy SRB2 assets to save on bandwidth."
|
||||
print " parameters regardless of --dry."
|
||||
print " -d, --dry print parameters and exit."
|
||||
print ""
|
||||
if (( "$verbosity" > 0 )) || [[ "$dry" ]]; then
|
||||
printSetup "print"
|
||||
else
|
||||
print "This should be run from a Makefile or from the directory of the build."
|
||||
print "Make must have built the program before you run this script."
|
||||
fi
|
||||
exit;
|
||||
fi
|
||||
|
||||
if (( "$verbosity" > 0 )) || [[ "$dry" ]]; then
|
||||
printSetup "verboseOnly" "0"
|
||||
verboseOnly 0 ""
|
||||
|
||||
if [[ "$dry" ]]; then
|
||||
set -n # Enable debug mode and verbose for dry run.
|
||||
fi
|
||||
fi
|
||||
|
||||
# End stuff that prints and exits.
|
||||
|
||||
if (( "$verbosity" >= 4 )); then
|
||||
set -v # Really verbose? Print *everything*!
|
||||
fi
|
||||
|
||||
# Define AppDir structure
|
||||
mkdir -p "$__BUILD_DIR/AppDir/usr/bin"
|
||||
mkdir -p "$__BUILD_DIR/AppDir/lib"
|
||||
mkdir -p "$__BUILD_DIR/AppDir/usr/share/applications"
|
||||
mkdir -p "$__BUILD_DIR/AppDir/usr/share/icons/hicolor/256x256/apps"
|
||||
|
||||
# Copy program data
|
||||
if [[ ! $small ]]; then
|
||||
verboseOnly 1 "Packaging program assets..."
|
||||
cp -r "$__PROGRAM_ASSETS"/* "$__BUILD_DIR/AppDir/usr/bin/"
|
||||
cp -r "$__BUILD_DIR/$__PROGRAM_FILENAME" "$__BUILD_DIR/AppDir/usr/bin"
|
||||
else
|
||||
verboseOnly 1 "Skipping program asset packing, --small or -s passed..."
|
||||
fi
|
||||
|
||||
verboseOnly 1 "Packaging SRB2..."
|
||||
verboseOnly 1 "Assuming executable name $__PROGRAM_FILENAME"
|
||||
cp -r "$__BUILD_DIR/$__PROGRAM_FILENAME" "$__BUILD_DIR/AppDir/usr/bin"
|
||||
|
||||
# Copy required dependencies, but only if the program is dynamically linked.
|
||||
verboseOnly 1 "Testing if this build is dynamically linked..."
|
||||
|
||||
set +e # Disable auto-exit for ldd.
|
||||
|
||||
srb2Libraries="$(ldd "$__BUILD_DIR/$__PROGRAM_FILENAME")"
|
||||
exitcode="$?"
|
||||
|
||||
set -e # Enable it again!
|
||||
|
||||
if (( $exitcode == 0 )); then
|
||||
verboseOnly 1 "This build *is* dynamically linked! Packaging dependencies."
|
||||
|
||||
# read the dynamic libraries of srb2, trim off beginning whitespace, and get the third field seperated by spaces
|
||||
# this gives us a newline-seperated list of libraries with their full paths.
|
||||
srb2Libraries="$(echo "$srb2Libraries" | cut -f 2 | cut -d ' ' -f 3)"
|
||||
|
||||
# remove any extraneous newlines around the string
|
||||
libraryWhitelist="$(echo $libraryWhitelist | head -c -1 | tr ' ' '\n')"
|
||||
|
||||
# replace e.g. 'abc' with '(/abc\b)', and replace newlines with '|'.
|
||||
# this converts it into a grep regular expression to check for any whitelisted library names.
|
||||
libraryWhitelist="$(printf "%s" "$libraryWhitelist" | sed 's|.*|(/\0\\b)|' | tr '\n' '|')"
|
||||
|
||||
# grab only the entries that match the regex
|
||||
__LDD_LIST="$(printf "%s" "$srb2Libraries" | grep -E "$libraryWhitelist")"
|
||||
|
||||
# use echo to convert the newline-seperated list into an argument list
|
||||
__LDD_LIST="$(echo $__LDD_LIST)"
|
||||
|
||||
# read into an array because i can't be bothered iterating the lines of a string today
|
||||
# there's so many other things in this file that'd need to be adjusted to be POSIX-compliant anyway
|
||||
IFS=' ' read -r -a paths <<< "$__LDD_LIST"
|
||||
|
||||
for path in "${paths[@]}"; do
|
||||
if [ -f "$path" ]; then
|
||||
verboseOnly 2 "Packaging dependency $(basename "$path")..."
|
||||
cp "$path" $__BUILD_DIR/AppDir/lib/
|
||||
else
|
||||
verboseOnly 2 "Dependency $(basename "$path") not found"
|
||||
fi
|
||||
done
|
||||
else
|
||||
verboseOnly 1 "This SRB2 build is statically linked, skipping dependency packing."
|
||||
fi
|
||||
|
||||
cd "$__BUILD_DIR/AppDir"
|
||||
|
||||
# Copy icons
|
||||
verboseOnly 1 "Packaging resources..."
|
||||
cp "$__ROOT_DIR/srb2.png" "./usr/share/icons/hicolor/256x256/apps/$__PROGRAM_FILENAME.png"
|
||||
ln -sf "./usr/share/icons/hicolor/256x256/apps/$__PROGRAM_FILENAME.png" "./.DirIcon"
|
||||
ln -sf "./usr/share/icons/hicolor/256x256/apps/$__PROGRAM_FILENAME.png" "./$__PROGRAM_FILENAME.png"
|
||||
|
||||
# Make desktop descriptor
|
||||
cat > "./usr/share/applications/$__PROGRAM_FILENAME.desktop" <<EOF
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=$__PROGRAM_NAME
|
||||
Comment=$__PROGRAM_DESCRIPTION
|
||||
Icon=$__PROGRAM_FILENAME
|
||||
Exec=AppRun %F
|
||||
Categories=Game;
|
||||
EOF
|
||||
|
||||
ln -sf "./usr/share/applications/$__PROGRAM_FILENAME.desktop" "./$__PROGRAM_FILENAME.desktop"
|
||||
|
||||
# Make entry point
|
||||
echo -e '#!'"$(dirname "$SHELL")/sh" > ./AppRun
|
||||
echo -e 'HERE="$(dirname "$(readlink -f "${0}")")"' >> ./AppRun
|
||||
echo -e 'SRB2WADDIR=$HERE/usr/bin LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HERE/lib exec $HERE/usr/bin/'"$__PROGRAM_FILENAME"' "$@"' >> ./AppRun
|
||||
chmod +x ./AppRun
|
||||
|
||||
cd .. # now in $__BUILD_DIR
|
||||
|
||||
# Package AppImage
|
||||
if [ -z "$__APPIMAGETOOL" ]; then
|
||||
verboseOnly 1 "No valid appimagetool path given or detected, downloading appimagetool..."
|
||||
|
||||
# Print notice for internet connection.
|
||||
important "If the command hangs here, check your internet connection, or download appimagetool and add it to your \$PATH and try compiling again."
|
||||
|
||||
(( "$verbosity" >= 3 )) && wget "$url" || wget -q "$url"
|
||||
|
||||
APPIMAGETOOL="./$(basename "$url")"
|
||||
chmod a+x "$APPIMAGETOOL"
|
||||
else
|
||||
verboseOnly 1 "appimagetool path given or detected, no download required."
|
||||
APPIMAGETOOL="$__APPIMAGETOOL"
|
||||
fi
|
||||
|
||||
verboseOnly 1 "Packing AppImage $__OUTPUT_FILENAME"
|
||||
|
||||
if (( verbosity >= 3 )); then
|
||||
"$APPIMAGETOOL" ./AppDir "$__OUTPUT_FILENAME"
|
||||
elif (( verbosity >= 2 )); then
|
||||
"$APPIMAGETOOL" ./AppDir "$__OUTPUT_FILENAME" >/dev/null
|
||||
else
|
||||
"$APPIMAGETOOL" ./AppDir "$__OUTPUT_FILENAME" >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
success "AppImage ready!"
|
||||
verboseOnly 1 "Cleaning up files..."
|
||||
rm -r ./AppDir
|
||||
|
||||
if [ -z "$__APPIMAGETOOL" ]; then
|
||||
rm "$APPIMAGETOOL"
|
||||
fi
|
||||
|
||||
cd "$__ROOT_DIR" # snap back to reality
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
cmake_minimum_required(VERSION 3.0)
|
||||
# DO NOT CHANGE THIS SRB2 STRING! Some variable names depend on this string.
|
||||
# Version change is fine.
|
||||
project(SRB2
|
||||
|
||||
-73
@@ -28,10 +28,6 @@ exist.
|
||||
Returns the values of the given HUD item's `xoffset`/`yoffset` cvars.
|
||||
Available for any HUD item with offset cvars.
|
||||
|
||||
## patch = v.cachePatchRotated(name, rollangle)
|
||||
Like v.cachePatch, it caches a new patch with the corresponding name. Unlike v.cachePatch, however,
|
||||
a rollangle can be supplied to the function so that it returns a rotated patch instead.
|
||||
|
||||
## x, y, flags = v.getDrawInfo(item)
|
||||
|
||||
Returns the X, Y and flags where the given HUD item will be drawn for the current displayplayer.
|
||||
@@ -134,72 +130,3 @@ if rawget(_G, "S_StopSoundByNum") ~= nil then
|
||||
... -- Can use it
|
||||
end
|
||||
```
|
||||
## addHook("ServerJoin", function())
|
||||
|
||||
ServerJoin hook called when client joins server (starting a listen server also calls it for host).
|
||||
Generally it was made to make loading custom config files less hacky, but can be used for anything else too.
|
||||
|
||||
## player.viewrollangle field
|
||||
|
||||
Returns player's current view roll angle for the Screen Tilting feature, useful for HUD elements.
|
||||
|
||||
## G_SetPlayerGamepadIndicatorColor(player, skincolor)
|
||||
|
||||
Set a custom color for Supported Gamepads with RGB LED functionality.
|
||||
To be used with Displayplayers.
|
||||
Only takes Skincolors.
|
||||
Best to be used in a Loop to ensure the color wont get overwritten by the game.
|
||||
|
||||
## G_PlayerDeviceRumble(player, low_strength, high_strength, -optional- duration)
|
||||
|
||||
Add Gamepad Rumble support for things.
|
||||
To be used with Displayplayers.
|
||||
Duration is in milliseconds and is optional to set, default value is 84ms.
|
||||
|
||||
## P_CheckSightFast(mo1, mo2)
|
||||
|
||||
Exactly same as P_CheckSight but uses cheaper algorithm, useful for things like nametags. Doesn't work exactly
|
||||
like P_CheckSight so don't use it for anything gameplay-related.
|
||||
|
||||
## musicdef_t
|
||||
|
||||
Userdata structure representing a musicdef. Fields:
|
||||
|
||||
`musicdef.name` - song identifier ("kmap01" for example).
|
||||
|
||||
`musicdef.usage`, `musicdef.source` - fields from vanilla MUSICDEFS lump.
|
||||
|
||||
`musicdef.filename` - unused for now.
|
||||
|
||||
`musicdef.title`, `musicdef.alttitle`, `musicdef.authors` - fields from MUSCINFO lump.
|
||||
|
||||
`#musicdef` - returns integer id for musicdef (which can be used as index in `musicdefs`).
|
||||
|
||||
All fields are read-only.
|
||||
|
||||
## S_FindMusicCredit(name)
|
||||
|
||||
Returns musicdef corresponding to music with given identifier. For example, `S_FindMusicCredit("kmap01")` will return
|
||||
musicdef for green hills music.
|
||||
|
||||
## musicdefs
|
||||
|
||||
Global table for all musicdefs, similar to mobjinfo, states, etc. Can take either integer indices,
|
||||
from `0` to `#musicdefs-1`, or string indices (which is equal to calling `S_FindMusicCredit`).
|
||||
|
||||
## addHook("MusicCredit", function(musicdef))
|
||||
|
||||
Hook is called whenever `S_ShowMusicCredit` (either from game or mod) is called. Takes musicdef as only argument, returning true
|
||||
will overwrite vanilla behavior (not show music credit), can be used to implement custom music credit pop-ups.
|
||||
|
||||
# Other changes
|
||||
|
||||
## P_PlayRinglossSound(source, damager)
|
||||
|
||||
Add optional `damager` argument (should be `mobj_t`), which causes hurt sound also play for damager
|
||||
if `karthitemdialog` option is enabled
|
||||
|
||||
## K_PlayHitEmSound(mobj, victim)
|
||||
|
||||
Add optional `victim` argument (should be a player's `mobj_t`), which causes "hit em" sound to be
|
||||
delayed and played for victim too if `karthitemdialog` option is enabled
|
||||
@@ -1,8 +0,0 @@
|
||||
ifdef SILENT
|
||||
MAKEFLAGS+=--no-print-directory
|
||||
endif
|
||||
|
||||
all :
|
||||
|
||||
% ::
|
||||
@$(MAKE) -C src $(MAKECMDGOALS)
|
||||
@@ -76,7 +76,7 @@ Crashlogs now contain alot more informations. and even more if your build has de
|
||||
Also allows 64bit Windows builds to produce Crashlogs!
|
||||
|
||||
## MISC
|
||||
- Bird's Camera Tilting feature is no longer turned on by default
|
||||
- Bird's Camara Tilting feature is no longer turned on by default
|
||||
- Bird's warning on the title screen has been removed
|
||||
|
||||
## Bugs
|
||||
|
||||
@@ -1726,6 +1726,11 @@ HW3SOUND for 3D hardware sound support
|
||||
<Option compilerVar="CC" />
|
||||
</Unit>
|
||||
<Unit filename="src/r_draw.h" />
|
||||
<Unit filename="src/r_draw16.c">
|
||||
<Option compilerVar="CC" />
|
||||
<Option compile="0" />
|
||||
<Option link="0" />
|
||||
</Unit>
|
||||
<Unit filename="src/r_draw8.c">
|
||||
<Option compilerVar="CC" />
|
||||
<Option compile="0" />
|
||||
|
||||
@@ -773,6 +773,16 @@ Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[Unit79]
|
||||
FileName=src\r_draw16.c
|
||||
Folder=R_Rend
|
||||
Compile=0
|
||||
CompileCpp=0
|
||||
Link=0
|
||||
Priority=1000
|
||||
OverrideBuildCmd=0
|
||||
BuildCmd=
|
||||
|
||||
[Unit80]
|
||||
FileName=src\r_draw8.c
|
||||
Folder=R_Rend
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
@@ -0,0 +1,2 @@
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
@@ -0,0 +1 @@
|
||||
/lsdlsrb2
|
||||
@@ -0,0 +1,3 @@
|
||||
/lsdlsrb2
|
||||
/pnd
|
||||
/*.mo
|
||||
@@ -0,0 +1 @@
|
||||
/lsdlsrb2
|
||||
@@ -0,0 +1 @@
|
||||
/lsdlsrb2
|
||||
@@ -0,0 +1,4 @@
|
||||
*.exe
|
||||
*.mo
|
||||
r_opengl.dll
|
||||
*.bat
|
||||
@@ -0,0 +1,4 @@
|
||||
*.exe
|
||||
*.mo
|
||||
r_opengl.dll
|
||||
*.bat
|
||||
@@ -0,0 +1,3 @@
|
||||
/srb2sdl.exe
|
||||
/srb2win.exe
|
||||
/r_opengl.dll
|
||||
@@ -0,0 +1,4 @@
|
||||
*.exe
|
||||
*.mo
|
||||
r_opengl.dll
|
||||
*.bat
|
||||
@@ -0,0 +1,2 @@
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
@@ -0,0 +1,2 @@
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
@@ -0,0 +1,2 @@
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
+32
-32
@@ -1,32 +1,32 @@
|
||||
@echo off
|
||||
set BRA=Unknown
|
||||
set REV=illegal
|
||||
|
||||
copy nul: /b +%1\comptime.c tmp.$$$ > nul
|
||||
move tmp.$$$ %1\comptime.c > nul
|
||||
|
||||
if exist .git goto gitrev
|
||||
if exist ..\.git goto gitrev
|
||||
if exist .svn goto svnrev
|
||||
goto filwri
|
||||
|
||||
:gitrev
|
||||
set GIT=%2
|
||||
if "%GIT%"=="" set GIT=git
|
||||
for /f "usebackq" %%s in (`%GIT% rev-parse --abbrev-ref HEAD`) do @set BRA=%%s
|
||||
for /f "usebackq" %%s in (`%GIT% rev-parse HEAD`) do @set REV=%%s
|
||||
set REV=%REV:~0,8%
|
||||
goto filwri
|
||||
|
||||
:svnrev
|
||||
set BRA=Subversion
|
||||
for /f "usebackq" %%s in (`svnversion .`) do @set REV=%%s
|
||||
set REV=r%REV%
|
||||
goto filwri
|
||||
|
||||
:filwri
|
||||
echo // Do not edit! This file was autogenerated > %1\comptime.h
|
||||
echo // by the %0 batch file >> %1\comptime.h
|
||||
echo // >> %1\comptime.h
|
||||
echo const char* compbranch = "%BRA%"; >> %1\comptime.h
|
||||
echo const char* comprevision = "%REV%"; >> %1\comptime.h
|
||||
@echo off
|
||||
set BRA=Unknown
|
||||
set REV=illegal
|
||||
|
||||
copy nul: /b +%1\comptime.c tmp.$$$ > nul
|
||||
move tmp.$$$ %1\comptime.c > nul
|
||||
|
||||
if exist .git goto gitrev
|
||||
if exist ..\.git goto gitrev
|
||||
if exist .svn goto svnrev
|
||||
goto filwri
|
||||
|
||||
:gitrev
|
||||
set GIT=%2
|
||||
if "%GIT%"=="" set GIT=git
|
||||
for /f "usebackq" %%s in (`%GIT% rev-parse --abbrev-ref HEAD`) do @set BRA=%%s
|
||||
for /f "usebackq" %%s in (`%GIT% rev-parse HEAD`) do @set REV=%%s
|
||||
set REV=%REV:~0,8%
|
||||
goto filwri
|
||||
|
||||
:svnrev
|
||||
set BRA=Subversion
|
||||
for /f "usebackq" %%s in (`svnversion .`) do @set REV=%%s
|
||||
set REV=r%REV%
|
||||
goto filwri
|
||||
|
||||
:filwri
|
||||
echo // Do not edit! This file was autogenerated > %1\comptime.h
|
||||
echo // by the %0 batch file >> %1\comptime.h
|
||||
echo // >> %1\comptime.h
|
||||
echo const char* compbranch = "%BRA%"; >> %1\comptime.h
|
||||
echo const char* comprevision = "%REV%"; >> %1\comptime.h
|
||||
+1
-1
@@ -17,7 +17,7 @@ EOF
|
||||
|
||||
versiongit() {
|
||||
gitbranch="$(git rev-parse --abbrev-ref HEAD)"
|
||||
gitversion="$(git show --pretty=format:'%h %s' -s HEAD | sed 's/"/\\"/g')"
|
||||
gitversion="$(git rev-parse HEAD | cut -c -8)"
|
||||
version "$gitbranch" "$gitversion";
|
||||
exit 0
|
||||
}
|
||||
|
||||
Executable
+717
@@ -0,0 +1,717 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright (C) 2002-2010 Free Software Foundation, Inc.
|
||||
#
|
||||
# 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# This file is meant for authors, maintainers, co-maintainers or installers
|
||||
# of packages which are internationalized with the help of GNU gettext. For
|
||||
# further information how to use it consult the GNU gettext manual.
|
||||
|
||||
progname=$0
|
||||
package=gettext-tools
|
||||
version=0.18.1
|
||||
|
||||
# Set variables
|
||||
# - gettext_dir directory where the sources are stored.
|
||||
prefix="/usr/local/i686-w64-mingw32/stow/gettext-0.18.1.1"
|
||||
datarootdir="${prefix}/share"
|
||||
gettext_dir="${datarootdir}/gettext"
|
||||
|
||||
# func_tmpdir
|
||||
# creates a temporary directory.
|
||||
# Sets variable
|
||||
# - tmp pathname of freshly created temporary directory
|
||||
func_tmpdir ()
|
||||
{
|
||||
# Use the environment variable TMPDIR, falling back to /tmp. This allows
|
||||
# users to specify a different temporary directory, for example, if their
|
||||
# /tmp is filled up or too small.
|
||||
: ${TMPDIR=/tmp}
|
||||
{
|
||||
# Use the mktemp program if available. If not available, hide the error
|
||||
# message.
|
||||
tmp=`(umask 077 && mktemp -d "$TMPDIR/gtXXXXXX") 2>/dev/null` &&
|
||||
test -n "$tmp" && test -d "$tmp"
|
||||
} ||
|
||||
{
|
||||
# Use a simple mkdir command. It is guaranteed to fail if the directory
|
||||
# already exists. $RANDOM is bash specific and expands to empty in shells
|
||||
# other than bash, ksh and zsh. Its use does not increase security;
|
||||
# rather, it minimizes the probability of failure in a very cluttered /tmp
|
||||
# directory.
|
||||
tmp=$TMPDIR/gt$$-$RANDOM
|
||||
(umask 077 && mkdir "$tmp")
|
||||
} ||
|
||||
{
|
||||
echo "$0: cannot create a temporary directory in $TMPDIR" >&2
|
||||
{ (exit 1); exit 1; }
|
||||
}
|
||||
}
|
||||
|
||||
# Support for relocatability.
|
||||
func_find_curr_installdir ()
|
||||
{
|
||||
# Determine curr_installdir, even taking into account symlinks.
|
||||
curr_executable="$0"
|
||||
case "$curr_executable" in
|
||||
*/* | *\\*) ;;
|
||||
*) # Need to look in the PATH.
|
||||
if test "${PATH_SEPARATOR+set}" != set; then
|
||||
func_tmpdir
|
||||
{ echo "#! /bin/sh"; echo "exit 0"; } > "$tmp"/conf.sh
|
||||
chmod +x "$tmp"/conf.sh
|
||||
if (PATH="/nonexistent;$tmp"; conf.sh) >/dev/null 2>&1; then
|
||||
PATH_SEPARATOR=';'
|
||||
else
|
||||
PATH_SEPARATOR=:
|
||||
fi
|
||||
rm -rf "$tmp"
|
||||
fi
|
||||
save_IFS="$IFS"; IFS="$PATH_SEPARATOR"
|
||||
for dir in $PATH; do
|
||||
IFS="$save_IFS"
|
||||
test -z "$dir" && dir=.
|
||||
for exec_ext in ''; do
|
||||
if test -f "$dir/$curr_executable$exec_ext"; then
|
||||
curr_executable="$dir/$curr_executable$exec_ext"
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS="$save_IFS"
|
||||
;;
|
||||
esac
|
||||
# Make absolute.
|
||||
case "$curr_executable" in
|
||||
/* | ?:/* | ?:\\*) ;;
|
||||
*) curr_executable=`pwd`/"$curr_executable" ;;
|
||||
esac
|
||||
# Resolve symlinks.
|
||||
sed_dirname='s,/[^/]*$,,'
|
||||
sed_linkdest='s,^.* -> \(.*\),\1,p'
|
||||
while : ; do
|
||||
lsline=`LC_ALL=C ls -l "$curr_executable"`
|
||||
case "$lsline" in
|
||||
*" -> "*)
|
||||
linkdest=`echo "$lsline" | sed -n -e "$sed_linkdest"`
|
||||
case "$linkdest" in
|
||||
/* | ?:/* | ?:\\*) curr_executable="$linkdest" ;;
|
||||
*) curr_executable=`echo "$curr_executable" | sed -e "$sed_dirname"`/"$linkdest" ;;
|
||||
esac ;;
|
||||
*) break ;;
|
||||
esac
|
||||
done
|
||||
curr_installdir=`echo "$curr_executable" | sed -e 's,/[^/]*$,,'`
|
||||
# Canonicalize.
|
||||
curr_installdir=`cd "$curr_installdir" && pwd`
|
||||
}
|
||||
func_find_prefixes ()
|
||||
{
|
||||
# Compute the original/current installation prefixes by stripping the
|
||||
# trailing directories off the original/current installation directories.
|
||||
orig_installprefix="$orig_installdir"
|
||||
curr_installprefix="$curr_installdir"
|
||||
while true; do
|
||||
orig_last=`echo "$orig_installprefix" | sed -n -e 's,^.*/\([^/]*\)$,\1,p'`
|
||||
curr_last=`echo "$curr_installprefix" | sed -n -e 's,^.*/\([^/]*\)$,\1,p'`
|
||||
if test -z "$orig_last" || test -z "$curr_last"; then
|
||||
break
|
||||
fi
|
||||
if test "$orig_last" != "$curr_last"; then
|
||||
break
|
||||
fi
|
||||
orig_installprefix=`echo "$orig_installprefix" | sed -e 's,/[^/]*$,,'`
|
||||
curr_installprefix=`echo "$curr_installprefix" | sed -e 's,/[^/]*$,,'`
|
||||
done
|
||||
}
|
||||
if test "no" = yes; then
|
||||
exec_prefix="${prefix}"
|
||||
bindir="${exec_prefix}/bin"
|
||||
orig_installdir="$bindir" # see Makefile.am's *_SCRIPTS variables
|
||||
func_find_curr_installdir # determine curr_installdir
|
||||
func_find_prefixes
|
||||
# Relocate the directory variables that we use.
|
||||
gettext_dir=`echo "$gettext_dir/" | sed -e "s%^${orig_installprefix}/%${curr_installprefix}/%" | sed -e 's,/$,,'`
|
||||
fi
|
||||
|
||||
# func_usage
|
||||
# outputs to stdout the --help usage message.
|
||||
func_usage ()
|
||||
{
|
||||
echo "\
|
||||
Usage: autopoint [OPTION]...
|
||||
|
||||
Copies standard gettext infrastructure files into a source package.
|
||||
|
||||
Options:
|
||||
--help print this help and exit
|
||||
--version print version information and exit
|
||||
-f, --force force overwriting of files that already exist
|
||||
-n, --dry-run print modifications but don't perform them"
|
||||
# echo "\
|
||||
# -V version copy the infrastructure of the specified gettext version
|
||||
# (dangerous)"
|
||||
echo "
|
||||
Report bugs to <bug-gnu-gettext@gnu.org>."
|
||||
}
|
||||
|
||||
# func_version
|
||||
# outputs to stdout the --version message.
|
||||
func_version ()
|
||||
{
|
||||
echo "$progname (GNU $package) $version"
|
||||
echo "Uses a versions archive in git format."
|
||||
echo "Copyright (C) 2002-2010 Free Software Foundation, Inc.
|
||||
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law."
|
||||
echo "Written by" "Bruno Haible"
|
||||
}
|
||||
|
||||
# func_fatal_error message
|
||||
# outputs to stderr a fatal error message, and terminates the program.
|
||||
func_fatal_error ()
|
||||
{
|
||||
echo "autopoint: *** $1" 1>&2
|
||||
echo "autopoint: *** Stop." 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Command-line option processing.
|
||||
# Removes the OPTIONS from the arguments. Sets the variables:
|
||||
# - force yes if --force was given, empty otherwise
|
||||
# - ver gettext version if -V was given, empty otherwise
|
||||
# - doit false if --dry-run was given, : otherwise
|
||||
{
|
||||
force=
|
||||
ver=
|
||||
doit=:
|
||||
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
-n | --dry-run | --dry-ru | --dry-r | --dry- | --dry | --dr | --d )
|
||||
shift
|
||||
doit=false ;;
|
||||
-f | --force | --forc | --for | --fo | --f )
|
||||
shift
|
||||
force=yes ;;
|
||||
--help | --hel | --he | --h )
|
||||
func_usage; exit 0 ;;
|
||||
# -V ) # Some people put a space between -V and the version number.
|
||||
# shift
|
||||
# if test $# = 0; then
|
||||
# func_usage 1>&2
|
||||
# exit 1
|
||||
# fi
|
||||
# ver=$1;
|
||||
# shift ;;
|
||||
# -V*) # Some people omit the space between -V and the version number.
|
||||
# ver=`echo "X$1" | sed -e 's/^X-V//'`
|
||||
# shift ;;
|
||||
--version | --versio | --versi | --vers | --ver | --ve | --v )
|
||||
func_version
|
||||
exit 0 ;;
|
||||
-- ) # Stop option prcessing
|
||||
shift; break ;;
|
||||
-* )
|
||||
echo "autopoint: unknown option $1" 1>&2
|
||||
echo "Try 'autopoint --help' for more information." 1>&2
|
||||
exit 1 ;;
|
||||
* )
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# Command-line argument processing.
|
||||
# Analyzes the remaining arguments.
|
||||
{
|
||||
if test $# -gt 0; then
|
||||
func_usage 1>&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
srcdir=`pwd`
|
||||
# The current directory is now $srcdir.
|
||||
|
||||
# Check integrity of package: A configure.in/ac must be present. Sets variable
|
||||
# - configure_in name of configure.in/ac file.
|
||||
if test -f configure.in; then
|
||||
configure_in=configure.in
|
||||
else
|
||||
if test -f configure.ac; then
|
||||
configure_in=configure.ac
|
||||
else
|
||||
# KDE specific convention: configure.in.in
|
||||
if test -f configure.in.in; then
|
||||
configure_in=configure.in.in
|
||||
else
|
||||
func_fatal_error "Missing configure.in or configure.ac, please cd to your package first."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check whether the -V option and the version number in configure.in match.
|
||||
# At least one of the two must be given. If both are given, they must agree.
|
||||
sed_extract_AM_GNU_GETTEXT_VERSION_argument='s/^AM_GNU_GETTEXT_VERSION(\([^()]*\)).*$/\1/'
|
||||
sed_remove_outer_brackets='s/^\[\(.*\)\]$/\1/'
|
||||
xver=`cat "$configure_in" | grep '^AM_GNU_GETTEXT_VERSION(' | sed -n -e "$sed_extract_AM_GNU_GETTEXT_VERSION_argument"p | sed -e "$sed_remove_outer_brackets" | sed -e 1q`
|
||||
if test -z "$xver" && test -f intl/VERSION; then
|
||||
xver=`cat intl/VERSION | LC_ALL=C sed -n -e 's/^.*gettext-\([-+_.0-9A-Za-z]*\).*$/\1/p'`
|
||||
fi
|
||||
if test -n "$xver"; then
|
||||
if test -n "$ver"; then
|
||||
if test "X$ver" != "X$xver"; then
|
||||
func_fatal_error "Version mismatch: specified -V $ver but the package uses gettext version $xver"
|
||||
fi
|
||||
else
|
||||
ver="$xver"
|
||||
fi
|
||||
else
|
||||
if test -z "$ver"; then
|
||||
func_fatal_error "Missing version: please specify in $configure_in through a line 'AM_GNU_GETTEXT_VERSION(x.yy.zz)' the gettext version the package is using"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check whether the version number is supported.
|
||||
case "$ver" in
|
||||
0.10.35 | 0.10.36 | 0.10.37 | 0.10.38 | 0.10.39 | 0.10.40 | \
|
||||
0.11 | 0.11.1 | 0.11.2 | 0.11.3 | 0.11.4 | 0.11.5 | \
|
||||
0.12 | 0.12.1 | \
|
||||
0.13 | 0.13.1 | \
|
||||
0.14 | 0.14.1 | 0.14.2 | 0.14.3 | 0.14.4 | 0.14.5 | 0.14.6 | \
|
||||
0.15 | \
|
||||
0.16 | 0.16.1 | \
|
||||
0.17 | \
|
||||
0.18 | 0.18.1 )
|
||||
;;
|
||||
*)
|
||||
func_fatal_error "The AM_GNU_GETTEXT_VERSION declaration in your $configure_in
|
||||
file requires the infrastructure from gettext-$ver but this version
|
||||
is older. Please upgrade to gettext-$ver or newer."
|
||||
;;
|
||||
esac
|
||||
|
||||
# Check in which directory config.rpath, mkinstalldirs etc. belong.
|
||||
auxdir=`cat "$configure_in" | grep '^AC_CONFIG_AUX_DIR' | sed -n -e 's/AC_CONFIG_AUX_DIR(\([^()]*\))/\1/p' | sed -e 's/^\[\(.*\)\]$/\1/' | sed -e 1q`
|
||||
if test -n "$auxdir"; then
|
||||
auxdir="$auxdir/"
|
||||
fi
|
||||
|
||||
# Check in which directory the *.m4 macros belong.
|
||||
m4dir=m4
|
||||
if test -f Makefile.am; then
|
||||
# A package using automake.
|
||||
# Extract the macro directory name from Makefile.am.
|
||||
aclocal_amflags=`grep '^ACLOCAL_AMFLAGS[ ]*=' Makefile.am | sed -e 's/^ACLOCAL_AMFLAGS[ ]*=\(.*\)$/\1/'`
|
||||
m4dir_is_next=
|
||||
for arg in $aclocal_amflags; do
|
||||
if test -n "$m4dir_is_next"; then
|
||||
m4dir="$arg"
|
||||
break
|
||||
else
|
||||
if test "X$arg" = "X-I"; then
|
||||
m4dir_is_next=yes
|
||||
else
|
||||
m4dir_is_next=
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Check whether to omit the intl/ directory.
|
||||
omitintl=`cat "$configure_in" | grep '^AM_GNU_GETTEXT' | sed -n -e 's/^AM_GNU_GETTEXT(\([^(),]*\).*$/\1/p' | sed -e 's/^\[\(.*\)\]$/\1/' | sed -e 1q`
|
||||
omitintl=`if test 'external' = "$omitintl"; then echo yes; fi`
|
||||
|
||||
# Check in which directory or directories the po/* infrastructure belongs.
|
||||
sed_extract_config_files='s,#.*$,,
|
||||
s,^dnl .*$,,
|
||||
s, dnl .*$,,
|
||||
/AC_CONFIG_FILES(/ {
|
||||
ta
|
||||
:a
|
||||
s/)/)/
|
||||
tb
|
||||
s/\\$//
|
||||
N
|
||||
ba
|
||||
:b
|
||||
s,^.*AC_CONFIG_FILES([[ ]*\([^]"$`\\)]*\).*$,\1,p
|
||||
}'
|
||||
configfiles=`cat "$configure_in" | sed -n -e "$sed_extract_config_files"`
|
||||
# PO directories have a Makefile.in generated from Makefile.in.in.
|
||||
# Treat a directory as a PO directory if and only if it has a
|
||||
# POTFILES.in file. This allows packages to have multiple PO
|
||||
# directories under different names or in different locations.
|
||||
sed_remove_Makefile_in='s,/Makefile\.in$,,'
|
||||
podirs=`for f in $configfiles; do case "$f" in */Makefile.in) echo $f;; esac; done | sed -e "$sed_remove_Makefile_in"`
|
||||
if test -z "$podirs"; then
|
||||
# If we cannot get the list of PO directories from configure.ac, assume the
|
||||
# common default.
|
||||
podirs="po"
|
||||
fi
|
||||
|
||||
# Set up a temporary checkout directory.
|
||||
# Set variables
|
||||
# - work_dir directory containing the temporary checkout
|
||||
work_dir=tmpwrk$$
|
||||
mkdir "$work_dir" || {
|
||||
if test -d "$work_dir"; then
|
||||
func_fatal_error "directory $work_dir already exists"
|
||||
else
|
||||
func_fatal_error "cannot create directory $work_dir"
|
||||
fi
|
||||
}
|
||||
|
||||
# We support three archive formats.
|
||||
#
|
||||
# Format | Size (KiB) for gettext-0.17 | Extra tools needed |
|
||||
# -------+-----------------------------+--------------------+
|
||||
# dir | 3000 | -- |
|
||||
# cvs | 356 | cvs |
|
||||
# git | 484 | git |
|
||||
# -------+-----------------------------+--------------------+
|
||||
|
||||
case "git" in
|
||||
dir)
|
||||
# The archive of different versions is very large, but using it does not
|
||||
# require special tools.
|
||||
gzip -d -c < "$gettext_dir/archive.dir.tar.gz" | (cd "$work_dir" && tar xf - "gettext-$ver")
|
||||
if test `find "$work_dir" -type f -print | wc -l` = 0; then
|
||||
rm -rf "$work_dir"
|
||||
func_fatal_error "infrastructure files for version $ver not found; this is autopoint from GNU $package $version"
|
||||
fi
|
||||
mv "$work_dir/gettext-$ver" "$work_dir/archive"
|
||||
;;
|
||||
|
||||
cvs)
|
||||
# We distributed the many different versions of the files in a CVS
|
||||
# repository. This guaranteed a good compression rate:
|
||||
#
|
||||
# Including version size in KB of
|
||||
# "du autopoint-files/archive"
|
||||
# 0.10.35 240
|
||||
# 0.10.36 428
|
||||
# 0.10.37 436
|
||||
# 0.10.38 488
|
||||
# 0.10.39 500
|
||||
# 0.10.40 528
|
||||
# 0.11 720
|
||||
# 0.11.1 740
|
||||
# 0.11.2 748
|
||||
# 0.11.3 804
|
||||
# 0.11.4 864
|
||||
# 0.11.5 880
|
||||
# 0.12 1032
|
||||
# 0.12.1 1032
|
||||
# 0.13 1220
|
||||
# 0.13.1 1236
|
||||
# 0.14 1296
|
||||
# 0.14.1 1300
|
||||
# 0.14.2 1420
|
||||
# 0.14.3 1428
|
||||
# 0.14.4 1464
|
||||
# 0.14.5 1508
|
||||
# 0.14.6 1580
|
||||
# 0.15 1760
|
||||
# 0.16 1808
|
||||
# 0.16.1 1812
|
||||
# 0.17 2128
|
||||
# 0.18 2656
|
||||
#
|
||||
# The requirement that the user must have the CVS program available is not
|
||||
# a severe restrictions, because most of the people who use autopoint are
|
||||
# users of CVS.
|
||||
#
|
||||
# But the CVS format is now deprecated, because "cvs init" does not work in
|
||||
# all circumstances
|
||||
# (see <http://lists.gnu.org/archive/html/bug-cvs/2010-05/msg00003.html>)
|
||||
# and we are not allowed to distribute the cvs infrastructure files
|
||||
# ourselves
|
||||
# (see <http://lists.gnu.org/archive/html/bug-cvs/2010-06/msg00011.html>).
|
||||
#
|
||||
# Check availability of the CVS program.
|
||||
(cvs -v) >/dev/null 2>/dev/null || func_fatal_error "cvs program not found"
|
||||
|
||||
# Set up a temporary CVS repository.
|
||||
# We need the temporary CVS repository because any checkout needs write
|
||||
# access to the CVSROOT/history file, so it cannot be under $gettext_dir.
|
||||
# We need the temporary checkout directory because when --force was not
|
||||
# given, we need to compare the existing files with the checked out ones.
|
||||
# Set variables
|
||||
# - cvs_dir directory containing the temporary repository
|
||||
cvs_dir=tmpcvs$$
|
||||
# Use an umask of 077, to avoid attacks that work by overwriting files in
|
||||
# the "$CVSROOT"/CVSROOT directory.
|
||||
(umask 077 && mkdir "$cvs_dir") || {
|
||||
if test -d "$cvs_dir"; then
|
||||
func_fatal_error "directory $cvs_dir already exists"
|
||||
else
|
||||
func_fatal_error "cannot create directory $cvs_dir"
|
||||
fi
|
||||
}
|
||||
CVSROOT="$srcdir/$cvs_dir"
|
||||
unset CVS_CLIENT_LOG
|
||||
unset CVS_CLIENT_PORT
|
||||
unset CVS_IGNORE_REMOTE_ROOT
|
||||
unset CVS_LOCAL_BRANCH_NUM
|
||||
unset CVS_NOBASES
|
||||
unset CVS_PASSFILE
|
||||
unset CVS_PASSWORD
|
||||
unset CVS_PROXY_PORT
|
||||
unset CVS_RCMD_PORT
|
||||
unset CVS_RSH
|
||||
unset CVS_SERVER
|
||||
unset CVS_SERVER_SLEEP
|
||||
CVS_SIGN_COMMITS=
|
||||
export CVS_SIGN_COMMITS
|
||||
unset CVS_SSH
|
||||
unset CVS_VERIFY_CHECKOUTS
|
||||
unset CVS_VERIFY_TEMPLATE
|
||||
unset CVSIGNORE
|
||||
unset CVSREAD
|
||||
unset CVSREADONLYFS
|
||||
unset CVSUMASK
|
||||
unset CVSWRAPPERS
|
||||
|
||||
# Need to pass -d "$CVSROOT", because there may be a CVS directory in the
|
||||
# current directory.
|
||||
cvs -d "$CVSROOT" init
|
||||
gzip -d -c < "$gettext_dir/archive.cvs.tar.gz" | (cd "$cvs_dir" && tar xf -)
|
||||
|
||||
cd "$work_dir"
|
||||
cvsver=gettext-`echo "$ver" | sed -e 's/\./_/g'`
|
||||
(cvs -d "$CVSROOT" checkout -r"$cvsver" archive > /dev/null) 2>&1 | grep -v '^cvs checkout: Updating'
|
||||
find archive -name CVS -type d -print | xargs rm -rf
|
||||
cd ..
|
||||
rm -rf "$cvs_dir"
|
||||
# Check that really all CVS directories are gone, otherwise we would overwrite
|
||||
# the contents of the user's CVS directories.
|
||||
if test `find $work_dir/archive -name CVS -type d -print | wc -l` != 0; then
|
||||
rm -rf "$work_dir"
|
||||
func_fatal_error "failed to remove all CVS subdirectories"
|
||||
fi
|
||||
if test `find $work_dir/archive -type f -print | wc -l` = 0; then
|
||||
rm -rf "$work_dir"
|
||||
func_fatal_error "infrastructure files for version $ver not found; this is autopoint from GNU $package $version"
|
||||
fi
|
||||
;;
|
||||
|
||||
git)
|
||||
# Check availability of the git program.
|
||||
(git --version) >/dev/null 2>/dev/null || func_fatal_error "git program not found"
|
||||
mkdir "$work_dir/archive"
|
||||
gzip -d -c < "$gettext_dir/archive.git.tar.gz" | (cd "$work_dir/archive" && tar xf -)
|
||||
(cd "$work_dir/archive" && git checkout -q "gettext-$ver") || {
|
||||
rm -rf "$work_dir"
|
||||
func_fatal_error "infrastructure files for version $ver not found; this is autopoint from GNU $package $version"
|
||||
}
|
||||
(cd "$work_dir/archive" && rm -rf .git .gitignore)
|
||||
;;
|
||||
esac
|
||||
|
||||
# func_destfile file
|
||||
# determines the destination file, relative to the package's top level
|
||||
# directory, for a given file name, relative to archive.
|
||||
# Sets variables
|
||||
# - destfile relative destination file name, or
|
||||
# empty if the file shall be omitted
|
||||
# - sharedowner yes if the file is not only owned by GNU gettext but may
|
||||
# be installed by automake or other tools, otherwise empty
|
||||
# - allpodirs yes if the file is to be installed in every dir in $podirs
|
||||
func_destfile ()
|
||||
{
|
||||
# There are five categories of files:
|
||||
# ABOUT_NLS -> top level directory
|
||||
# config.rpath mkinstalldirs -> $auxdir
|
||||
# m4/* -> $m4dir/
|
||||
# intl/* -> intl/
|
||||
# po/* ->
|
||||
sharedowner=
|
||||
allpodirs=
|
||||
case `echo "$1" | sed -e 's,[^/]*$,,'` in
|
||||
"" )
|
||||
case "$1" in
|
||||
config.rpath ) destfile="$auxdir$1" ;;
|
||||
mkinstalldirs ) destfile="$auxdir$1" sharedowner=yes ;;
|
||||
* ) destfile="$1" ;;
|
||||
esac
|
||||
;;
|
||||
m4/ ) destfile=`echo "$1" | sed -e "s,^m4/,$m4dir/,"` ;;
|
||||
intl/ ) if test -n "$omitintl"; then destfile=""; else destfile="$1"; fi ;;
|
||||
po/ ) destfile=`echo "$1" | sed -e "s,^po/,,"` allpodirs=yes ;;
|
||||
* ) destfile="$1" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# func_compare existingfile gettextfile
|
||||
# compares the existing file and the file from gettext, and decides whether the
|
||||
# existing file should be overwritten with the file from gettext. Returns 0 if
|
||||
# it should be overwritten, or 1 if it should be skipped.
|
||||
sed_extract_serial='s/^#.* serial \([^ ]*\).*/\1/p
|
||||
1q'
|
||||
func_compare ()
|
||||
{
|
||||
if cmp -s "$1" "$2"; then
|
||||
false
|
||||
else
|
||||
case "$2" in
|
||||
*.m4)
|
||||
# For interoperability with gnulib. gnulib often has newer versions of
|
||||
# the *.m4 files than the latest gettext release. Don't overwrite a
|
||||
# newer version from gnulib with an older version from the gettext
|
||||
# release. The version can be retrieved from the first line, which
|
||||
# looks like this: # file.m4 serial NN ...
|
||||
existing_serial=`sed -n -e "$sed_extract_serial" < "$1"`
|
||||
gettext_serial=`sed -n -e "$sed_extract_serial" < "$2"`
|
||||
if test -n "$existing_serial" && test -n "$gettext_serial" \
|
||||
&& test "$existing_serial" -ge "$gettext_serial" 2> /dev/null; then
|
||||
false
|
||||
else
|
||||
true
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
true
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
# If some files have been locally modified and we have not been requested
|
||||
# to overwrite them, then bail out. This is better than leaving a source
|
||||
# package around where half of the files are locally modified and half are
|
||||
# original - too great risk of version mismatch.
|
||||
if test -z "$force"; then
|
||||
mismatch=
|
||||
func_tmpdir
|
||||
mismatchfile="$tmp"/autopoint.diff
|
||||
for file in `find "$work_dir/archive" -type f -print | sed -e "s,^$work_dir/archive/,," | LC_ALL=C sort`; do
|
||||
func_destfile "$file"
|
||||
if test -n "$destfile"; then
|
||||
func_compare_to_destfile ()
|
||||
{
|
||||
finaldestfile="$1"
|
||||
if test -f "$finaldestfile"; then
|
||||
if func_compare "$finaldestfile" "$work_dir/archive/$file"; then
|
||||
if test -n "$sharedowner"; then
|
||||
echo "autopoint: warning: File $finaldestfile has been locally modified." 1>&2
|
||||
else
|
||||
echo "autopoint: File $finaldestfile has been locally modified." 1>&2
|
||||
mismatch=yes
|
||||
diff -c "$work_dir/archive/$file" "$finaldestfile" | sed -e "1s,$work_dir/archive/,," >> "$mismatchfile"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
if test -n "$allpodirs"; then
|
||||
for dir in $podirs; do
|
||||
func_compare_to_destfile "$dir/$destfile"
|
||||
done
|
||||
else
|
||||
func_compare_to_destfile "$destfile"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if test -n "$mismatch"; then
|
||||
rm -rf "$work_dir"
|
||||
func_fatal_error "Some files have been locally modified. Not overwriting them because --force has not been specified. For your convenience, you find the local modifications in the file '$mismatchfile'."
|
||||
fi
|
||||
rm -rf "$tmp"
|
||||
fi
|
||||
|
||||
# func_mkdir_for to
|
||||
# ensures the directory that would the given file exists.
|
||||
# 'to' is a relative pathname, relative to the current directory.
|
||||
func_mkdir_for ()
|
||||
{
|
||||
base=`echo "$1" | sed -e 's,/[^/]*$,,'`
|
||||
if test "X$base" != "X$1" && test -n "$base"; then
|
||||
func_mkdir_for "$base"
|
||||
# Recompute base. It was clobbered by the recursive call.
|
||||
base=`echo "$1" | sed -e 's,/[^/]*$,,'`
|
||||
test -d "$base" || { echo "Creating directory $base"; mkdir "$base"; }
|
||||
fi
|
||||
}
|
||||
|
||||
# func_copy from to
|
||||
# copies a file.
|
||||
# 'from' is a relative pathname, relative to the current directory.
|
||||
# 'to' is a relative pathname, relative to the current directory.
|
||||
func_copy ()
|
||||
{
|
||||
if $doit; then
|
||||
func_mkdir_for "$2"
|
||||
rm -f "$2"
|
||||
echo "Copying file $2"
|
||||
cp "$1" "$2"
|
||||
else
|
||||
echo "Copy file $2"
|
||||
fi
|
||||
}
|
||||
|
||||
# func_backup to
|
||||
# makes a backup of a file that is about to be overwritten or replaced.
|
||||
# 'to' is a relative pathname, relative to the current directory.
|
||||
func_backup ()
|
||||
{
|
||||
if $doit; then
|
||||
if test -f "$1"; then
|
||||
rm -f "$1~"
|
||||
cp -p "$1" "$1~"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Now copy the files.
|
||||
for file in `find "$work_dir/archive" -type f -print | sed -e "s,^$work_dir/archive/,," | LC_ALL=C sort`; do
|
||||
func_destfile "$file"
|
||||
if test -n "$destfile"; then
|
||||
func_copy_to_destfile ()
|
||||
{
|
||||
finaldestfile="$1"
|
||||
mustcopy=
|
||||
if test -f "$finaldestfile"; then
|
||||
if func_compare "$finaldestfile" "$work_dir/archive/$file"; then
|
||||
if test -n "$force"; then
|
||||
# Overwrite locally modified file.
|
||||
mustcopy=yes
|
||||
fi
|
||||
# If --force is not specified, don't overwrite locally modified files
|
||||
# for which GNU gettext is a shared owner.
|
||||
fi
|
||||
else
|
||||
mustcopy=yes
|
||||
fi
|
||||
if test -n "$mustcopy"; then
|
||||
func_backup "$finaldestfile"
|
||||
func_copy "$work_dir/archive/$file" "$finaldestfile"
|
||||
fi
|
||||
}
|
||||
if test -n "$allpodirs"; then
|
||||
for dir in $podirs; do
|
||||
func_copy_to_destfile "$dir/$destfile"
|
||||
done
|
||||
else
|
||||
func_copy_to_destfile "$destfile"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# That's it.
|
||||
rm -rf "$work_dir"
|
||||
exit 0
|
||||
Binary file not shown.
Binary file not shown.
Executable
+123
@@ -0,0 +1,123 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright (C) 2003, 2005-2007 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Library General Public License as published
|
||||
# by the Free Software Foundation; either version 2, 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 Library 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.
|
||||
#
|
||||
|
||||
# Find a way to echo strings without interpreting backslash.
|
||||
if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
|
||||
echo='echo'
|
||||
else
|
||||
if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
|
||||
echo='printf %s\n'
|
||||
else
|
||||
echo_func () {
|
||||
cat <<EOT
|
||||
$*
|
||||
EOT
|
||||
}
|
||||
echo='echo_func'
|
||||
fi
|
||||
fi
|
||||
|
||||
# This script is primarily a shell function library. In order for
|
||||
# ". gettext.sh" to find it, we install it in $PREFIX/bin (that is usually
|
||||
# contained in $PATH), rather than in some other location such as
|
||||
# $PREFIX/share/sh-scripts or $PREFIX/share/gettext. In order to not violate
|
||||
# the Filesystem Hierarchy Standard when doing so, this script is executable.
|
||||
# Therefore it needs to support the standard --help and --version.
|
||||
if test -z "$ZSH_VERSION"; then
|
||||
# zsh is not POSIX compliant: By default, while ". gettext.sh" is executed,
|
||||
# it sets $0 to "gettext.sh", defeating the purpose of this test. But
|
||||
# fortunately we know that when running under zsh, this script is always
|
||||
# being sourced, not executed, because hardly anyone is crazy enough to
|
||||
# install zsh as /bin/sh.
|
||||
case "$0" in
|
||||
gettext.sh | */gettext.sh | *\\gettext.sh)
|
||||
progname=$0
|
||||
package=gettext-runtime
|
||||
version=0.18.1
|
||||
# func_usage
|
||||
# outputs to stdout the --help usage message.
|
||||
func_usage ()
|
||||
{
|
||||
echo "GNU gettext shell script function library version $version"
|
||||
echo "Usage: . gettext.sh"
|
||||
}
|
||||
# func_version
|
||||
# outputs to stdout the --version message.
|
||||
func_version ()
|
||||
{
|
||||
echo "$progname (GNU $package) $version"
|
||||
echo "Copyright (C) 2003-2007 Free Software Foundation, Inc.
|
||||
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law."
|
||||
echo "Written by" "Bruno Haible"
|
||||
}
|
||||
if test $# = 1; then
|
||||
case "$1" in
|
||||
--help | --hel | --he | --h )
|
||||
func_usage; exit 0 ;;
|
||||
--version | --versio | --versi | --vers | --ver | --ve | --v )
|
||||
func_version; exit 0 ;;
|
||||
esac
|
||||
fi
|
||||
func_usage 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# eval_gettext MSGID
|
||||
# looks up the translation of MSGID and substitutes shell variables in the
|
||||
# result.
|
||||
eval_gettext () {
|
||||
gettext "$1" | (export PATH `envsubst --variables "$1"`; envsubst "$1")
|
||||
}
|
||||
|
||||
# eval_ngettext MSGID MSGID-PLURAL COUNT
|
||||
# looks up the translation of MSGID / MSGID-PLURAL for COUNT and substitutes
|
||||
# shell variables in the result.
|
||||
eval_ngettext () {
|
||||
ngettext "$1" "$2" "$3" | (export PATH `envsubst --variables "$1 $2"`; envsubst "$1 $2")
|
||||
}
|
||||
|
||||
# Note: This use of envsubst is much safer than using the shell built-in 'eval'
|
||||
# would be.
|
||||
# 1) The security problem with Chinese translations that happen to use a
|
||||
# character such as \xe0\x60 is avoided.
|
||||
# 2) The security problem with malevolent translators who put in command lists
|
||||
# like "$(...)" or "`...`" is avoided.
|
||||
# 3) The translations can only refer to shell variables that are already
|
||||
# mentioned in MSGID or MSGID-PLURAL.
|
||||
#
|
||||
# Note: "export PATH" above is a dummy; this is for the case when
|
||||
# `envsubst --variables ...` returns nothing.
|
||||
#
|
||||
# Note: In eval_ngettext above, "$1 $2" means a string whose variables set is
|
||||
# the union of the variables set of "$1" and "$2".
|
||||
#
|
||||
# Note: The minimal use of backquote above ensures that trailing newlines are
|
||||
# not dropped, not from the gettext invocation and not from the value of any
|
||||
# shell variable.
|
||||
#
|
||||
# Note: Field splitting on the `envsubst --variables ...` result is desired,
|
||||
# since envsubst outputs the variables, separated by newlines. Pathname
|
||||
# wildcard expansion or tilde expansion has no effect here, since the words
|
||||
# output by "envsubst --variables ..." consist solely of alphanumeric
|
||||
# characters and underscore.
|
||||
Executable
+1281
File diff suppressed because it is too large.
Load diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Executable
+717
@@ -0,0 +1,717 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright (C) 2002-2010 Free Software Foundation, Inc.
|
||||
#
|
||||
# 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# This file is meant for authors, maintainers, co-maintainers or installers
|
||||
# of packages which are internationalized with the help of GNU gettext. For
|
||||
# further information how to use it consult the GNU gettext manual.
|
||||
|
||||
progname=$0
|
||||
package=gettext-tools
|
||||
version=0.18.1
|
||||
|
||||
# Set variables
|
||||
# - gettext_dir directory where the sources are stored.
|
||||
prefix="/usr/local/x86_64-w64-mingw32/stow/gettext-0.18.1.1"
|
||||
datarootdir="${prefix}/share"
|
||||
gettext_dir="${datarootdir}/gettext"
|
||||
|
||||
# func_tmpdir
|
||||
# creates a temporary directory.
|
||||
# Sets variable
|
||||
# - tmp pathname of freshly created temporary directory
|
||||
func_tmpdir ()
|
||||
{
|
||||
# Use the environment variable TMPDIR, falling back to /tmp. This allows
|
||||
# users to specify a different temporary directory, for example, if their
|
||||
# /tmp is filled up or too small.
|
||||
: ${TMPDIR=/tmp}
|
||||
{
|
||||
# Use the mktemp program if available. If not available, hide the error
|
||||
# message.
|
||||
tmp=`(umask 077 && mktemp -d "$TMPDIR/gtXXXXXX") 2>/dev/null` &&
|
||||
test -n "$tmp" && test -d "$tmp"
|
||||
} ||
|
||||
{
|
||||
# Use a simple mkdir command. It is guaranteed to fail if the directory
|
||||
# already exists. $RANDOM is bash specific and expands to empty in shells
|
||||
# other than bash, ksh and zsh. Its use does not increase security;
|
||||
# rather, it minimizes the probability of failure in a very cluttered /tmp
|
||||
# directory.
|
||||
tmp=$TMPDIR/gt$$-$RANDOM
|
||||
(umask 077 && mkdir "$tmp")
|
||||
} ||
|
||||
{
|
||||
echo "$0: cannot create a temporary directory in $TMPDIR" >&2
|
||||
{ (exit 1); exit 1; }
|
||||
}
|
||||
}
|
||||
|
||||
# Support for relocatability.
|
||||
func_find_curr_installdir ()
|
||||
{
|
||||
# Determine curr_installdir, even taking into account symlinks.
|
||||
curr_executable="$0"
|
||||
case "$curr_executable" in
|
||||
*/* | *\\*) ;;
|
||||
*) # Need to look in the PATH.
|
||||
if test "${PATH_SEPARATOR+set}" != set; then
|
||||
func_tmpdir
|
||||
{ echo "#! /bin/sh"; echo "exit 0"; } > "$tmp"/conf.sh
|
||||
chmod +x "$tmp"/conf.sh
|
||||
if (PATH="/nonexistent;$tmp"; conf.sh) >/dev/null 2>&1; then
|
||||
PATH_SEPARATOR=';'
|
||||
else
|
||||
PATH_SEPARATOR=:
|
||||
fi
|
||||
rm -rf "$tmp"
|
||||
fi
|
||||
save_IFS="$IFS"; IFS="$PATH_SEPARATOR"
|
||||
for dir in $PATH; do
|
||||
IFS="$save_IFS"
|
||||
test -z "$dir" && dir=.
|
||||
for exec_ext in ''; do
|
||||
if test -f "$dir/$curr_executable$exec_ext"; then
|
||||
curr_executable="$dir/$curr_executable$exec_ext"
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
done
|
||||
IFS="$save_IFS"
|
||||
;;
|
||||
esac
|
||||
# Make absolute.
|
||||
case "$curr_executable" in
|
||||
/* | ?:/* | ?:\\*) ;;
|
||||
*) curr_executable=`pwd`/"$curr_executable" ;;
|
||||
esac
|
||||
# Resolve symlinks.
|
||||
sed_dirname='s,/[^/]*$,,'
|
||||
sed_linkdest='s,^.* -> \(.*\),\1,p'
|
||||
while : ; do
|
||||
lsline=`LC_ALL=C ls -l "$curr_executable"`
|
||||
case "$lsline" in
|
||||
*" -> "*)
|
||||
linkdest=`echo "$lsline" | sed -n -e "$sed_linkdest"`
|
||||
case "$linkdest" in
|
||||
/* | ?:/* | ?:\\*) curr_executable="$linkdest" ;;
|
||||
*) curr_executable=`echo "$curr_executable" | sed -e "$sed_dirname"`/"$linkdest" ;;
|
||||
esac ;;
|
||||
*) break ;;
|
||||
esac
|
||||
done
|
||||
curr_installdir=`echo "$curr_executable" | sed -e 's,/[^/]*$,,'`
|
||||
# Canonicalize.
|
||||
curr_installdir=`cd "$curr_installdir" && pwd`
|
||||
}
|
||||
func_find_prefixes ()
|
||||
{
|
||||
# Compute the original/current installation prefixes by stripping the
|
||||
# trailing directories off the original/current installation directories.
|
||||
orig_installprefix="$orig_installdir"
|
||||
curr_installprefix="$curr_installdir"
|
||||
while true; do
|
||||
orig_last=`echo "$orig_installprefix" | sed -n -e 's,^.*/\([^/]*\)$,\1,p'`
|
||||
curr_last=`echo "$curr_installprefix" | sed -n -e 's,^.*/\([^/]*\)$,\1,p'`
|
||||
if test -z "$orig_last" || test -z "$curr_last"; then
|
||||
break
|
||||
fi
|
||||
if test "$orig_last" != "$curr_last"; then
|
||||
break
|
||||
fi
|
||||
orig_installprefix=`echo "$orig_installprefix" | sed -e 's,/[^/]*$,,'`
|
||||
curr_installprefix=`echo "$curr_installprefix" | sed -e 's,/[^/]*$,,'`
|
||||
done
|
||||
}
|
||||
if test "no" = yes; then
|
||||
exec_prefix="${prefix}"
|
||||
bindir="${exec_prefix}/bin"
|
||||
orig_installdir="$bindir" # see Makefile.am's *_SCRIPTS variables
|
||||
func_find_curr_installdir # determine curr_installdir
|
||||
func_find_prefixes
|
||||
# Relocate the directory variables that we use.
|
||||
gettext_dir=`echo "$gettext_dir/" | sed -e "s%^${orig_installprefix}/%${curr_installprefix}/%" | sed -e 's,/$,,'`
|
||||
fi
|
||||
|
||||
# func_usage
|
||||
# outputs to stdout the --help usage message.
|
||||
func_usage ()
|
||||
{
|
||||
echo "\
|
||||
Usage: autopoint [OPTION]...
|
||||
|
||||
Copies standard gettext infrastructure files into a source package.
|
||||
|
||||
Options:
|
||||
--help print this help and exit
|
||||
--version print version information and exit
|
||||
-f, --force force overwriting of files that already exist
|
||||
-n, --dry-run print modifications but don't perform them"
|
||||
# echo "\
|
||||
# -V version copy the infrastructure of the specified gettext version
|
||||
# (dangerous)"
|
||||
echo "
|
||||
Report bugs to <bug-gnu-gettext@gnu.org>."
|
||||
}
|
||||
|
||||
# func_version
|
||||
# outputs to stdout the --version message.
|
||||
func_version ()
|
||||
{
|
||||
echo "$progname (GNU $package) $version"
|
||||
echo "Uses a versions archive in git format."
|
||||
echo "Copyright (C) 2002-2010 Free Software Foundation, Inc.
|
||||
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law."
|
||||
echo "Written by" "Bruno Haible"
|
||||
}
|
||||
|
||||
# func_fatal_error message
|
||||
# outputs to stderr a fatal error message, and terminates the program.
|
||||
func_fatal_error ()
|
||||
{
|
||||
echo "autopoint: *** $1" 1>&2
|
||||
echo "autopoint: *** Stop." 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Command-line option processing.
|
||||
# Removes the OPTIONS from the arguments. Sets the variables:
|
||||
# - force yes if --force was given, empty otherwise
|
||||
# - ver gettext version if -V was given, empty otherwise
|
||||
# - doit false if --dry-run was given, : otherwise
|
||||
{
|
||||
force=
|
||||
ver=
|
||||
doit=:
|
||||
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
-n | --dry-run | --dry-ru | --dry-r | --dry- | --dry | --dr | --d )
|
||||
shift
|
||||
doit=false ;;
|
||||
-f | --force | --forc | --for | --fo | --f )
|
||||
shift
|
||||
force=yes ;;
|
||||
--help | --hel | --he | --h )
|
||||
func_usage; exit 0 ;;
|
||||
# -V ) # Some people put a space between -V and the version number.
|
||||
# shift
|
||||
# if test $# = 0; then
|
||||
# func_usage 1>&2
|
||||
# exit 1
|
||||
# fi
|
||||
# ver=$1;
|
||||
# shift ;;
|
||||
# -V*) # Some people omit the space between -V and the version number.
|
||||
# ver=`echo "X$1" | sed -e 's/^X-V//'`
|
||||
# shift ;;
|
||||
--version | --versio | --versi | --vers | --ver | --ve | --v )
|
||||
func_version
|
||||
exit 0 ;;
|
||||
-- ) # Stop option prcessing
|
||||
shift; break ;;
|
||||
-* )
|
||||
echo "autopoint: unknown option $1" 1>&2
|
||||
echo "Try 'autopoint --help' for more information." 1>&2
|
||||
exit 1 ;;
|
||||
* )
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
# Command-line argument processing.
|
||||
# Analyzes the remaining arguments.
|
||||
{
|
||||
if test $# -gt 0; then
|
||||
func_usage 1>&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
srcdir=`pwd`
|
||||
# The current directory is now $srcdir.
|
||||
|
||||
# Check integrity of package: A configure.in/ac must be present. Sets variable
|
||||
# - configure_in name of configure.in/ac file.
|
||||
if test -f configure.in; then
|
||||
configure_in=configure.in
|
||||
else
|
||||
if test -f configure.ac; then
|
||||
configure_in=configure.ac
|
||||
else
|
||||
# KDE specific convention: configure.in.in
|
||||
if test -f configure.in.in; then
|
||||
configure_in=configure.in.in
|
||||
else
|
||||
func_fatal_error "Missing configure.in or configure.ac, please cd to your package first."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check whether the -V option and the version number in configure.in match.
|
||||
# At least one of the two must be given. If both are given, they must agree.
|
||||
sed_extract_AM_GNU_GETTEXT_VERSION_argument='s/^AM_GNU_GETTEXT_VERSION(\([^()]*\)).*$/\1/'
|
||||
sed_remove_outer_brackets='s/^\[\(.*\)\]$/\1/'
|
||||
xver=`cat "$configure_in" | grep '^AM_GNU_GETTEXT_VERSION(' | sed -n -e "$sed_extract_AM_GNU_GETTEXT_VERSION_argument"p | sed -e "$sed_remove_outer_brackets" | sed -e 1q`
|
||||
if test -z "$xver" && test -f intl/VERSION; then
|
||||
xver=`cat intl/VERSION | LC_ALL=C sed -n -e 's/^.*gettext-\([-+_.0-9A-Za-z]*\).*$/\1/p'`
|
||||
fi
|
||||
if test -n "$xver"; then
|
||||
if test -n "$ver"; then
|
||||
if test "X$ver" != "X$xver"; then
|
||||
func_fatal_error "Version mismatch: specified -V $ver but the package uses gettext version $xver"
|
||||
fi
|
||||
else
|
||||
ver="$xver"
|
||||
fi
|
||||
else
|
||||
if test -z "$ver"; then
|
||||
func_fatal_error "Missing version: please specify in $configure_in through a line 'AM_GNU_GETTEXT_VERSION(x.yy.zz)' the gettext version the package is using"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check whether the version number is supported.
|
||||
case "$ver" in
|
||||
0.10.35 | 0.10.36 | 0.10.37 | 0.10.38 | 0.10.39 | 0.10.40 | \
|
||||
0.11 | 0.11.1 | 0.11.2 | 0.11.3 | 0.11.4 | 0.11.5 | \
|
||||
0.12 | 0.12.1 | \
|
||||
0.13 | 0.13.1 | \
|
||||
0.14 | 0.14.1 | 0.14.2 | 0.14.3 | 0.14.4 | 0.14.5 | 0.14.6 | \
|
||||
0.15 | \
|
||||
0.16 | 0.16.1 | \
|
||||
0.17 | \
|
||||
0.18 | 0.18.1 )
|
||||
;;
|
||||
*)
|
||||
func_fatal_error "The AM_GNU_GETTEXT_VERSION declaration in your $configure_in
|
||||
file requires the infrastructure from gettext-$ver but this version
|
||||
is older. Please upgrade to gettext-$ver or newer."
|
||||
;;
|
||||
esac
|
||||
|
||||
# Check in which directory config.rpath, mkinstalldirs etc. belong.
|
||||
auxdir=`cat "$configure_in" | grep '^AC_CONFIG_AUX_DIR' | sed -n -e 's/AC_CONFIG_AUX_DIR(\([^()]*\))/\1/p' | sed -e 's/^\[\(.*\)\]$/\1/' | sed -e 1q`
|
||||
if test -n "$auxdir"; then
|
||||
auxdir="$auxdir/"
|
||||
fi
|
||||
|
||||
# Check in which directory the *.m4 macros belong.
|
||||
m4dir=m4
|
||||
if test -f Makefile.am; then
|
||||
# A package using automake.
|
||||
# Extract the macro directory name from Makefile.am.
|
||||
aclocal_amflags=`grep '^ACLOCAL_AMFLAGS[ ]*=' Makefile.am | sed -e 's/^ACLOCAL_AMFLAGS[ ]*=\(.*\)$/\1/'`
|
||||
m4dir_is_next=
|
||||
for arg in $aclocal_amflags; do
|
||||
if test -n "$m4dir_is_next"; then
|
||||
m4dir="$arg"
|
||||
break
|
||||
else
|
||||
if test "X$arg" = "X-I"; then
|
||||
m4dir_is_next=yes
|
||||
else
|
||||
m4dir_is_next=
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Check whether to omit the intl/ directory.
|
||||
omitintl=`cat "$configure_in" | grep '^AM_GNU_GETTEXT' | sed -n -e 's/^AM_GNU_GETTEXT(\([^(),]*\).*$/\1/p' | sed -e 's/^\[\(.*\)\]$/\1/' | sed -e 1q`
|
||||
omitintl=`if test 'external' = "$omitintl"; then echo yes; fi`
|
||||
|
||||
# Check in which directory or directories the po/* infrastructure belongs.
|
||||
sed_extract_config_files='s,#.*$,,
|
||||
s,^dnl .*$,,
|
||||
s, dnl .*$,,
|
||||
/AC_CONFIG_FILES(/ {
|
||||
ta
|
||||
:a
|
||||
s/)/)/
|
||||
tb
|
||||
s/\\$//
|
||||
N
|
||||
ba
|
||||
:b
|
||||
s,^.*AC_CONFIG_FILES([[ ]*\([^]"$`\\)]*\).*$,\1,p
|
||||
}'
|
||||
configfiles=`cat "$configure_in" | sed -n -e "$sed_extract_config_files"`
|
||||
# PO directories have a Makefile.in generated from Makefile.in.in.
|
||||
# Treat a directory as a PO directory if and only if it has a
|
||||
# POTFILES.in file. This allows packages to have multiple PO
|
||||
# directories under different names or in different locations.
|
||||
sed_remove_Makefile_in='s,/Makefile\.in$,,'
|
||||
podirs=`for f in $configfiles; do case "$f" in */Makefile.in) echo $f;; esac; done | sed -e "$sed_remove_Makefile_in"`
|
||||
if test -z "$podirs"; then
|
||||
# If we cannot get the list of PO directories from configure.ac, assume the
|
||||
# common default.
|
||||
podirs="po"
|
||||
fi
|
||||
|
||||
# Set up a temporary checkout directory.
|
||||
# Set variables
|
||||
# - work_dir directory containing the temporary checkout
|
||||
work_dir=tmpwrk$$
|
||||
mkdir "$work_dir" || {
|
||||
if test -d "$work_dir"; then
|
||||
func_fatal_error "directory $work_dir already exists"
|
||||
else
|
||||
func_fatal_error "cannot create directory $work_dir"
|
||||
fi
|
||||
}
|
||||
|
||||
# We support three archive formats.
|
||||
#
|
||||
# Format | Size (KiB) for gettext-0.17 | Extra tools needed |
|
||||
# -------+-----------------------------+--------------------+
|
||||
# dir | 3000 | -- |
|
||||
# cvs | 356 | cvs |
|
||||
# git | 484 | git |
|
||||
# -------+-----------------------------+--------------------+
|
||||
|
||||
case "git" in
|
||||
dir)
|
||||
# The archive of different versions is very large, but using it does not
|
||||
# require special tools.
|
||||
gzip -d -c < "$gettext_dir/archive.dir.tar.gz" | (cd "$work_dir" && tar xf - "gettext-$ver")
|
||||
if test `find "$work_dir" -type f -print | wc -l` = 0; then
|
||||
rm -rf "$work_dir"
|
||||
func_fatal_error "infrastructure files for version $ver not found; this is autopoint from GNU $package $version"
|
||||
fi
|
||||
mv "$work_dir/gettext-$ver" "$work_dir/archive"
|
||||
;;
|
||||
|
||||
cvs)
|
||||
# We distributed the many different versions of the files in a CVS
|
||||
# repository. This guaranteed a good compression rate:
|
||||
#
|
||||
# Including version size in KB of
|
||||
# "du autopoint-files/archive"
|
||||
# 0.10.35 240
|
||||
# 0.10.36 428
|
||||
# 0.10.37 436
|
||||
# 0.10.38 488
|
||||
# 0.10.39 500
|
||||
# 0.10.40 528
|
||||
# 0.11 720
|
||||
# 0.11.1 740
|
||||
# 0.11.2 748
|
||||
# 0.11.3 804
|
||||
# 0.11.4 864
|
||||
# 0.11.5 880
|
||||
# 0.12 1032
|
||||
# 0.12.1 1032
|
||||
# 0.13 1220
|
||||
# 0.13.1 1236
|
||||
# 0.14 1296
|
||||
# 0.14.1 1300
|
||||
# 0.14.2 1420
|
||||
# 0.14.3 1428
|
||||
# 0.14.4 1464
|
||||
# 0.14.5 1508
|
||||
# 0.14.6 1580
|
||||
# 0.15 1760
|
||||
# 0.16 1808
|
||||
# 0.16.1 1812
|
||||
# 0.17 2128
|
||||
# 0.18 2656
|
||||
#
|
||||
# The requirement that the user must have the CVS program available is not
|
||||
# a severe restrictions, because most of the people who use autopoint are
|
||||
# users of CVS.
|
||||
#
|
||||
# But the CVS format is now deprecated, because "cvs init" does not work in
|
||||
# all circumstances
|
||||
# (see <http://lists.gnu.org/archive/html/bug-cvs/2010-05/msg00003.html>)
|
||||
# and we are not allowed to distribute the cvs infrastructure files
|
||||
# ourselves
|
||||
# (see <http://lists.gnu.org/archive/html/bug-cvs/2010-06/msg00011.html>).
|
||||
#
|
||||
# Check availability of the CVS program.
|
||||
(cvs -v) >/dev/null 2>/dev/null || func_fatal_error "cvs program not found"
|
||||
|
||||
# Set up a temporary CVS repository.
|
||||
# We need the temporary CVS repository because any checkout needs write
|
||||
# access to the CVSROOT/history file, so it cannot be under $gettext_dir.
|
||||
# We need the temporary checkout directory because when --force was not
|
||||
# given, we need to compare the existing files with the checked out ones.
|
||||
# Set variables
|
||||
# - cvs_dir directory containing the temporary repository
|
||||
cvs_dir=tmpcvs$$
|
||||
# Use an umask of 077, to avoid attacks that work by overwriting files in
|
||||
# the "$CVSROOT"/CVSROOT directory.
|
||||
(umask 077 && mkdir "$cvs_dir") || {
|
||||
if test -d "$cvs_dir"; then
|
||||
func_fatal_error "directory $cvs_dir already exists"
|
||||
else
|
||||
func_fatal_error "cannot create directory $cvs_dir"
|
||||
fi
|
||||
}
|
||||
CVSROOT="$srcdir/$cvs_dir"
|
||||
unset CVS_CLIENT_LOG
|
||||
unset CVS_CLIENT_PORT
|
||||
unset CVS_IGNORE_REMOTE_ROOT
|
||||
unset CVS_LOCAL_BRANCH_NUM
|
||||
unset CVS_NOBASES
|
||||
unset CVS_PASSFILE
|
||||
unset CVS_PASSWORD
|
||||
unset CVS_PROXY_PORT
|
||||
unset CVS_RCMD_PORT
|
||||
unset CVS_RSH
|
||||
unset CVS_SERVER
|
||||
unset CVS_SERVER_SLEEP
|
||||
CVS_SIGN_COMMITS=
|
||||
export CVS_SIGN_COMMITS
|
||||
unset CVS_SSH
|
||||
unset CVS_VERIFY_CHECKOUTS
|
||||
unset CVS_VERIFY_TEMPLATE
|
||||
unset CVSIGNORE
|
||||
unset CVSREAD
|
||||
unset CVSREADONLYFS
|
||||
unset CVSUMASK
|
||||
unset CVSWRAPPERS
|
||||
|
||||
# Need to pass -d "$CVSROOT", because there may be a CVS directory in the
|
||||
# current directory.
|
||||
cvs -d "$CVSROOT" init
|
||||
gzip -d -c < "$gettext_dir/archive.cvs.tar.gz" | (cd "$cvs_dir" && tar xf -)
|
||||
|
||||
cd "$work_dir"
|
||||
cvsver=gettext-`echo "$ver" | sed -e 's/\./_/g'`
|
||||
(cvs -d "$CVSROOT" checkout -r"$cvsver" archive > /dev/null) 2>&1 | grep -v '^cvs checkout: Updating'
|
||||
find archive -name CVS -type d -print | xargs rm -rf
|
||||
cd ..
|
||||
rm -rf "$cvs_dir"
|
||||
# Check that really all CVS directories are gone, otherwise we would overwrite
|
||||
# the contents of the user's CVS directories.
|
||||
if test `find $work_dir/archive -name CVS -type d -print | wc -l` != 0; then
|
||||
rm -rf "$work_dir"
|
||||
func_fatal_error "failed to remove all CVS subdirectories"
|
||||
fi
|
||||
if test `find $work_dir/archive -type f -print | wc -l` = 0; then
|
||||
rm -rf "$work_dir"
|
||||
func_fatal_error "infrastructure files for version $ver not found; this is autopoint from GNU $package $version"
|
||||
fi
|
||||
;;
|
||||
|
||||
git)
|
||||
# Check availability of the git program.
|
||||
(git --version) >/dev/null 2>/dev/null || func_fatal_error "git program not found"
|
||||
mkdir "$work_dir/archive"
|
||||
gzip -d -c < "$gettext_dir/archive.git.tar.gz" | (cd "$work_dir/archive" && tar xf -)
|
||||
(cd "$work_dir/archive" && git checkout -q "gettext-$ver") || {
|
||||
rm -rf "$work_dir"
|
||||
func_fatal_error "infrastructure files for version $ver not found; this is autopoint from GNU $package $version"
|
||||
}
|
||||
(cd "$work_dir/archive" && rm -rf .git .gitignore)
|
||||
;;
|
||||
esac
|
||||
|
||||
# func_destfile file
|
||||
# determines the destination file, relative to the package's top level
|
||||
# directory, for a given file name, relative to archive.
|
||||
# Sets variables
|
||||
# - destfile relative destination file name, or
|
||||
# empty if the file shall be omitted
|
||||
# - sharedowner yes if the file is not only owned by GNU gettext but may
|
||||
# be installed by automake or other tools, otherwise empty
|
||||
# - allpodirs yes if the file is to be installed in every dir in $podirs
|
||||
func_destfile ()
|
||||
{
|
||||
# There are five categories of files:
|
||||
# ABOUT_NLS -> top level directory
|
||||
# config.rpath mkinstalldirs -> $auxdir
|
||||
# m4/* -> $m4dir/
|
||||
# intl/* -> intl/
|
||||
# po/* ->
|
||||
sharedowner=
|
||||
allpodirs=
|
||||
case `echo "$1" | sed -e 's,[^/]*$,,'` in
|
||||
"" )
|
||||
case "$1" in
|
||||
config.rpath ) destfile="$auxdir$1" ;;
|
||||
mkinstalldirs ) destfile="$auxdir$1" sharedowner=yes ;;
|
||||
* ) destfile="$1" ;;
|
||||
esac
|
||||
;;
|
||||
m4/ ) destfile=`echo "$1" | sed -e "s,^m4/,$m4dir/,"` ;;
|
||||
intl/ ) if test -n "$omitintl"; then destfile=""; else destfile="$1"; fi ;;
|
||||
po/ ) destfile=`echo "$1" | sed -e "s,^po/,,"` allpodirs=yes ;;
|
||||
* ) destfile="$1" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# func_compare existingfile gettextfile
|
||||
# compares the existing file and the file from gettext, and decides whether the
|
||||
# existing file should be overwritten with the file from gettext. Returns 0 if
|
||||
# it should be overwritten, or 1 if it should be skipped.
|
||||
sed_extract_serial='s/^#.* serial \([^ ]*\).*/\1/p
|
||||
1q'
|
||||
func_compare ()
|
||||
{
|
||||
if cmp -s "$1" "$2"; then
|
||||
false
|
||||
else
|
||||
case "$2" in
|
||||
*.m4)
|
||||
# For interoperability with gnulib. gnulib often has newer versions of
|
||||
# the *.m4 files than the latest gettext release. Don't overwrite a
|
||||
# newer version from gnulib with an older version from the gettext
|
||||
# release. The version can be retrieved from the first line, which
|
||||
# looks like this: # file.m4 serial NN ...
|
||||
existing_serial=`sed -n -e "$sed_extract_serial" < "$1"`
|
||||
gettext_serial=`sed -n -e "$sed_extract_serial" < "$2"`
|
||||
if test -n "$existing_serial" && test -n "$gettext_serial" \
|
||||
&& test "$existing_serial" -ge "$gettext_serial" 2> /dev/null; then
|
||||
false
|
||||
else
|
||||
true
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
true
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
}
|
||||
|
||||
# If some files have been locally modified and we have not been requested
|
||||
# to overwrite them, then bail out. This is better than leaving a source
|
||||
# package around where half of the files are locally modified and half are
|
||||
# original - too great risk of version mismatch.
|
||||
if test -z "$force"; then
|
||||
mismatch=
|
||||
func_tmpdir
|
||||
mismatchfile="$tmp"/autopoint.diff
|
||||
for file in `find "$work_dir/archive" -type f -print | sed -e "s,^$work_dir/archive/,," | LC_ALL=C sort`; do
|
||||
func_destfile "$file"
|
||||
if test -n "$destfile"; then
|
||||
func_compare_to_destfile ()
|
||||
{
|
||||
finaldestfile="$1"
|
||||
if test -f "$finaldestfile"; then
|
||||
if func_compare "$finaldestfile" "$work_dir/archive/$file"; then
|
||||
if test -n "$sharedowner"; then
|
||||
echo "autopoint: warning: File $finaldestfile has been locally modified." 1>&2
|
||||
else
|
||||
echo "autopoint: File $finaldestfile has been locally modified." 1>&2
|
||||
mismatch=yes
|
||||
diff -c "$work_dir/archive/$file" "$finaldestfile" | sed -e "1s,$work_dir/archive/,," >> "$mismatchfile"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
if test -n "$allpodirs"; then
|
||||
for dir in $podirs; do
|
||||
func_compare_to_destfile "$dir/$destfile"
|
||||
done
|
||||
else
|
||||
func_compare_to_destfile "$destfile"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
if test -n "$mismatch"; then
|
||||
rm -rf "$work_dir"
|
||||
func_fatal_error "Some files have been locally modified. Not overwriting them because --force has not been specified. For your convenience, you find the local modifications in the file '$mismatchfile'."
|
||||
fi
|
||||
rm -rf "$tmp"
|
||||
fi
|
||||
|
||||
# func_mkdir_for to
|
||||
# ensures the directory that would the given file exists.
|
||||
# 'to' is a relative pathname, relative to the current directory.
|
||||
func_mkdir_for ()
|
||||
{
|
||||
base=`echo "$1" | sed -e 's,/[^/]*$,,'`
|
||||
if test "X$base" != "X$1" && test -n "$base"; then
|
||||
func_mkdir_for "$base"
|
||||
# Recompute base. It was clobbered by the recursive call.
|
||||
base=`echo "$1" | sed -e 's,/[^/]*$,,'`
|
||||
test -d "$base" || { echo "Creating directory $base"; mkdir "$base"; }
|
||||
fi
|
||||
}
|
||||
|
||||
# func_copy from to
|
||||
# copies a file.
|
||||
# 'from' is a relative pathname, relative to the current directory.
|
||||
# 'to' is a relative pathname, relative to the current directory.
|
||||
func_copy ()
|
||||
{
|
||||
if $doit; then
|
||||
func_mkdir_for "$2"
|
||||
rm -f "$2"
|
||||
echo "Copying file $2"
|
||||
cp "$1" "$2"
|
||||
else
|
||||
echo "Copy file $2"
|
||||
fi
|
||||
}
|
||||
|
||||
# func_backup to
|
||||
# makes a backup of a file that is about to be overwritten or replaced.
|
||||
# 'to' is a relative pathname, relative to the current directory.
|
||||
func_backup ()
|
||||
{
|
||||
if $doit; then
|
||||
if test -f "$1"; then
|
||||
rm -f "$1~"
|
||||
cp -p "$1" "$1~"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# Now copy the files.
|
||||
for file in `find "$work_dir/archive" -type f -print | sed -e "s,^$work_dir/archive/,," | LC_ALL=C sort`; do
|
||||
func_destfile "$file"
|
||||
if test -n "$destfile"; then
|
||||
func_copy_to_destfile ()
|
||||
{
|
||||
finaldestfile="$1"
|
||||
mustcopy=
|
||||
if test -f "$finaldestfile"; then
|
||||
if func_compare "$finaldestfile" "$work_dir/archive/$file"; then
|
||||
if test -n "$force"; then
|
||||
# Overwrite locally modified file.
|
||||
mustcopy=yes
|
||||
fi
|
||||
# If --force is not specified, don't overwrite locally modified files
|
||||
# for which GNU gettext is a shared owner.
|
||||
fi
|
||||
else
|
||||
mustcopy=yes
|
||||
fi
|
||||
if test -n "$mustcopy"; then
|
||||
func_backup "$finaldestfile"
|
||||
func_copy "$work_dir/archive/$file" "$finaldestfile"
|
||||
fi
|
||||
}
|
||||
if test -n "$allpodirs"; then
|
||||
for dir in $podirs; do
|
||||
func_copy_to_destfile "$dir/$destfile"
|
||||
done
|
||||
else
|
||||
func_copy_to_destfile "$destfile"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# That's it.
|
||||
rm -rf "$work_dir"
|
||||
exit 0
|
||||
Binary file not shown.
Binary file not shown.
Executable
+123
@@ -0,0 +1,123 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright (C) 2003, 2005-2007 Free Software Foundation, Inc.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Library General Public License as published
|
||||
# by the Free Software Foundation; either version 2, 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 Library 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.
|
||||
#
|
||||
|
||||
# Find a way to echo strings without interpreting backslash.
|
||||
if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
|
||||
echo='echo'
|
||||
else
|
||||
if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
|
||||
echo='printf %s\n'
|
||||
else
|
||||
echo_func () {
|
||||
cat <<EOT
|
||||
$*
|
||||
EOT
|
||||
}
|
||||
echo='echo_func'
|
||||
fi
|
||||
fi
|
||||
|
||||
# This script is primarily a shell function library. In order for
|
||||
# ". gettext.sh" to find it, we install it in $PREFIX/bin (that is usually
|
||||
# contained in $PATH), rather than in some other location such as
|
||||
# $PREFIX/share/sh-scripts or $PREFIX/share/gettext. In order to not violate
|
||||
# the Filesystem Hierarchy Standard when doing so, this script is executable.
|
||||
# Therefore it needs to support the standard --help and --version.
|
||||
if test -z "$ZSH_VERSION"; then
|
||||
# zsh is not POSIX compliant: By default, while ". gettext.sh" is executed,
|
||||
# it sets $0 to "gettext.sh", defeating the purpose of this test. But
|
||||
# fortunately we know that when running under zsh, this script is always
|
||||
# being sourced, not executed, because hardly anyone is crazy enough to
|
||||
# install zsh as /bin/sh.
|
||||
case "$0" in
|
||||
gettext.sh | */gettext.sh | *\\gettext.sh)
|
||||
progname=$0
|
||||
package=gettext-runtime
|
||||
version=0.18.1
|
||||
# func_usage
|
||||
# outputs to stdout the --help usage message.
|
||||
func_usage ()
|
||||
{
|
||||
echo "GNU gettext shell script function library version $version"
|
||||
echo "Usage: . gettext.sh"
|
||||
}
|
||||
# func_version
|
||||
# outputs to stdout the --version message.
|
||||
func_version ()
|
||||
{
|
||||
echo "$progname (GNU $package) $version"
|
||||
echo "Copyright (C) 2003-2007 Free Software Foundation, Inc.
|
||||
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
|
||||
This is free software: you are free to change and redistribute it.
|
||||
There is NO WARRANTY, to the extent permitted by law."
|
||||
echo "Written by" "Bruno Haible"
|
||||
}
|
||||
if test $# = 1; then
|
||||
case "$1" in
|
||||
--help | --hel | --he | --h )
|
||||
func_usage; exit 0 ;;
|
||||
--version | --versio | --versi | --vers | --ver | --ve | --v )
|
||||
func_version; exit 0 ;;
|
||||
esac
|
||||
fi
|
||||
func_usage 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# eval_gettext MSGID
|
||||
# looks up the translation of MSGID and substitutes shell variables in the
|
||||
# result.
|
||||
eval_gettext () {
|
||||
gettext "$1" | (export PATH `envsubst --variables "$1"`; envsubst "$1")
|
||||
}
|
||||
|
||||
# eval_ngettext MSGID MSGID-PLURAL COUNT
|
||||
# looks up the translation of MSGID / MSGID-PLURAL for COUNT and substitutes
|
||||
# shell variables in the result.
|
||||
eval_ngettext () {
|
||||
ngettext "$1" "$2" "$3" | (export PATH `envsubst --variables "$1 $2"`; envsubst "$1 $2")
|
||||
}
|
||||
|
||||
# Note: This use of envsubst is much safer than using the shell built-in 'eval'
|
||||
# would be.
|
||||
# 1) The security problem with Chinese translations that happen to use a
|
||||
# character such as \xe0\x60 is avoided.
|
||||
# 2) The security problem with malevolent translators who put in command lists
|
||||
# like "$(...)" or "`...`" is avoided.
|
||||
# 3) The translations can only refer to shell variables that are already
|
||||
# mentioned in MSGID or MSGID-PLURAL.
|
||||
#
|
||||
# Note: "export PATH" above is a dummy; this is for the case when
|
||||
# `envsubst --variables ...` returns nothing.
|
||||
#
|
||||
# Note: In eval_ngettext above, "$1 $2" means a string whose variables set is
|
||||
# the union of the variables set of "$1" and "$2".
|
||||
#
|
||||
# Note: The minimal use of backquote above ensures that trailing newlines are
|
||||
# not dropped, not from the gettext invocation and not from the value of any
|
||||
# shell variable.
|
||||
#
|
||||
# Note: Field splitting on the `envsubst --variables ...` result is desired,
|
||||
# since envsubst outputs the variables, separated by newlines. Pathname
|
||||
# wildcard expansion or tilde expansion has no effect here, since the words
|
||||
# output by "envsubst --variables ..." consist solely of alphanumeric
|
||||
# characters and underscore.
|
||||
Executable
+1281
File diff suppressed because it is too large.
Load diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,177 @@
|
||||
--- gettext-runtime/intl/printf.c
|
||||
+++ gettext-runtime/intl/printf.c
|
||||
@@ -69,7 +69,7 @@
|
||||
#define STATIC static
|
||||
|
||||
/* This needs to be consistent with libgnuintl.h.in. */
|
||||
-#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__
|
||||
+#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__
|
||||
/* Don't break __attribute__((format(printf,M,N))).
|
||||
This redefinition is only possible because the libc in NetBSD, Cygwin,
|
||||
mingw does not have a function __printf__. */
|
||||
--- gettext-runtime/intl/libgnuintl.h.in
|
||||
+++ gettext-runtime/intl/libgnuintl.h.in
|
||||
@@ -330,7 +330,7 @@
|
||||
|
||||
#if !(defined printf && defined _GL_STDIO_H) /* don't override gnulib */
|
||||
#undef printf
|
||||
-#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__
|
||||
+#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__
|
||||
/* Don't break __attribute__((format(printf,M,N))).
|
||||
This redefinition is only possible because the libc in NetBSD, Cygwin,
|
||||
mingw does not have a function __printf__.
|
||||
---- gettext-tools/gnulib-lib/clean-temp.c
|
||||
+++ gettext-tools/gnulib-lib/clean-temp.c
|
||||
@@ -66,9 +66,11 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
+#ifndef _WIN64
|
||||
#ifndef uintptr_t
|
||||
# define uintptr_t unsigned long
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
#if !GNULIB_FCNTL_SAFER
|
||||
/* The results of open() in this file are not used with fchdir,
|
||||
--- gettext-tools/gnulib-lib/fstrcmp.c
|
||||
+++ gettext-tools/gnulib-lib/fstrcmp.c
|
||||
@@ -55,9 +55,11 @@
|
||||
#include "minmax.h"
|
||||
#include "xalloc.h"
|
||||
|
||||
+#ifndef _WIN64
|
||||
#ifndef uintptr_t
|
||||
# define uintptr_t unsigned long
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
|
||||
#define ELEMENT char
|
||||
--- gettext-tools/gnulib-lib/gl_array_list.c
|
||||
+++ gettext-tools/gnulib-lib/gl_array_list.c
|
||||
@@ -55,9 +55,11 @@
|
||||
/* Checked size_t computations. */
|
||||
#include "xsize.h"
|
||||
|
||||
+#ifndef _WIN64
|
||||
#ifndef uintptr_t
|
||||
# define uintptr_t unsigned long
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
/* -------------------------- gl_list_t Data Type -------------------------- */
|
||||
|
||||
--- gettext-tools/gnulib-lib/gl_linkedhash_list.c
|
||||
+++ gettext-tools/gnulib-lib/gl_linkedhash_list.c
|
||||
@@ -55,9 +55,11 @@
|
||||
|
||||
#include "xsize.h"
|
||||
|
||||
+#ifndef _WIN64
|
||||
#ifndef uintptr_t
|
||||
# define uintptr_t unsigned long
|
||||
#endif
|
||||
+#endif
|
||||
|
||||
#define WITH_HASHTABLE 1
|
||||
|
||||
--- gettext-tools/gnulib-lib/stdio.in.h
|
||||
+++ gettext-tools/gnulib-lib/stdio.in.h
|
||||
@@ -642,10 +642,6 @@
|
||||
# if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
|
||||
|| (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && @GNULIB_STDIO_H_SIGPIPE@)
|
||||
# if defined __GNUC__
|
||||
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
||||
-/* Don't break __attribute__((format(printf,M,N))). */
|
||||
-# define printf __printf__
|
||||
-# endif
|
||||
_GL_FUNCDECL_RPL_1 (__printf__, int,
|
||||
(const char *format, ...)
|
||||
__asm__ (@ASM_SYMBOL_PREFIX@
|
||||
--- gettext-tools/gnulib-lib/tempname.c
|
||||
+++ gettext-tools/gnulib-lib/tempname.c
|
||||
@@ -54,6 +54,10 @@
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+#ifdef _WIN32
|
||||
+# include <direct.h>
|
||||
+#endif
|
||||
+
|
||||
#include <sys/stat.h>
|
||||
|
||||
#if _LIBC
|
||||
@@ -73,6 +73,10 @@
|
||||
# define __xstat64(version, file, buf) stat (file, buf)
|
||||
#endif
|
||||
|
||||
+#ifdef _WIN32
|
||||
+# define mkdir(path,mode) _mkdir(path)
|
||||
+#endif
|
||||
+
|
||||
#if ! (HAVE___SECURE_GETENV || _LIBC)
|
||||
# define __secure_getenv getenv
|
||||
#endif
|
||||
--- gettext-tools/src/write-java.c
|
||||
+++ gettext-tools/src/write-java.c
|
||||
@@ -30,6 +30,10 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
+#ifdef _WIN32
|
||||
+# include <direct.h>
|
||||
+#endif
|
||||
+
|
||||
#include <sys/stat.h>
|
||||
#if !defined S_ISDIR && defined S_IFDIR
|
||||
# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
|
||||
@@ -53,6 +53,10 @@
|
||||
# define S_IXUSR 00100
|
||||
#endif
|
||||
|
||||
+#ifdef _WIN32
|
||||
+# define mkdir(path,mode) _mkdir(path)
|
||||
+#endif
|
||||
+
|
||||
#include "c-ctype.h"
|
||||
#include "error.h"
|
||||
#include "xerror.h"
|
||||
--- gettext-tools/src/write-csharp.c
|
||||
+++ gettext-tools/src/write-csharp.c
|
||||
@@ -29,6 +29,10 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
+#ifdef _WIN32
|
||||
+# include <direct.h>
|
||||
+#endif
|
||||
+
|
||||
#include <sys/stat.h>
|
||||
#if !defined S_ISDIR && defined S_IFDIR
|
||||
# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
|
||||
@@ -70,6 +70,10 @@
|
||||
# define S_IXOTH (S_IXUSR >> 6)
|
||||
#endif
|
||||
|
||||
+#ifdef _WIN32
|
||||
+# define mkdir(path,mode) _mkdir(path)
|
||||
+#endif
|
||||
+
|
||||
#include "c-ctype.h"
|
||||
#include "relocatable.h"
|
||||
#include "error.h"
|
||||
--- gettext-tools/woe32dll/export.h
|
||||
+++ gettext-tools/woe32dll/export.h
|
||||
@@ -90,7 +90,11 @@
|
||||
--export-all-symbols is used. */
|
||||
|
||||
/* IMP(x) is a symbol that contains the address of x. */
|
||||
+#ifdef _WIN64
|
||||
+#define IMP(x) __imp_##x
|
||||
+#else
|
||||
#define IMP(x) _imp__##x
|
||||
+#endif
|
||||
|
||||
/* Ensure that the variable x is exported from the library, and that a
|
||||
pseudo-variable IMP(x) is available. */
|
||||
@@ -0,0 +1,66 @@
|
||||
/* Class autosprintf - formatted output to an ostream.
|
||||
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public License as published
|
||||
by the Free Software Foundation; either version 2, 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifndef _AUTOSPRINTF_H
|
||||
#define _AUTOSPRINTF_H
|
||||
|
||||
#ifndef __attribute__
|
||||
/* This feature is available in gcc versions 2.5 and later. */
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
|
||||
# define __attribute__(Spec) /* empty */
|
||||
# endif
|
||||
/* The __-protected variants of `format' and `printf' attributes
|
||||
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
|
||||
# define __format__ format
|
||||
# define __printf__ printf
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
namespace gnu
|
||||
{
|
||||
/* A temporary object, usually allocated on the stack, representing
|
||||
the result of an asprintf() call. */
|
||||
class autosprintf
|
||||
{
|
||||
public:
|
||||
/* Constructor: takes a format string and the printf arguments. */
|
||||
autosprintf (const char *format, ...)
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
/* Copy constructor. */
|
||||
autosprintf (const autosprintf& src);
|
||||
/* Destructor: frees the temporarily allocated string. */
|
||||
~autosprintf ();
|
||||
/* Conversion to string. */
|
||||
operator char * () const;
|
||||
operator std::string () const;
|
||||
/* Output to an ostream. */
|
||||
friend inline std::ostream& operator<< (std::ostream& stream, const autosprintf& tmp)
|
||||
{
|
||||
stream << (tmp.str ? tmp.str : "(error in autosprintf)");
|
||||
return stream;
|
||||
}
|
||||
private:
|
||||
char *str;
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* _AUTOSPRINTF_H */
|
||||
@@ -0,0 +1,357 @@
|
||||
/* Public API for GNU gettext PO files - contained in libgettextpo.
|
||||
Copyright (C) 2003-2008, 2010 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2003.
|
||||
|
||||
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 3 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, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _GETTEXT_PO_H
|
||||
#define _GETTEXT_PO_H 1
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* =========================== Meta Information ============================ */
|
||||
|
||||
/* Version number: (major<<16) + (minor<<8) + subminor */
|
||||
#define LIBGETTEXTPO_VERSION 0x001201
|
||||
extern __declspec (dllimport) int libgettextpo_version;
|
||||
|
||||
/* ================================= Types ================================= */
|
||||
|
||||
/* A po_file_t represents the contents of a PO file. */
|
||||
typedef struct po_file *po_file_t;
|
||||
|
||||
/* A po_message_iterator_t represents an iterator through a domain of a
|
||||
PO file. */
|
||||
typedef struct po_message_iterator *po_message_iterator_t;
|
||||
|
||||
/* A po_message_t represents a message in a PO file. */
|
||||
typedef struct po_message *po_message_t;
|
||||
|
||||
/* A po_filepos_t represents a string's position within a source file. */
|
||||
typedef struct po_filepos *po_filepos_t;
|
||||
|
||||
/* A po_error_handler handles error situations. */
|
||||
struct po_error_handler
|
||||
{
|
||||
/* Signal an error. The error message is built from FORMAT and the following
|
||||
arguments. ERRNUM, if nonzero, is an errno value.
|
||||
Must increment the error_message_count variable declared in error.h.
|
||||
Must not return if STATUS is nonzero. */
|
||||
void (*error) (int status, int errnum,
|
||||
const char *format, ...)
|
||||
#if ((__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3) && !__STRICT_ANSI__
|
||||
__attribute__ ((__format__ (__printf__, 3, 4)))
|
||||
#endif
|
||||
;
|
||||
|
||||
/* Signal an error. The error message is built from FORMAT and the following
|
||||
arguments. The error location is at FILENAME line LINENO. ERRNUM, if
|
||||
nonzero, is an errno value.
|
||||
Must increment the error_message_count variable declared in error.h.
|
||||
Must not return if STATUS is nonzero. */
|
||||
void (*error_at_line) (int status, int errnum,
|
||||
const char *filename, unsigned int lineno,
|
||||
const char *format, ...)
|
||||
#if ((__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3) && !__STRICT_ANSI__
|
||||
__attribute__ ((__format__ (__printf__, 5, 6)))
|
||||
#endif
|
||||
;
|
||||
|
||||
/* Signal a multiline warning. The PREFIX applies to all lines of the
|
||||
MESSAGE. Free the PREFIX and MESSAGE when done. */
|
||||
void (*multiline_warning) (char *prefix, char *message);
|
||||
|
||||
/* Signal a multiline error. The PREFIX applies to all lines of the
|
||||
MESSAGE. Free the PREFIX and MESSAGE when done.
|
||||
Must increment the error_message_count variable declared in error.h if
|
||||
PREFIX is non-NULL. */
|
||||
void (*multiline_error) (char *prefix, char *message);
|
||||
};
|
||||
typedef const struct po_error_handler *po_error_handler_t;
|
||||
|
||||
/* A po_xerror_handler handles warnings, error and fatal error situations. */
|
||||
#define PO_SEVERITY_WARNING 0 /* just a warning, tell the user */
|
||||
#define PO_SEVERITY_ERROR 1 /* an error, the operation cannot complete */
|
||||
#define PO_SEVERITY_FATAL_ERROR 2 /* an error, the operation must be aborted */
|
||||
struct po_xerror_handler
|
||||
{
|
||||
/* Signal a problem of the given severity.
|
||||
MESSAGE and/or FILENAME + LINENO indicate where the problem occurred.
|
||||
If FILENAME is NULL, FILENAME and LINENO and COLUMN should be ignored.
|
||||
If LINENO is (size_t)(-1), LINENO and COLUMN should be ignored.
|
||||
If COLUMN is (size_t)(-1), it should be ignored.
|
||||
MESSAGE_TEXT is the problem description (if MULTILINE_P is true,
|
||||
multiple lines of text, each terminated with a newline, otherwise
|
||||
usually a single line).
|
||||
Must not return if SEVERITY is PO_SEVERITY_FATAL_ERROR. */
|
||||
void (*xerror) (int severity,
|
||||
po_message_t message,
|
||||
const char *filename, size_t lineno, size_t column,
|
||||
int multiline_p, const char *message_text);
|
||||
/* Signal a problem that refers to two messages.
|
||||
Similar to two calls to xerror.
|
||||
If possible, a "..." can be appended to MESSAGE_TEXT1 and prepended to
|
||||
MESSAGE_TEXT2. */
|
||||
void (*xerror2) (int severity,
|
||||
po_message_t message1,
|
||||
const char *filename1, size_t lineno1, size_t column1,
|
||||
int multiline_p1, const char *message_text1,
|
||||
po_message_t message2,
|
||||
const char *filename2, size_t lineno2, size_t column2,
|
||||
int multiline_p2, const char *message_text2);
|
||||
};
|
||||
typedef const struct po_xerror_handler *po_xerror_handler_t;
|
||||
|
||||
/* Memory allocation:
|
||||
The memory allocations performed by these functions use xmalloc(),
|
||||
therefore will cause a program exit if memory is exhausted.
|
||||
The memory allocated by po_file_read, and implicitly returned through
|
||||
the po_message_* functions, lasts until freed with po_file_free. */
|
||||
|
||||
|
||||
/* ============================= po_file_t API ============================= */
|
||||
|
||||
/* Create an empty PO file representation in memory. */
|
||||
extern po_file_t po_file_create (void);
|
||||
|
||||
/* Read a PO file into memory.
|
||||
Return its contents. Upon failure, return NULL and set errno. */
|
||||
#define po_file_read po_file_read_v3
|
||||
extern po_file_t po_file_read (const char *filename,
|
||||
po_xerror_handler_t handler);
|
||||
|
||||
/* Write an in-memory PO file to a file.
|
||||
Upon failure, return NULL and set errno. */
|
||||
#define po_file_write po_file_write_v2
|
||||
extern po_file_t po_file_write (po_file_t file, const char *filename,
|
||||
po_xerror_handler_t handler);
|
||||
|
||||
/* Free a PO file from memory. */
|
||||
extern void po_file_free (po_file_t file);
|
||||
|
||||
/* Return the names of the domains covered by a PO file in memory. */
|
||||
extern const char * const * po_file_domains (po_file_t file);
|
||||
|
||||
|
||||
/* =========================== Header entry API ============================ */
|
||||
|
||||
/* Return the header entry of a domain of a PO file in memory.
|
||||
The domain NULL denotes the default domain.
|
||||
Return NULL if there is no header entry. */
|
||||
extern const char * po_file_domain_header (po_file_t file, const char *domain);
|
||||
|
||||
/* Return the value of a field in a header entry.
|
||||
The return value is either a freshly allocated string, to be freed by the
|
||||
caller, or NULL. */
|
||||
extern char * po_header_field (const char *header, const char *field);
|
||||
|
||||
/* Return the header entry with a given field set to a given value. The field
|
||||
is added if necessary.
|
||||
The return value is a freshly allocated string. */
|
||||
extern char * po_header_set_field (const char *header, const char *field, const char *value);
|
||||
|
||||
|
||||
/* ======================= po_message_iterator_t API ======================= */
|
||||
|
||||
/* Create an iterator for traversing a domain of a PO file in memory.
|
||||
The domain NULL denotes the default domain. */
|
||||
extern po_message_iterator_t po_message_iterator (po_file_t file, const char *domain);
|
||||
|
||||
/* Free an iterator. */
|
||||
extern void po_message_iterator_free (po_message_iterator_t iterator);
|
||||
|
||||
/* Return the next message, and advance the iterator.
|
||||
Return NULL at the end of the message list. */
|
||||
extern po_message_t po_next_message (po_message_iterator_t iterator);
|
||||
|
||||
/* Insert a message in a PO file in memory, in the domain and at the position
|
||||
indicated by the iterator. The iterator thereby advances past the freshly
|
||||
inserted message. */
|
||||
extern void po_message_insert (po_message_iterator_t iterator, po_message_t message);
|
||||
|
||||
|
||||
/* =========================== po_message_t API ============================ */
|
||||
|
||||
/* Return a freshly constructed message.
|
||||
To finish initializing the message, you must set the msgid and msgstr. */
|
||||
extern po_message_t po_message_create (void);
|
||||
|
||||
/* Return the context of a message, or NULL for a message not restricted to a
|
||||
context. */
|
||||
extern const char * po_message_msgctxt (po_message_t message);
|
||||
|
||||
/* Change the context of a message. NULL means a message not restricted to a
|
||||
context. */
|
||||
extern void po_message_set_msgctxt (po_message_t message, const char *msgctxt);
|
||||
|
||||
/* Return the msgid (untranslated English string) of a message. */
|
||||
extern const char * po_message_msgid (po_message_t message);
|
||||
|
||||
/* Change the msgid (untranslated English string) of a message. */
|
||||
extern void po_message_set_msgid (po_message_t message, const char *msgid);
|
||||
|
||||
/* Return the msgid_plural (untranslated English plural string) of a message,
|
||||
or NULL for a message without plural. */
|
||||
extern const char * po_message_msgid_plural (po_message_t message);
|
||||
|
||||
/* Change the msgid_plural (untranslated English plural string) of a message.
|
||||
NULL means a message without plural. */
|
||||
extern void po_message_set_msgid_plural (po_message_t message, const char *msgid_plural);
|
||||
|
||||
/* Return the msgstr (translation) of a message.
|
||||
Return the empty string for an untranslated message. */
|
||||
extern const char * po_message_msgstr (po_message_t message);
|
||||
|
||||
/* Change the msgstr (translation) of a message.
|
||||
Use an empty string to denote an untranslated message. */
|
||||
extern void po_message_set_msgstr (po_message_t message, const char *msgstr);
|
||||
|
||||
/* Return the msgstr[index] for a message with plural handling, or
|
||||
NULL when the index is out of range or for a message without plural. */
|
||||
extern const char * po_message_msgstr_plural (po_message_t message, int index);
|
||||
|
||||
/* Change the msgstr[index] for a message with plural handling.
|
||||
Use a NULL value at the end to reduce the number of plural forms. */
|
||||
extern void po_message_set_msgstr_plural (po_message_t message, int index, const char *msgstr);
|
||||
|
||||
/* Return the comments for a message. */
|
||||
extern const char * po_message_comments (po_message_t message);
|
||||
|
||||
/* Change the comments for a message.
|
||||
comments should be a multiline string, ending in a newline, or empty. */
|
||||
extern void po_message_set_comments (po_message_t message, const char *comments);
|
||||
|
||||
/* Return the extracted comments for a message. */
|
||||
extern const char * po_message_extracted_comments (po_message_t message);
|
||||
|
||||
/* Change the extracted comments for a message.
|
||||
comments should be a multiline string, ending in a newline, or empty. */
|
||||
extern void po_message_set_extracted_comments (po_message_t message, const char *comments);
|
||||
|
||||
/* Return the i-th file position for a message, or NULL if i is out of
|
||||
range. */
|
||||
extern po_filepos_t po_message_filepos (po_message_t message, int i);
|
||||
|
||||
/* Remove the i-th file position from a message.
|
||||
The indices of all following file positions for the message are decremented
|
||||
by one. */
|
||||
extern void po_message_remove_filepos (po_message_t message, int i);
|
||||
|
||||
/* Add a file position to a message, if it is not already present for the
|
||||
message.
|
||||
file is the file name.
|
||||
start_line is the line number where the string starts, or (size_t)(-1) if no
|
||||
line number is available. */
|
||||
extern void po_message_add_filepos (po_message_t message, const char *file, size_t start_line);
|
||||
|
||||
/* Return the previous context of a message, or NULL for none. */
|
||||
extern const char * po_message_prev_msgctxt (po_message_t message);
|
||||
|
||||
/* Change the previous context of a message. NULL is allowed. */
|
||||
extern void po_message_set_prev_msgctxt (po_message_t message, const char *prev_msgctxt);
|
||||
|
||||
/* Return the previous msgid (untranslated English string) of a message, or
|
||||
NULL for none. */
|
||||
extern const char * po_message_prev_msgid (po_message_t message);
|
||||
|
||||
/* Change the previous msgid (untranslated English string) of a message.
|
||||
NULL is allowed. */
|
||||
extern void po_message_set_prev_msgid (po_message_t message, const char *prev_msgid);
|
||||
|
||||
/* Return the previous msgid_plural (untranslated English plural string) of a
|
||||
message, or NULL for none. */
|
||||
extern const char * po_message_prev_msgid_plural (po_message_t message);
|
||||
|
||||
/* Change the previous msgid_plural (untranslated English plural string) of a
|
||||
message. NULL is allowed. */
|
||||
extern void po_message_set_prev_msgid_plural (po_message_t message, const char *prev_msgid_plural);
|
||||
|
||||
/* Return true if the message is marked obsolete. */
|
||||
extern int po_message_is_obsolete (po_message_t message);
|
||||
|
||||
/* Change the obsolete mark of a message. */
|
||||
extern void po_message_set_obsolete (po_message_t message, int obsolete);
|
||||
|
||||
/* Return true if the message is marked fuzzy. */
|
||||
extern int po_message_is_fuzzy (po_message_t message);
|
||||
|
||||
/* Change the fuzzy mark of a message. */
|
||||
extern void po_message_set_fuzzy (po_message_t message, int fuzzy);
|
||||
|
||||
/* Return true if the message is marked as being a format string of the given
|
||||
type (e.g. "c-format"). */
|
||||
extern int po_message_is_format (po_message_t message, const char *format_type);
|
||||
|
||||
/* Change the format string mark for a given type of a message. */
|
||||
extern void po_message_set_format (po_message_t message, const char *format_type, /*bool*/int value);
|
||||
|
||||
/* If a numeric range of a message is set, return true and store the minimum
|
||||
and maximum value in *MINP and *MAXP. */
|
||||
extern int po_message_is_range (po_message_t message, int *minp, int *maxp);
|
||||
|
||||
/* Change the numeric range of a message. MIN and MAX must be non-negative,
|
||||
with MIN < MAX. Use MIN = MAX = -1 to remove the numeric range of a
|
||||
message. */
|
||||
extern void po_message_set_range (po_message_t message, int min, int max);
|
||||
|
||||
|
||||
/* =========================== po_filepos_t API ============================ */
|
||||
|
||||
/* Return the file name. */
|
||||
extern const char * po_filepos_file (po_filepos_t filepos);
|
||||
|
||||
/* Return the line number where the string starts, or (size_t)(-1) if no line
|
||||
number is available. */
|
||||
extern size_t po_filepos_start_line (po_filepos_t filepos);
|
||||
|
||||
|
||||
/* ============================ Format type API ============================= */
|
||||
|
||||
/* Return a NULL terminated array of the supported format types. */
|
||||
extern const char * const * po_format_list (void);
|
||||
|
||||
/* Return the pretty name associated with a format type.
|
||||
For example, for "csharp-format", return "C#".
|
||||
Return NULL if the argument is not a supported format type. */
|
||||
extern const char * po_format_pretty_name (const char *format_type);
|
||||
|
||||
|
||||
/* ============================= Checking API ============================== */
|
||||
|
||||
/* Test whether an entire file PO file is valid, like msgfmt does it.
|
||||
If it is invalid, pass the reasons to the handler. */
|
||||
extern void po_file_check_all (po_file_t file, po_xerror_handler_t handler);
|
||||
|
||||
/* Test a single message, to be inserted in a PO file in memory, like msgfmt
|
||||
does it. If it is invalid, pass the reasons to the handler. The iterator
|
||||
is not modified by this call; it only specifies the file and the domain. */
|
||||
extern void po_message_check_all (po_message_t message, po_message_iterator_t iterator, po_xerror_handler_t handler);
|
||||
|
||||
/* Test whether the message translation is a valid format string if the message
|
||||
is marked as being a format string. If it is invalid, pass the reasons to
|
||||
the handler. */
|
||||
#define po_message_check_format po_message_check_format_v2
|
||||
extern void po_message_check_format (po_message_t message, po_xerror_handler_t handler);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _GETTEXT_PO_H */
|
||||
@@ -0,0 +1,464 @@
|
||||
/* Message catalogs for internationalization.
|
||||
Copyright (C) 1995-1997, 2000-2010 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public License as published
|
||||
by the Free Software Foundation; either version 2, 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifndef _LIBINTL_H
|
||||
#define _LIBINTL_H 1
|
||||
|
||||
#include <locale.h>
|
||||
#if (defined __APPLE__ && defined __MACH__) && 0
|
||||
# include <xlocale.h>
|
||||
#endif
|
||||
|
||||
/* The LC_MESSAGES locale category is the category used by the functions
|
||||
gettext() and dgettext(). It is specified in POSIX, but not in ANSI C.
|
||||
On systems that don't define it, use an arbitrary value instead.
|
||||
On Solaris, <locale.h> defines __LOCALE_H (or _LOCALE_H in Solaris 2.5)
|
||||
then includes <libintl.h> (i.e. this file!) and then only defines
|
||||
LC_MESSAGES. To avoid a redefinition warning, don't define LC_MESSAGES
|
||||
in this case. */
|
||||
#if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun))
|
||||
# define LC_MESSAGES 1729
|
||||
#endif
|
||||
|
||||
/* We define an additional symbol to signal that we use the GNU
|
||||
implementation of gettext. */
|
||||
#define __USE_GNU_GETTEXT 1
|
||||
|
||||
/* Provide information about the supported file formats. Returns the
|
||||
maximum minor revision number supported for a given major revision. */
|
||||
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) \
|
||||
((major) == 0 || (major) == 1 ? 1 : -1)
|
||||
|
||||
/* Resolve a platform specific conflict on DJGPP. GNU gettext takes
|
||||
precedence over _conio_gettext. */
|
||||
#ifdef __DJGPP__
|
||||
# undef gettext
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* Version number: (major<<16) + (minor<<8) + subminor */
|
||||
#define LIBINTL_VERSION 0x001201
|
||||
extern int libintl_version;
|
||||
|
||||
|
||||
/* We redirect the functions to those prefixed with "libintl_". This is
|
||||
necessary, because some systems define gettext/textdomain/... in the C
|
||||
library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer).
|
||||
If we used the unprefixed names, there would be cases where the
|
||||
definition in the C library would override the one in the libintl.so
|
||||
shared library. Recall that on ELF systems, the symbols are looked
|
||||
up in the following order:
|
||||
1. in the executable,
|
||||
2. in the shared libraries specified on the link command line, in order,
|
||||
3. in the dependencies of the shared libraries specified on the link
|
||||
command line,
|
||||
4. in the dlopen()ed shared libraries, in the order in which they were
|
||||
dlopen()ed.
|
||||
The definition in the C library would override the one in libintl.so if
|
||||
either
|
||||
* -lc is given on the link command line and -lintl isn't, or
|
||||
* -lc is given on the link command line before -lintl, or
|
||||
* libintl.so is a dependency of a dlopen()ed shared library but not
|
||||
linked to the executable at link time.
|
||||
Since Solaris gettext() behaves differently than GNU gettext(), this
|
||||
would be unacceptable.
|
||||
|
||||
The redirection happens by default through macros in C, so that &gettext
|
||||
is independent of the compilation unit, but through inline functions in
|
||||
C++, in order not to interfere with the name mangling of class fields or
|
||||
class methods called 'gettext'. */
|
||||
|
||||
/* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS.
|
||||
If he doesn't, we choose the method. A third possible method is
|
||||
_INTL_REDIRECT_ASM, supported only by GCC. */
|
||||
#if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS)
|
||||
# if defined __GNUC__ && __GNUC__ >= 2 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1) && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)
|
||||
# define _INTL_REDIRECT_ASM
|
||||
# else
|
||||
# ifdef __cplusplus
|
||||
# define _INTL_REDIRECT_INLINE
|
||||
# else
|
||||
# define _INTL_REDIRECT_MACROS
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
/* Auxiliary macros. */
|
||||
#ifdef _INTL_REDIRECT_ASM
|
||||
# define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname))
|
||||
# define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring
|
||||
# define _INTL_STRINGIFY(prefix) #prefix
|
||||
#else
|
||||
# define _INTL_ASM(cname)
|
||||
#endif
|
||||
|
||||
/* _INTL_MAY_RETURN_STRING_ARG(n) declares that the given function may return
|
||||
its n-th argument literally. This enables GCC to warn for example about
|
||||
printf (gettext ("foo %y")). */
|
||||
#if defined __GNUC__ && __GNUC__ >= 3 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1 && defined __cplusplus)
|
||||
# define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__ ((__format_arg__ (n)))
|
||||
#else
|
||||
# define _INTL_MAY_RETURN_STRING_ARG(n)
|
||||
#endif
|
||||
|
||||
/* Look up MSGID in the current default message catalog for the current
|
||||
LC_MESSAGES locale. If not found, returns MSGID itself (the default
|
||||
text). */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_gettext (const char *__msgid)
|
||||
_INTL_MAY_RETURN_STRING_ARG (1);
|
||||
static inline char *gettext (const char *__msgid)
|
||||
{
|
||||
return libintl_gettext (__msgid);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define gettext libintl_gettext
|
||||
#endif
|
||||
extern char *gettext (const char *__msgid)
|
||||
_INTL_ASM (libintl_gettext)
|
||||
_INTL_MAY_RETURN_STRING_ARG (1);
|
||||
#endif
|
||||
|
||||
/* Look up MSGID in the DOMAINNAME message catalog for the current
|
||||
LC_MESSAGES locale. */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_dgettext (const char *__domainname, const char *__msgid)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2);
|
||||
static inline char *dgettext (const char *__domainname, const char *__msgid)
|
||||
{
|
||||
return libintl_dgettext (__domainname, __msgid);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define dgettext libintl_dgettext
|
||||
#endif
|
||||
extern char *dgettext (const char *__domainname, const char *__msgid)
|
||||
_INTL_ASM (libintl_dgettext)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2);
|
||||
#endif
|
||||
|
||||
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
|
||||
locale. */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_dcgettext (const char *__domainname, const char *__msgid,
|
||||
int __category)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2);
|
||||
static inline char *dcgettext (const char *__domainname, const char *__msgid,
|
||||
int __category)
|
||||
{
|
||||
return libintl_dcgettext (__domainname, __msgid, __category);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define dcgettext libintl_dcgettext
|
||||
#endif
|
||||
extern char *dcgettext (const char *__domainname, const char *__msgid,
|
||||
int __category)
|
||||
_INTL_ASM (libintl_dcgettext)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2);
|
||||
#endif
|
||||
|
||||
|
||||
/* Similar to `gettext' but select the plural form corresponding to the
|
||||
number N. */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n)
|
||||
_INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2);
|
||||
static inline char *ngettext (const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n)
|
||||
{
|
||||
return libintl_ngettext (__msgid1, __msgid2, __n);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define ngettext libintl_ngettext
|
||||
#endif
|
||||
extern char *ngettext (const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n)
|
||||
_INTL_ASM (libintl_ngettext)
|
||||
_INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2);
|
||||
#endif
|
||||
|
||||
/* Similar to `dgettext' but select the plural form corresponding to the
|
||||
number N. */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_dngettext (const char *__domainname, const char *__msgid1,
|
||||
const char *__msgid2, unsigned long int __n)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
|
||||
static inline char *dngettext (const char *__domainname, const char *__msgid1,
|
||||
const char *__msgid2, unsigned long int __n)
|
||||
{
|
||||
return libintl_dngettext (__domainname, __msgid1, __msgid2, __n);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define dngettext libintl_dngettext
|
||||
#endif
|
||||
extern char *dngettext (const char *__domainname,
|
||||
const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n)
|
||||
_INTL_ASM (libintl_dngettext)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
|
||||
#endif
|
||||
|
||||
/* Similar to `dcgettext' but select the plural form corresponding to the
|
||||
number N. */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_dcngettext (const char *__domainname,
|
||||
const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n, int __category)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
|
||||
static inline char *dcngettext (const char *__domainname,
|
||||
const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n, int __category)
|
||||
{
|
||||
return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define dcngettext libintl_dcngettext
|
||||
#endif
|
||||
extern char *dcngettext (const char *__domainname,
|
||||
const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n, int __category)
|
||||
_INTL_ASM (libintl_dcngettext)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Set the current default message catalog to DOMAINNAME.
|
||||
If DOMAINNAME is null, return the current default.
|
||||
If DOMAINNAME is "", reset to the default of "messages". */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_textdomain (const char *__domainname);
|
||||
static inline char *textdomain (const char *__domainname)
|
||||
{
|
||||
return libintl_textdomain (__domainname);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define textdomain libintl_textdomain
|
||||
#endif
|
||||
extern char *textdomain (const char *__domainname)
|
||||
_INTL_ASM (libintl_textdomain);
|
||||
#endif
|
||||
|
||||
/* Specify that the DOMAINNAME message catalog will be found
|
||||
in DIRNAME rather than in the system locale data base. */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_bindtextdomain (const char *__domainname,
|
||||
const char *__dirname);
|
||||
static inline char *bindtextdomain (const char *__domainname,
|
||||
const char *__dirname)
|
||||
{
|
||||
return libintl_bindtextdomain (__domainname, __dirname);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define bindtextdomain libintl_bindtextdomain
|
||||
#endif
|
||||
extern char *bindtextdomain (const char *__domainname, const char *__dirname)
|
||||
_INTL_ASM (libintl_bindtextdomain);
|
||||
#endif
|
||||
|
||||
/* Specify the character encoding in which the messages from the
|
||||
DOMAINNAME message catalog will be returned. */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_bind_textdomain_codeset (const char *__domainname,
|
||||
const char *__codeset);
|
||||
static inline char *bind_textdomain_codeset (const char *__domainname,
|
||||
const char *__codeset)
|
||||
{
|
||||
return libintl_bind_textdomain_codeset (__domainname, __codeset);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define bind_textdomain_codeset libintl_bind_textdomain_codeset
|
||||
#endif
|
||||
extern char *bind_textdomain_codeset (const char *__domainname,
|
||||
const char *__codeset)
|
||||
_INTL_ASM (libintl_bind_textdomain_codeset);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Support for format strings with positions in *printf(), following the
|
||||
POSIX/XSI specification.
|
||||
Note: These replacements for the *printf() functions are visible only
|
||||
in source files that #include <libintl.h> or #include "gettext.h".
|
||||
Packages that use *printf() in source files that don't refer to _()
|
||||
or gettext() but for which the format string could be the return value
|
||||
of _() or gettext() need to add this #include. Oh well. */
|
||||
|
||||
#if !0
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stddef.h>
|
||||
|
||||
/* Get va_list. */
|
||||
#if (defined __STDC__ && __STDC__) || defined __cplusplus || defined _MSC_VER
|
||||
# include <stdarg.h>
|
||||
#else
|
||||
# include <varargs.h>
|
||||
#endif
|
||||
|
||||
#if !(defined fprintf && defined _GL_STDIO_H) /* don't override gnulib */
|
||||
#undef fprintf
|
||||
#define fprintf libintl_fprintf
|
||||
extern int fprintf (FILE *, const char *, ...);
|
||||
#endif
|
||||
#if !(defined vfprintf && defined _GL_STDIO_H) /* don't override gnulib */
|
||||
#undef vfprintf
|
||||
#define vfprintf libintl_vfprintf
|
||||
extern int vfprintf (FILE *, const char *, va_list);
|
||||
#endif
|
||||
|
||||
#if !(defined printf && defined _GL_STDIO_H) /* don't override gnulib */
|
||||
#undef printf
|
||||
#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__
|
||||
/* Don't break __attribute__((format(printf,M,N))).
|
||||
This redefinition is only possible because the libc in NetBSD, Cygwin,
|
||||
mingw does not have a function __printf__.
|
||||
Alternatively, we could have done this redirection only when compiling with
|
||||
__GNUC__, together with a symbol redirection:
|
||||
extern int printf (const char *, ...)
|
||||
__asm__ (#__USER_LABEL_PREFIX__ "libintl_printf");
|
||||
But doing it now would introduce a binary incompatibility with already
|
||||
distributed versions of libintl on these systems. */
|
||||
# define libintl_printf __printf__
|
||||
#endif
|
||||
#define printf libintl_printf
|
||||
extern int printf (const char *, ...);
|
||||
#endif
|
||||
#if !(defined vprintf && defined _GL_STDIO_H) /* don't override gnulib */
|
||||
#undef vprintf
|
||||
#define vprintf libintl_vprintf
|
||||
extern int vprintf (const char *, va_list);
|
||||
#endif
|
||||
|
||||
#if !(defined sprintf && defined _GL_STDIO_H) /* don't override gnulib */
|
||||
#undef sprintf
|
||||
#define sprintf libintl_sprintf
|
||||
extern int sprintf (char *, const char *, ...);
|
||||
#endif
|
||||
#if !(defined vsprintf && defined _GL_STDIO_H) /* don't override gnulib */
|
||||
#undef vsprintf
|
||||
#define vsprintf libintl_vsprintf
|
||||
extern int vsprintf (char *, const char *, va_list);
|
||||
#endif
|
||||
|
||||
#if 1
|
||||
|
||||
#if !(defined snprintf && defined _GL_STDIO_H) /* don't override gnulib */
|
||||
#undef snprintf
|
||||
#define snprintf libintl_snprintf
|
||||
extern int snprintf (char *, size_t, const char *, ...);
|
||||
#endif
|
||||
#if !(defined vsnprintf && defined _GL_STDIO_H) /* don't override gnulib */
|
||||
#undef vsnprintf
|
||||
#define vsnprintf libintl_vsnprintf
|
||||
extern int vsnprintf (char *, size_t, const char *, va_list);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
|
||||
#if !(defined asprintf && defined _GL_STDIO_H) /* don't override gnulib */
|
||||
#undef asprintf
|
||||
#define asprintf libintl_asprintf
|
||||
extern int asprintf (char **, const char *, ...);
|
||||
#endif
|
||||
#if !(defined vasprintf && defined _GL_STDIO_H) /* don't override gnulib */
|
||||
#undef vasprintf
|
||||
#define vasprintf libintl_vasprintf
|
||||
extern int vasprintf (char **, const char *, va_list);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
|
||||
#undef fwprintf
|
||||
#define fwprintf libintl_fwprintf
|
||||
extern int fwprintf (FILE *, const wchar_t *, ...);
|
||||
#undef vfwprintf
|
||||
#define vfwprintf libintl_vfwprintf
|
||||
extern int vfwprintf (FILE *, const wchar_t *, va_list);
|
||||
|
||||
#undef wprintf
|
||||
#define wprintf libintl_wprintf
|
||||
extern int wprintf (const wchar_t *, ...);
|
||||
#undef vwprintf
|
||||
#define vwprintf libintl_vwprintf
|
||||
extern int vwprintf (const wchar_t *, va_list);
|
||||
|
||||
#undef swprintf
|
||||
#define swprintf libintl_swprintf
|
||||
extern int swprintf (wchar_t *, size_t, const wchar_t *, ...);
|
||||
#undef vswprintf
|
||||
#define vswprintf libintl_vswprintf
|
||||
extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* Support for the locale chosen by the user. */
|
||||
#if (defined __APPLE__ && defined __MACH__) || defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
|
||||
|
||||
#undef setlocale
|
||||
#define setlocale libintl_setlocale
|
||||
extern char *setlocale (int, const char *);
|
||||
|
||||
#if 0
|
||||
|
||||
#undef newlocale
|
||||
#define newlocale libintl_newlocale
|
||||
extern locale_t newlocale (int, const char *, locale_t);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* Support for relocatable packages. */
|
||||
|
||||
/* Sets the original and the current installation prefix of the package.
|
||||
Relocation simply replaces a pathname starting with the original prefix
|
||||
by the corresponding pathname with the current prefix instead. Both
|
||||
prefixes should be directory names without trailing slash (i.e. use ""
|
||||
instead of "/"). */
|
||||
#define libintl_set_relocation_prefix libintl_set_relocation_prefix
|
||||
extern void
|
||||
libintl_set_relocation_prefix (const char *orig_prefix,
|
||||
const char *curr_prefix);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* libintl.h */
|
||||
@@ -0,0 +1,66 @@
|
||||
/* Class autosprintf - formatted output to an ostream.
|
||||
Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public License as published
|
||||
by the Free Software Foundation; either version 2, 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifndef _AUTOSPRINTF_H
|
||||
#define _AUTOSPRINTF_H
|
||||
|
||||
#ifndef __attribute__
|
||||
/* This feature is available in gcc versions 2.5 and later. */
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
|
||||
# define __attribute__(Spec) /* empty */
|
||||
# endif
|
||||
/* The __-protected variants of `format' and `printf' attributes
|
||||
are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */
|
||||
# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
|
||||
# define __format__ format
|
||||
# define __printf__ printf
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
namespace gnu
|
||||
{
|
||||
/* A temporary object, usually allocated on the stack, representing
|
||||
the result of an asprintf() call. */
|
||||
class autosprintf
|
||||
{
|
||||
public:
|
||||
/* Constructor: takes a format string and the printf arguments. */
|
||||
autosprintf (const char *format, ...)
|
||||
__attribute__ ((__format__ (__printf__, 2, 3)));
|
||||
/* Copy constructor. */
|
||||
autosprintf (const autosprintf& src);
|
||||
/* Destructor: frees the temporarily allocated string. */
|
||||
~autosprintf ();
|
||||
/* Conversion to string. */
|
||||
operator char * () const;
|
||||
operator std::string () const;
|
||||
/* Output to an ostream. */
|
||||
friend inline std::ostream& operator<< (std::ostream& stream, const autosprintf& tmp)
|
||||
{
|
||||
stream << (tmp.str ? tmp.str : "(error in autosprintf)");
|
||||
return stream;
|
||||
}
|
||||
private:
|
||||
char *str;
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* _AUTOSPRINTF_H */
|
||||
@@ -0,0 +1,357 @@
|
||||
/* Public API for GNU gettext PO files - contained in libgettextpo.
|
||||
Copyright (C) 2003-2008, 2010 Free Software Foundation, Inc.
|
||||
Written by Bruno Haible <bruno@clisp.org>, 2003.
|
||||
|
||||
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 3 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, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef _GETTEXT_PO_H
|
||||
#define _GETTEXT_PO_H 1
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* =========================== Meta Information ============================ */
|
||||
|
||||
/* Version number: (major<<16) + (minor<<8) + subminor */
|
||||
#define LIBGETTEXTPO_VERSION 0x001201
|
||||
extern int libgettextpo_version;
|
||||
|
||||
/* ================================= Types ================================= */
|
||||
|
||||
/* A po_file_t represents the contents of a PO file. */
|
||||
typedef struct po_file *po_file_t;
|
||||
|
||||
/* A po_message_iterator_t represents an iterator through a domain of a
|
||||
PO file. */
|
||||
typedef struct po_message_iterator *po_message_iterator_t;
|
||||
|
||||
/* A po_message_t represents a message in a PO file. */
|
||||
typedef struct po_message *po_message_t;
|
||||
|
||||
/* A po_filepos_t represents a string's position within a source file. */
|
||||
typedef struct po_filepos *po_filepos_t;
|
||||
|
||||
/* A po_error_handler handles error situations. */
|
||||
struct po_error_handler
|
||||
{
|
||||
/* Signal an error. The error message is built from FORMAT and the following
|
||||
arguments. ERRNUM, if nonzero, is an errno value.
|
||||
Must increment the error_message_count variable declared in error.h.
|
||||
Must not return if STATUS is nonzero. */
|
||||
void (*error) (int status, int errnum,
|
||||
const char *format, ...)
|
||||
#if ((__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3) && !__STRICT_ANSI__
|
||||
__attribute__ ((__format__ (__printf__, 3, 4)))
|
||||
#endif
|
||||
;
|
||||
|
||||
/* Signal an error. The error message is built from FORMAT and the following
|
||||
arguments. The error location is at FILENAME line LINENO. ERRNUM, if
|
||||
nonzero, is an errno value.
|
||||
Must increment the error_message_count variable declared in error.h.
|
||||
Must not return if STATUS is nonzero. */
|
||||
void (*error_at_line) (int status, int errnum,
|
||||
const char *filename, unsigned int lineno,
|
||||
const char *format, ...)
|
||||
#if ((__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || __GNUC__ > 3) && !__STRICT_ANSI__
|
||||
__attribute__ ((__format__ (__printf__, 5, 6)))
|
||||
#endif
|
||||
;
|
||||
|
||||
/* Signal a multiline warning. The PREFIX applies to all lines of the
|
||||
MESSAGE. Free the PREFIX and MESSAGE when done. */
|
||||
void (*multiline_warning) (char *prefix, char *message);
|
||||
|
||||
/* Signal a multiline error. The PREFIX applies to all lines of the
|
||||
MESSAGE. Free the PREFIX and MESSAGE when done.
|
||||
Must increment the error_message_count variable declared in error.h if
|
||||
PREFIX is non-NULL. */
|
||||
void (*multiline_error) (char *prefix, char *message);
|
||||
};
|
||||
typedef const struct po_error_handler *po_error_handler_t;
|
||||
|
||||
/* A po_xerror_handler handles warnings, error and fatal error situations. */
|
||||
#define PO_SEVERITY_WARNING 0 /* just a warning, tell the user */
|
||||
#define PO_SEVERITY_ERROR 1 /* an error, the operation cannot complete */
|
||||
#define PO_SEVERITY_FATAL_ERROR 2 /* an error, the operation must be aborted */
|
||||
struct po_xerror_handler
|
||||
{
|
||||
/* Signal a problem of the given severity.
|
||||
MESSAGE and/or FILENAME + LINENO indicate where the problem occurred.
|
||||
If FILENAME is NULL, FILENAME and LINENO and COLUMN should be ignored.
|
||||
If LINENO is (size_t)(-1), LINENO and COLUMN should be ignored.
|
||||
If COLUMN is (size_t)(-1), it should be ignored.
|
||||
MESSAGE_TEXT is the problem description (if MULTILINE_P is true,
|
||||
multiple lines of text, each terminated with a newline, otherwise
|
||||
usually a single line).
|
||||
Must not return if SEVERITY is PO_SEVERITY_FATAL_ERROR. */
|
||||
void (*xerror) (int severity,
|
||||
po_message_t message,
|
||||
const char *filename, size_t lineno, size_t column,
|
||||
int multiline_p, const char *message_text);
|
||||
/* Signal a problem that refers to two messages.
|
||||
Similar to two calls to xerror.
|
||||
If possible, a "..." can be appended to MESSAGE_TEXT1 and prepended to
|
||||
MESSAGE_TEXT2. */
|
||||
void (*xerror2) (int severity,
|
||||
po_message_t message1,
|
||||
const char *filename1, size_t lineno1, size_t column1,
|
||||
int multiline_p1, const char *message_text1,
|
||||
po_message_t message2,
|
||||
const char *filename2, size_t lineno2, size_t column2,
|
||||
int multiline_p2, const char *message_text2);
|
||||
};
|
||||
typedef const struct po_xerror_handler *po_xerror_handler_t;
|
||||
|
||||
/* Memory allocation:
|
||||
The memory allocations performed by these functions use xmalloc(),
|
||||
therefore will cause a program exit if memory is exhausted.
|
||||
The memory allocated by po_file_read, and implicitly returned through
|
||||
the po_message_* functions, lasts until freed with po_file_free. */
|
||||
|
||||
|
||||
/* ============================= po_file_t API ============================= */
|
||||
|
||||
/* Create an empty PO file representation in memory. */
|
||||
extern po_file_t po_file_create (void);
|
||||
|
||||
/* Read a PO file into memory.
|
||||
Return its contents. Upon failure, return NULL and set errno. */
|
||||
#define po_file_read po_file_read_v3
|
||||
extern po_file_t po_file_read (const char *filename,
|
||||
po_xerror_handler_t handler);
|
||||
|
||||
/* Write an in-memory PO file to a file.
|
||||
Upon failure, return NULL and set errno. */
|
||||
#define po_file_write po_file_write_v2
|
||||
extern po_file_t po_file_write (po_file_t file, const char *filename,
|
||||
po_xerror_handler_t handler);
|
||||
|
||||
/* Free a PO file from memory. */
|
||||
extern void po_file_free (po_file_t file);
|
||||
|
||||
/* Return the names of the domains covered by a PO file in memory. */
|
||||
extern const char * const * po_file_domains (po_file_t file);
|
||||
|
||||
|
||||
/* =========================== Header entry API ============================ */
|
||||
|
||||
/* Return the header entry of a domain of a PO file in memory.
|
||||
The domain NULL denotes the default domain.
|
||||
Return NULL if there is no header entry. */
|
||||
extern const char * po_file_domain_header (po_file_t file, const char *domain);
|
||||
|
||||
/* Return the value of a field in a header entry.
|
||||
The return value is either a freshly allocated string, to be freed by the
|
||||
caller, or NULL. */
|
||||
extern char * po_header_field (const char *header, const char *field);
|
||||
|
||||
/* Return the header entry with a given field set to a given value. The field
|
||||
is added if necessary.
|
||||
The return value is a freshly allocated string. */
|
||||
extern char * po_header_set_field (const char *header, const char *field, const char *value);
|
||||
|
||||
|
||||
/* ======================= po_message_iterator_t API ======================= */
|
||||
|
||||
/* Create an iterator for traversing a domain of a PO file in memory.
|
||||
The domain NULL denotes the default domain. */
|
||||
extern po_message_iterator_t po_message_iterator (po_file_t file, const char *domain);
|
||||
|
||||
/* Free an iterator. */
|
||||
extern void po_message_iterator_free (po_message_iterator_t iterator);
|
||||
|
||||
/* Return the next message, and advance the iterator.
|
||||
Return NULL at the end of the message list. */
|
||||
extern po_message_t po_next_message (po_message_iterator_t iterator);
|
||||
|
||||
/* Insert a message in a PO file in memory, in the domain and at the position
|
||||
indicated by the iterator. The iterator thereby advances past the freshly
|
||||
inserted message. */
|
||||
extern void po_message_insert (po_message_iterator_t iterator, po_message_t message);
|
||||
|
||||
|
||||
/* =========================== po_message_t API ============================ */
|
||||
|
||||
/* Return a freshly constructed message.
|
||||
To finish initializing the message, you must set the msgid and msgstr. */
|
||||
extern po_message_t po_message_create (void);
|
||||
|
||||
/* Return the context of a message, or NULL for a message not restricted to a
|
||||
context. */
|
||||
extern const char * po_message_msgctxt (po_message_t message);
|
||||
|
||||
/* Change the context of a message. NULL means a message not restricted to a
|
||||
context. */
|
||||
extern void po_message_set_msgctxt (po_message_t message, const char *msgctxt);
|
||||
|
||||
/* Return the msgid (untranslated English string) of a message. */
|
||||
extern const char * po_message_msgid (po_message_t message);
|
||||
|
||||
/* Change the msgid (untranslated English string) of a message. */
|
||||
extern void po_message_set_msgid (po_message_t message, const char *msgid);
|
||||
|
||||
/* Return the msgid_plural (untranslated English plural string) of a message,
|
||||
or NULL for a message without plural. */
|
||||
extern const char * po_message_msgid_plural (po_message_t message);
|
||||
|
||||
/* Change the msgid_plural (untranslated English plural string) of a message.
|
||||
NULL means a message without plural. */
|
||||
extern void po_message_set_msgid_plural (po_message_t message, const char *msgid_plural);
|
||||
|
||||
/* Return the msgstr (translation) of a message.
|
||||
Return the empty string for an untranslated message. */
|
||||
extern const char * po_message_msgstr (po_message_t message);
|
||||
|
||||
/* Change the msgstr (translation) of a message.
|
||||
Use an empty string to denote an untranslated message. */
|
||||
extern void po_message_set_msgstr (po_message_t message, const char *msgstr);
|
||||
|
||||
/* Return the msgstr[index] for a message with plural handling, or
|
||||
NULL when the index is out of range or for a message without plural. */
|
||||
extern const char * po_message_msgstr_plural (po_message_t message, int index);
|
||||
|
||||
/* Change the msgstr[index] for a message with plural handling.
|
||||
Use a NULL value at the end to reduce the number of plural forms. */
|
||||
extern void po_message_set_msgstr_plural (po_message_t message, int index, const char *msgstr);
|
||||
|
||||
/* Return the comments for a message. */
|
||||
extern const char * po_message_comments (po_message_t message);
|
||||
|
||||
/* Change the comments for a message.
|
||||
comments should be a multiline string, ending in a newline, or empty. */
|
||||
extern void po_message_set_comments (po_message_t message, const char *comments);
|
||||
|
||||
/* Return the extracted comments for a message. */
|
||||
extern const char * po_message_extracted_comments (po_message_t message);
|
||||
|
||||
/* Change the extracted comments for a message.
|
||||
comments should be a multiline string, ending in a newline, or empty. */
|
||||
extern void po_message_set_extracted_comments (po_message_t message, const char *comments);
|
||||
|
||||
/* Return the i-th file position for a message, or NULL if i is out of
|
||||
range. */
|
||||
extern po_filepos_t po_message_filepos (po_message_t message, int i);
|
||||
|
||||
/* Remove the i-th file position from a message.
|
||||
The indices of all following file positions for the message are decremented
|
||||
by one. */
|
||||
extern void po_message_remove_filepos (po_message_t message, int i);
|
||||
|
||||
/* Add a file position to a message, if it is not already present for the
|
||||
message.
|
||||
file is the file name.
|
||||
start_line is the line number where the string starts, or (size_t)(-1) if no
|
||||
line number is available. */
|
||||
extern void po_message_add_filepos (po_message_t message, const char *file, size_t start_line);
|
||||
|
||||
/* Return the previous context of a message, or NULL for none. */
|
||||
extern const char * po_message_prev_msgctxt (po_message_t message);
|
||||
|
||||
/* Change the previous context of a message. NULL is allowed. */
|
||||
extern void po_message_set_prev_msgctxt (po_message_t message, const char *prev_msgctxt);
|
||||
|
||||
/* Return the previous msgid (untranslated English string) of a message, or
|
||||
NULL for none. */
|
||||
extern const char * po_message_prev_msgid (po_message_t message);
|
||||
|
||||
/* Change the previous msgid (untranslated English string) of a message.
|
||||
NULL is allowed. */
|
||||
extern void po_message_set_prev_msgid (po_message_t message, const char *prev_msgid);
|
||||
|
||||
/* Return the previous msgid_plural (untranslated English plural string) of a
|
||||
message, or NULL for none. */
|
||||
extern const char * po_message_prev_msgid_plural (po_message_t message);
|
||||
|
||||
/* Change the previous msgid_plural (untranslated English plural string) of a
|
||||
message. NULL is allowed. */
|
||||
extern void po_message_set_prev_msgid_plural (po_message_t message, const char *prev_msgid_plural);
|
||||
|
||||
/* Return true if the message is marked obsolete. */
|
||||
extern int po_message_is_obsolete (po_message_t message);
|
||||
|
||||
/* Change the obsolete mark of a message. */
|
||||
extern void po_message_set_obsolete (po_message_t message, int obsolete);
|
||||
|
||||
/* Return true if the message is marked fuzzy. */
|
||||
extern int po_message_is_fuzzy (po_message_t message);
|
||||
|
||||
/* Change the fuzzy mark of a message. */
|
||||
extern void po_message_set_fuzzy (po_message_t message, int fuzzy);
|
||||
|
||||
/* Return true if the message is marked as being a format string of the given
|
||||
type (e.g. "c-format"). */
|
||||
extern int po_message_is_format (po_message_t message, const char *format_type);
|
||||
|
||||
/* Change the format string mark for a given type of a message. */
|
||||
extern void po_message_set_format (po_message_t message, const char *format_type, /*bool*/int value);
|
||||
|
||||
/* If a numeric range of a message is set, return true and store the minimum
|
||||
and maximum value in *MINP and *MAXP. */
|
||||
extern int po_message_is_range (po_message_t message, int *minp, int *maxp);
|
||||
|
||||
/* Change the numeric range of a message. MIN and MAX must be non-negative,
|
||||
with MIN < MAX. Use MIN = MAX = -1 to remove the numeric range of a
|
||||
message. */
|
||||
extern void po_message_set_range (po_message_t message, int min, int max);
|
||||
|
||||
|
||||
/* =========================== po_filepos_t API ============================ */
|
||||
|
||||
/* Return the file name. */
|
||||
extern const char * po_filepos_file (po_filepos_t filepos);
|
||||
|
||||
/* Return the line number where the string starts, or (size_t)(-1) if no line
|
||||
number is available. */
|
||||
extern size_t po_filepos_start_line (po_filepos_t filepos);
|
||||
|
||||
|
||||
/* ============================ Format type API ============================= */
|
||||
|
||||
/* Return a NULL terminated array of the supported format types. */
|
||||
extern const char * const * po_format_list (void);
|
||||
|
||||
/* Return the pretty name associated with a format type.
|
||||
For example, for "csharp-format", return "C#".
|
||||
Return NULL if the argument is not a supported format type. */
|
||||
extern const char * po_format_pretty_name (const char *format_type);
|
||||
|
||||
|
||||
/* ============================= Checking API ============================== */
|
||||
|
||||
/* Test whether an entire file PO file is valid, like msgfmt does it.
|
||||
If it is invalid, pass the reasons to the handler. */
|
||||
extern void po_file_check_all (po_file_t file, po_xerror_handler_t handler);
|
||||
|
||||
/* Test a single message, to be inserted in a PO file in memory, like msgfmt
|
||||
does it. If it is invalid, pass the reasons to the handler. The iterator
|
||||
is not modified by this call; it only specifies the file and the domain. */
|
||||
extern void po_message_check_all (po_message_t message, po_message_iterator_t iterator, po_xerror_handler_t handler);
|
||||
|
||||
/* Test whether the message translation is a valid format string if the message
|
||||
is marked as being a format string. If it is invalid, pass the reasons to
|
||||
the handler. */
|
||||
#define po_message_check_format po_message_check_format_v2
|
||||
extern void po_message_check_format (po_message_t message, po_xerror_handler_t handler);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _GETTEXT_PO_H */
|
||||
@@ -0,0 +1,464 @@
|
||||
/* Message catalogs for internationalization.
|
||||
Copyright (C) 1995-1997, 2000-2010 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public License as published
|
||||
by the Free Software Foundation; either version 2, 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library 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. */
|
||||
|
||||
#ifndef _LIBINTL_H
|
||||
#define _LIBINTL_H 1
|
||||
|
||||
#include <locale.h>
|
||||
#if (defined __APPLE__ && defined __MACH__) && 0
|
||||
# include <xlocale.h>
|
||||
#endif
|
||||
|
||||
/* The LC_MESSAGES locale category is the category used by the functions
|
||||
gettext() and dgettext(). It is specified in POSIX, but not in ANSI C.
|
||||
On systems that don't define it, use an arbitrary value instead.
|
||||
On Solaris, <locale.h> defines __LOCALE_H (or _LOCALE_H in Solaris 2.5)
|
||||
then includes <libintl.h> (i.e. this file!) and then only defines
|
||||
LC_MESSAGES. To avoid a redefinition warning, don't define LC_MESSAGES
|
||||
in this case. */
|
||||
#if !defined LC_MESSAGES && !(defined __LOCALE_H || (defined _LOCALE_H && defined __sun))
|
||||
# define LC_MESSAGES 1729
|
||||
#endif
|
||||
|
||||
/* We define an additional symbol to signal that we use the GNU
|
||||
implementation of gettext. */
|
||||
#define __USE_GNU_GETTEXT 1
|
||||
|
||||
/* Provide information about the supported file formats. Returns the
|
||||
maximum minor revision number supported for a given major revision. */
|
||||
#define __GNU_GETTEXT_SUPPORTED_REVISION(major) \
|
||||
((major) == 0 || (major) == 1 ? 1 : -1)
|
||||
|
||||
/* Resolve a platform specific conflict on DJGPP. GNU gettext takes
|
||||
precedence over _conio_gettext. */
|
||||
#ifdef __DJGPP__
|
||||
# undef gettext
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* Version number: (major<<16) + (minor<<8) + subminor */
|
||||
#define LIBINTL_VERSION 0x001201
|
||||
extern int libintl_version;
|
||||
|
||||
|
||||
/* We redirect the functions to those prefixed with "libintl_". This is
|
||||
necessary, because some systems define gettext/textdomain/... in the C
|
||||
library (namely, Solaris 2.4 and newer, and GNU libc 2.0 and newer).
|
||||
If we used the unprefixed names, there would be cases where the
|
||||
definition in the C library would override the one in the libintl.so
|
||||
shared library. Recall that on ELF systems, the symbols are looked
|
||||
up in the following order:
|
||||
1. in the executable,
|
||||
2. in the shared libraries specified on the link command line, in order,
|
||||
3. in the dependencies of the shared libraries specified on the link
|
||||
command line,
|
||||
4. in the dlopen()ed shared libraries, in the order in which they were
|
||||
dlopen()ed.
|
||||
The definition in the C library would override the one in libintl.so if
|
||||
either
|
||||
* -lc is given on the link command line and -lintl isn't, or
|
||||
* -lc is given on the link command line before -lintl, or
|
||||
* libintl.so is a dependency of a dlopen()ed shared library but not
|
||||
linked to the executable at link time.
|
||||
Since Solaris gettext() behaves differently than GNU gettext(), this
|
||||
would be unacceptable.
|
||||
|
||||
The redirection happens by default through macros in C, so that &gettext
|
||||
is independent of the compilation unit, but through inline functions in
|
||||
C++, in order not to interfere with the name mangling of class fields or
|
||||
class methods called 'gettext'. */
|
||||
|
||||
/* The user can define _INTL_REDIRECT_INLINE or _INTL_REDIRECT_MACROS.
|
||||
If he doesn't, we choose the method. A third possible method is
|
||||
_INTL_REDIRECT_ASM, supported only by GCC. */
|
||||
#if !(defined _INTL_REDIRECT_INLINE || defined _INTL_REDIRECT_MACROS)
|
||||
# if defined __GNUC__ && __GNUC__ >= 2 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1) && !defined __MINGW32__ && !(__GNUC__ == 2 && defined _AIX) && (defined __STDC__ || defined __cplusplus)
|
||||
# define _INTL_REDIRECT_ASM
|
||||
# else
|
||||
# ifdef __cplusplus
|
||||
# define _INTL_REDIRECT_INLINE
|
||||
# else
|
||||
# define _INTL_REDIRECT_MACROS
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
/* Auxiliary macros. */
|
||||
#ifdef _INTL_REDIRECT_ASM
|
||||
# define _INTL_ASM(cname) __asm__ (_INTL_ASMNAME (__USER_LABEL_PREFIX__, #cname))
|
||||
# define _INTL_ASMNAME(prefix,cnamestring) _INTL_STRINGIFY (prefix) cnamestring
|
||||
# define _INTL_STRINGIFY(prefix) #prefix
|
||||
#else
|
||||
# define _INTL_ASM(cname)
|
||||
#endif
|
||||
|
||||
/* _INTL_MAY_RETURN_STRING_ARG(n) declares that the given function may return
|
||||
its n-th argument literally. This enables GCC to warn for example about
|
||||
printf (gettext ("foo %y")). */
|
||||
#if defined __GNUC__ && __GNUC__ >= 3 && !(defined __APPLE_CC__ && __APPLE_CC__ > 1 && defined __cplusplus)
|
||||
# define _INTL_MAY_RETURN_STRING_ARG(n) __attribute__ ((__format_arg__ (n)))
|
||||
#else
|
||||
# define _INTL_MAY_RETURN_STRING_ARG(n)
|
||||
#endif
|
||||
|
||||
/* Look up MSGID in the current default message catalog for the current
|
||||
LC_MESSAGES locale. If not found, returns MSGID itself (the default
|
||||
text). */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_gettext (const char *__msgid)
|
||||
_INTL_MAY_RETURN_STRING_ARG (1);
|
||||
static inline char *gettext (const char *__msgid)
|
||||
{
|
||||
return libintl_gettext (__msgid);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define gettext libintl_gettext
|
||||
#endif
|
||||
extern char *gettext (const char *__msgid)
|
||||
_INTL_ASM (libintl_gettext)
|
||||
_INTL_MAY_RETURN_STRING_ARG (1);
|
||||
#endif
|
||||
|
||||
/* Look up MSGID in the DOMAINNAME message catalog for the current
|
||||
LC_MESSAGES locale. */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_dgettext (const char *__domainname, const char *__msgid)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2);
|
||||
static inline char *dgettext (const char *__domainname, const char *__msgid)
|
||||
{
|
||||
return libintl_dgettext (__domainname, __msgid);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define dgettext libintl_dgettext
|
||||
#endif
|
||||
extern char *dgettext (const char *__domainname, const char *__msgid)
|
||||
_INTL_ASM (libintl_dgettext)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2);
|
||||
#endif
|
||||
|
||||
/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
|
||||
locale. */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_dcgettext (const char *__domainname, const char *__msgid,
|
||||
int __category)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2);
|
||||
static inline char *dcgettext (const char *__domainname, const char *__msgid,
|
||||
int __category)
|
||||
{
|
||||
return libintl_dcgettext (__domainname, __msgid, __category);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define dcgettext libintl_dcgettext
|
||||
#endif
|
||||
extern char *dcgettext (const char *__domainname, const char *__msgid,
|
||||
int __category)
|
||||
_INTL_ASM (libintl_dcgettext)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2);
|
||||
#endif
|
||||
|
||||
|
||||
/* Similar to `gettext' but select the plural form corresponding to the
|
||||
number N. */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_ngettext (const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n)
|
||||
_INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2);
|
||||
static inline char *ngettext (const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n)
|
||||
{
|
||||
return libintl_ngettext (__msgid1, __msgid2, __n);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define ngettext libintl_ngettext
|
||||
#endif
|
||||
extern char *ngettext (const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n)
|
||||
_INTL_ASM (libintl_ngettext)
|
||||
_INTL_MAY_RETURN_STRING_ARG (1) _INTL_MAY_RETURN_STRING_ARG (2);
|
||||
#endif
|
||||
|
||||
/* Similar to `dgettext' but select the plural form corresponding to the
|
||||
number N. */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_dngettext (const char *__domainname, const char *__msgid1,
|
||||
const char *__msgid2, unsigned long int __n)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
|
||||
static inline char *dngettext (const char *__domainname, const char *__msgid1,
|
||||
const char *__msgid2, unsigned long int __n)
|
||||
{
|
||||
return libintl_dngettext (__domainname, __msgid1, __msgid2, __n);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define dngettext libintl_dngettext
|
||||
#endif
|
||||
extern char *dngettext (const char *__domainname,
|
||||
const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n)
|
||||
_INTL_ASM (libintl_dngettext)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
|
||||
#endif
|
||||
|
||||
/* Similar to `dcgettext' but select the plural form corresponding to the
|
||||
number N. */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_dcngettext (const char *__domainname,
|
||||
const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n, int __category)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
|
||||
static inline char *dcngettext (const char *__domainname,
|
||||
const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n, int __category)
|
||||
{
|
||||
return libintl_dcngettext (__domainname, __msgid1, __msgid2, __n, __category);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define dcngettext libintl_dcngettext
|
||||
#endif
|
||||
extern char *dcngettext (const char *__domainname,
|
||||
const char *__msgid1, const char *__msgid2,
|
||||
unsigned long int __n, int __category)
|
||||
_INTL_ASM (libintl_dcngettext)
|
||||
_INTL_MAY_RETURN_STRING_ARG (2) _INTL_MAY_RETURN_STRING_ARG (3);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Set the current default message catalog to DOMAINNAME.
|
||||
If DOMAINNAME is null, return the current default.
|
||||
If DOMAINNAME is "", reset to the default of "messages". */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_textdomain (const char *__domainname);
|
||||
static inline char *textdomain (const char *__domainname)
|
||||
{
|
||||
return libintl_textdomain (__domainname);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define textdomain libintl_textdomain
|
||||
#endif
|
||||
extern char *textdomain (const char *__domainname)
|
||||
_INTL_ASM (libintl_textdomain);
|
||||
#endif
|
||||
|
||||
/* Specify that the DOMAINNAME message catalog will be found
|
||||
in DIRNAME rather than in the system locale data base. */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_bindtextdomain (const char *__domainname,
|
||||
const char *__dirname);
|
||||
static inline char *bindtextdomain (const char *__domainname,
|
||||
const char *__dirname)
|
||||
{
|
||||
return libintl_bindtextdomain (__domainname, __dirname);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define bindtextdomain libintl_bindtextdomain
|
||||
#endif
|
||||
extern char *bindtextdomain (const char *__domainname, const char *__dirname)
|
||||
_INTL_ASM (libintl_bindtextdomain);
|
||||
#endif
|
||||
|
||||
/* Specify the character encoding in which the messages from the
|
||||
DOMAINNAME message catalog will be returned. */
|
||||
#ifdef _INTL_REDIRECT_INLINE
|
||||
extern char *libintl_bind_textdomain_codeset (const char *__domainname,
|
||||
const char *__codeset);
|
||||
static inline char *bind_textdomain_codeset (const char *__domainname,
|
||||
const char *__codeset)
|
||||
{
|
||||
return libintl_bind_textdomain_codeset (__domainname, __codeset);
|
||||
}
|
||||
#else
|
||||
#ifdef _INTL_REDIRECT_MACROS
|
||||
# define bind_textdomain_codeset libintl_bind_textdomain_codeset
|
||||
#endif
|
||||
extern char *bind_textdomain_codeset (const char *__domainname,
|
||||
const char *__codeset)
|
||||
_INTL_ASM (libintl_bind_textdomain_codeset);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Support for format strings with positions in *printf(), following the
|
||||
POSIX/XSI specification.
|
||||
Note: These replacements for the *printf() functions are visible only
|
||||
in source files that #include <libintl.h> or #include "gettext.h".
|
||||
Packages that use *printf() in source files that don't refer to _()
|
||||
or gettext() but for which the format string could be the return value
|
||||
of _() or gettext() need to add this #include. Oh well. */
|
||||
|
||||
#if !0
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stddef.h>
|
||||
|
||||
/* Get va_list. */
|
||||
#if (defined __STDC__ && __STDC__) || defined __cplusplus || defined _MSC_VER
|
||||
# include <stdarg.h>
|
||||
#else
|
||||
# include <varargs.h>
|
||||
#endif
|
||||
|
||||
#if !(defined fprintf && defined _GL_STDIO_H) /* don't override gnulib */
|
||||
#undef fprintf
|
||||
#define fprintf libintl_fprintf
|
||||
extern int fprintf (FILE *, const char *, ...);
|
||||
#endif
|
||||
#if !(defined vfprintf && defined _GL_STDIO_H) /* don't override gnulib */
|
||||
#undef vfprintf
|
||||
#define vfprintf libintl_vfprintf
|
||||
extern int vfprintf (FILE *, const char *, va_list);
|
||||
#endif
|
||||
|
||||
#if !(defined printf && defined _GL_STDIO_H) /* don't override gnulib */
|
||||
#undef printf
|
||||
#if defined __NetBSD__ || defined __BEOS__ || defined __CYGWIN__ || defined __MINGW32__
|
||||
/* Don't break __attribute__((format(printf,M,N))).
|
||||
This redefinition is only possible because the libc in NetBSD, Cygwin,
|
||||
mingw does not have a function __printf__.
|
||||
Alternatively, we could have done this redirection only when compiling with
|
||||
__GNUC__, together with a symbol redirection:
|
||||
extern int printf (const char *, ...)
|
||||
__asm__ (#__USER_LABEL_PREFIX__ "libintl_printf");
|
||||
But doing it now would introduce a binary incompatibility with already
|
||||
distributed versions of libintl on these systems. */
|
||||
# define libintl_printf __printf__
|
||||
#endif
|
||||
#define printf libintl_printf
|
||||
extern int printf (const char *, ...);
|
||||
#endif
|
||||
#if !(defined vprintf && defined _GL_STDIO_H) /* don't override gnulib */
|
||||
#undef vprintf
|
||||
#define vprintf libintl_vprintf
|
||||
extern int vprintf (const char *, va_list);
|
||||
#endif
|
||||
|
||||
#if !(defined sprintf && defined _GL_STDIO_H) /* don't override gnulib */
|
||||
#undef sprintf
|
||||
#define sprintf libintl_sprintf
|
||||
extern int sprintf (char *, const char *, ...);
|
||||
#endif
|
||||
#if !(defined vsprintf && defined _GL_STDIO_H) /* don't override gnulib */
|
||||
#undef vsprintf
|
||||
#define vsprintf libintl_vsprintf
|
||||
extern int vsprintf (char *, const char *, va_list);
|
||||
#endif
|
||||
|
||||
#if 1
|
||||
|
||||
#if !(defined snprintf && defined _GL_STDIO_H) /* don't override gnulib */
|
||||
#undef snprintf
|
||||
#define snprintf libintl_snprintf
|
||||
extern int snprintf (char *, size_t, const char *, ...);
|
||||
#endif
|
||||
#if !(defined vsnprintf && defined _GL_STDIO_H) /* don't override gnulib */
|
||||
#undef vsnprintf
|
||||
#define vsnprintf libintl_vsnprintf
|
||||
extern int vsnprintf (char *, size_t, const char *, va_list);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
|
||||
#if !(defined asprintf && defined _GL_STDIO_H) /* don't override gnulib */
|
||||
#undef asprintf
|
||||
#define asprintf libintl_asprintf
|
||||
extern int asprintf (char **, const char *, ...);
|
||||
#endif
|
||||
#if !(defined vasprintf && defined _GL_STDIO_H) /* don't override gnulib */
|
||||
#undef vasprintf
|
||||
#define vasprintf libintl_vasprintf
|
||||
extern int vasprintf (char **, const char *, va_list);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
|
||||
#undef fwprintf
|
||||
#define fwprintf libintl_fwprintf
|
||||
extern int fwprintf (FILE *, const wchar_t *, ...);
|
||||
#undef vfwprintf
|
||||
#define vfwprintf libintl_vfwprintf
|
||||
extern int vfwprintf (FILE *, const wchar_t *, va_list);
|
||||
|
||||
#undef wprintf
|
||||
#define wprintf libintl_wprintf
|
||||
extern int wprintf (const wchar_t *, ...);
|
||||
#undef vwprintf
|
||||
#define vwprintf libintl_vwprintf
|
||||
extern int vwprintf (const wchar_t *, va_list);
|
||||
|
||||
#undef swprintf
|
||||
#define swprintf libintl_swprintf
|
||||
extern int swprintf (wchar_t *, size_t, const wchar_t *, ...);
|
||||
#undef vswprintf
|
||||
#define vswprintf libintl_vswprintf
|
||||
extern int vswprintf (wchar_t *, size_t, const wchar_t *, va_list);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* Support for the locale chosen by the user. */
|
||||
#if (defined __APPLE__ && defined __MACH__) || defined _WIN32 || defined __WIN32__ || defined __CYGWIN__
|
||||
|
||||
#undef setlocale
|
||||
#define setlocale libintl_setlocale
|
||||
extern char *setlocale (int, const char *);
|
||||
|
||||
#if 0
|
||||
|
||||
#undef newlocale
|
||||
#define newlocale libintl_newlocale
|
||||
extern locale_t newlocale (int, const char *, locale_t);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/* Support for relocatable packages. */
|
||||
|
||||
/* Sets the original and the current installation prefix of the package.
|
||||
Relocation simply replaces a pathname starting with the original prefix
|
||||
by the corresponding pathname with the current prefix instead. Both
|
||||
prefixes should be directory names without trailing slash (i.e. use ""
|
||||
instead of "/"). */
|
||||
#define libintl_set_relocation_prefix libintl_set_relocation_prefix
|
||||
extern void
|
||||
libintl_set_relocation_prefix (const char *orig_prefix,
|
||||
const char *curr_prefix);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* libintl.h */
|
||||
Binary file not shown.
Executable
+86
@@ -0,0 +1,86 @@
|
||||
#!/bin/sh
|
||||
# Prints a package's identification PACKAGE VERSION or PACKAGE.
|
||||
#
|
||||
# Copyright (C) 2001-2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
want_version="$1"
|
||||
|
||||
# NLS nuisances: Letter ranges are different in the Estonian locale.
|
||||
LC_ALL=C
|
||||
|
||||
while true; do
|
||||
if test -f configure; then
|
||||
package=`(grep '^PACKAGE_NAME=' configure; grep '^ *PACKAGE=' configure) | grep -v '=[ ]*$' | sed -e '1q' | sed -e 's/^[^=]*=//' | sed -e "s/^'//" -e "s/'$//"`
|
||||
case "$package" in
|
||||
*[\"\$\`\{\}]*)
|
||||
# Some packages (gcal) retrieve the package name dynamically.
|
||||
package=
|
||||
;;
|
||||
esac
|
||||
if test -n "$package"; then
|
||||
is_gnu=`LC_ALL=C grep "GNU $package" * 2>/dev/null | grep -v '^libtool:'`
|
||||
if test -n "$is_gnu"; then
|
||||
package="GNU $package"
|
||||
fi
|
||||
if test -n "$want_version"; then
|
||||
version=`(grep '^PACKAGE_VERSION=' configure; grep '^ *VERSION=' configure) | grep -v '=[ ]*$' | sed -e '1q' | sed -e 's/^[^=]*=//' | sed -e "s/^'//" -e "s/'$//"`
|
||||
case "$version" in
|
||||
*[\"\$\`\{\}]*)
|
||||
# Some packages (gcal, gcc, clisp) retrieve the version dynamically.
|
||||
version=
|
||||
;;
|
||||
esac
|
||||
if test -n "$version"; then
|
||||
echo "$package $version"
|
||||
else
|
||||
echo "$package"
|
||||
fi
|
||||
else
|
||||
echo "$package"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
dir=`basename \`pwd\``
|
||||
case "$dir" in
|
||||
i18n)
|
||||
# This directory name, used in GNU make, is not the top level directory.
|
||||
;;
|
||||
*[A-Za-z]*[0-9]*)
|
||||
package=`echo "$dir" | sed -e 's/^\([^0-9]*\)[0-9].*$/\1/' -e 's/[-_]$//'`
|
||||
if test -n "$want_version"; then
|
||||
version=`echo "$dir" | sed -e 's/^[^0-9]*\([0-9].*\)$/\1/'`
|
||||
echo "$package $version"
|
||||
else
|
||||
echo "$package"
|
||||
fi
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
# Go to parent directory
|
||||
last=`/bin/pwd`
|
||||
cd ..
|
||||
curr=`/bin/pwd`
|
||||
if test "$last" = "$curr"; then
|
||||
# Oops, didn't find the package name.
|
||||
if test -n "$want_version"; then
|
||||
echo "PACKAGE VERSION"
|
||||
else
|
||||
echo "PACKAGE"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
Binary file not shown.
Executable
+436
@@ -0,0 +1,436 @@
|
||||
#!/bin/sh
|
||||
# Prints the user's email address, with confirmation from the user.
|
||||
#
|
||||
# Copyright (C) 2001-2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Prerequisites for using ${exec_prefix}/lib and ${datarootdir}/locale.
|
||||
prefix="/usr/local/i686-w64-mingw32/stow/gettext-0.18.1.1"
|
||||
exec_prefix="${prefix}"
|
||||
datarootdir="${prefix}/share"
|
||||
datadir="${datarootdir}"
|
||||
# Set variables libdir, localedir.
|
||||
libdir="${exec_prefix}/lib"
|
||||
localedir="${datarootdir}/locale"
|
||||
|
||||
# Support for relocatability.
|
||||
if test "no" = yes; then
|
||||
orig_installdir="$libdir"/gettext # see Makefile.am's install rule
|
||||
# Determine curr_installdir without caring for symlinked callers.
|
||||
curr_installdir=`echo "$0" | sed -e 's,/[^/]*$,,'`
|
||||
curr_installdir=`cd "$curr_installdir" && pwd`
|
||||
# Compute the original/current installation prefixes by stripping the
|
||||
# trailing directories off the original/current installation directories.
|
||||
while true; do
|
||||
orig_last=`echo "$orig_installdir" | sed -n -e 's,^.*/\([^/]*\)$,\1,p'`
|
||||
curr_last=`echo "$curr_installdir" | sed -n -e 's,^.*/\([^/]*\)$,\1,p'`
|
||||
if test -z "$orig_last" || test -z "$curr_last"; then
|
||||
break
|
||||
fi
|
||||
if test "$orig_last" != "$curr_last"; then
|
||||
break
|
||||
fi
|
||||
orig_installdir=`echo "$orig_installdir" | sed -e 's,/[^/]*$,,'`
|
||||
curr_installdir=`echo "$curr_installdir" | sed -e 's,/[^/]*$,,'`
|
||||
done
|
||||
# Now relocate the directory variables that we use.
|
||||
libdir=`echo "$libdir/" | sed -e "s%^${orig_installdir}/%${curr_installdir}/%" | sed -e 's,/$,,'`
|
||||
localedir=`echo "$localedir/" | sed -e "s%^${orig_installdir}/%${curr_installdir}/%" | sed -e 's,/$,,'`
|
||||
fi
|
||||
|
||||
# Internationalization.
|
||||
. gettext.sh
|
||||
TEXTDOMAIN=gettext-tools
|
||||
export TEXTDOMAIN
|
||||
TEXTDOMAINDIR="$localedir"
|
||||
export TEXTDOMAINDIR
|
||||
|
||||
# Redirect fileno 3 to interactive I/O.
|
||||
exec 3>/dev/tty
|
||||
|
||||
# Output a prompt.
|
||||
if test $# != 0; then
|
||||
echo "$1" 1>&3
|
||||
fi
|
||||
|
||||
# Find the user name on the local machine.
|
||||
user=`id -u -n 2>/dev/null`
|
||||
if test -z "$user"; then
|
||||
user="$USER"
|
||||
if test -z "$user"; then
|
||||
user="$LOGNAME"
|
||||
if test -z "$user"; then
|
||||
user=unknown
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Find the hostname.
|
||||
# hostname on some systems (SVR3.2, old Linux) returns a bogus exit status,
|
||||
# so uname gets run too, so we keep only the first line of output.
|
||||
#host=`(hostname || uname -n) 2>/dev/null | sed 1q`
|
||||
host=`"$libdir"/gettext/hostname --short 2>/dev/null | sed 1q`
|
||||
|
||||
# Find the hostname.
|
||||
hostfqdn=`"$libdir"/gettext/hostname --fqdn 2>/dev/null | sed 1q`
|
||||
|
||||
# Find a list of email addresses from various mailer configuration files.
|
||||
# All mailers use configuration files under $HOME. We handle them in a
|
||||
# last-modified - first-priority order.
|
||||
cd $HOME
|
||||
files=""
|
||||
|
||||
# ----------------------- BEGIN MAILER SPECIFIC CODE -----------------------
|
||||
|
||||
# Mozilla Thunderbird addresses
|
||||
files="$files .thunderbird/*/prefs.js"
|
||||
|
||||
# Mozilla addresses
|
||||
files="$files .mozilla/*/prefs.js"
|
||||
|
||||
# Netscape 4 addresses
|
||||
files="$files .netscape/liprefs.js .netscape/preferences.js"
|
||||
|
||||
# Netscape 3 addresses
|
||||
files="$files .netscape/preferences"
|
||||
|
||||
# Emacs/XEmacs rmail, Emacs/XEmacs gnus, XEmacs vm addresses
|
||||
# XEmacs mew addresses
|
||||
files="$files .emacs .emacs.el"
|
||||
|
||||
# KDE2 addresses
|
||||
files="$files .kde2/share/config/emaildefaults"
|
||||
|
||||
# KDE kmail addresses
|
||||
files="$files .kde2/share/config/kmailrc"
|
||||
|
||||
# GNOME evolution 2 addresses
|
||||
files="$files .gconf/apps/evolution/mail/%gconf.xml"
|
||||
|
||||
# GNOME evolution 1 addresses
|
||||
files="$files evolution/config.xmldb"
|
||||
|
||||
# GNOME balsa addresses
|
||||
files="$files .gnome/balsa"
|
||||
|
||||
# StarOffice and OpenOffice addresses
|
||||
sed_dos2unix='s/\r$//'
|
||||
sed_soffice51='s,StarOffice 5\.1=\(.*\)$,\1/sofficerc,p'
|
||||
sed_soffice52='s,StarOffice 5\.2=\(.*\)$,\1/user/sofficerc,p'
|
||||
sed_ooffice='s,^OpenOffice[^=]*=\(.*\)$,\1/user/config/registry/instance/org/openoffice/UserProfile.xml,p'
|
||||
files="$files Office51/sofficerc Office52/user/sofficerc "`sed -n -e "$sed_dos2unix" -e "$sed_soffice51" -e "$sed_soffice52" -e "$sed_ooffice" .sversionrc 2>/dev/null | sed -e 's,^file://*,/,'`
|
||||
|
||||
# mutt addresses
|
||||
files="$files .muttrc"
|
||||
|
||||
# pine addresses
|
||||
files="$files .pinerc"
|
||||
|
||||
# xfmail addresses
|
||||
files="$files .xfmail/.xfmailrc"
|
||||
|
||||
# tkrat addresses
|
||||
files="$files .ratatosk/ratatoskrc"
|
||||
|
||||
# ----------------------- END MAILER SPECIFIC CODE -----------------------
|
||||
|
||||
# Expand wildcards and remove nonexistent files from the list.
|
||||
nfiles=""
|
||||
for file in $files; do
|
||||
if test -r "$file" && test ! -d "$file"; then
|
||||
nfiles="$nfiles $file"
|
||||
fi
|
||||
done
|
||||
files="$nfiles"
|
||||
|
||||
addresses=""
|
||||
|
||||
if test -n "$files"; then
|
||||
|
||||
for file in `ls -t $files`; do
|
||||
|
||||
case "$file" in
|
||||
|
||||
# ----------------------- BEGIN MAILER SPECIFIC CODE -----------------------
|
||||
|
||||
# Mozilla and Mozilla Thunderbird addresses
|
||||
.mozilla/*/prefs.js | .thunderbird/*/prefs.js)
|
||||
addresses="$addresses "`grep -h '^user_pref("mail\.identity\..*\.useremail", ".*");$' $file 2>/dev/null | sed -e 's/^user_pref("mail\.identity\..*\.useremail", "\(.*\)");$/\1/'`
|
||||
;;
|
||||
|
||||
# Netscape 4 addresses
|
||||
.netscape/liprefs.js | .netscape/preferences.js)
|
||||
addresses="$addresses "`grep -h '^user_pref("mail\.identity\.useremail", ".*");$' $file 2>/dev/null | sed -e 's/^user_pref("mail\.identity\.useremail", "\(.*\)");$/\1/'`
|
||||
;;
|
||||
|
||||
# Netscape 3 addresses
|
||||
.netscape/preferences)
|
||||
addresses="$addresses "`grep -h '^EMAIL_ADDRESS:' $file 2>/dev/null | sed -e 's/^EMAIL_ADDRESS:[ ]*//'`
|
||||
;;
|
||||
|
||||
.emacs | .emacs.el)
|
||||
# Emacs/XEmacs rmail, Emacs/XEmacs gnus, XEmacs vm addresses
|
||||
addresses="$addresses "`grep -h '[ (]user-mail-address "[^"]*"' $file 2>/dev/null | sed -e 's/^.*[ (]user-mail-address "\([^"]*\)".*$/\1/'`
|
||||
# XEmacs mew addresses
|
||||
domains=`grep -h '[ (]mew-mail-domain "[^"]*"' $file 2>/dev/null | sed -e 's/^.*[ (]mew-mail-domain "\([^"]*\)".*$/\1/'`
|
||||
if test -n "$domains"; then
|
||||
for domain in $domains; do
|
||||
addresses="$addresses ${user}@$domain"
|
||||
done
|
||||
fi
|
||||
;;
|
||||
|
||||
# KDE2 addresses
|
||||
.kde2/share/config/emaildefaults)
|
||||
addresses="$addresses "`grep -h '^EmailAddress=' $file 2>/dev/null | sed -e 's/^EmailAddress=//'`
|
||||
;;
|
||||
|
||||
# KDE kmail addresses
|
||||
.kde2/share/config/kmailrc)
|
||||
addresses="$addresses "`grep -h '^Email Address=' $file 2>/dev/null | sed -e 's/^Email Address=//'`
|
||||
;;
|
||||
|
||||
# GNOME evolution 2 addresses
|
||||
.gconf/apps/evolution/mail/%gconf.xml)
|
||||
sedexpr0='s,^.*<addr-spec>\(.*\)</addr-spec>.*$,\1,p'
|
||||
addresses="$addresses "`sed -n -e "$sedexpr0" < $file`
|
||||
;;
|
||||
|
||||
# GNOME evolution 1 addresses
|
||||
evolution/config.xmldb)
|
||||
sedexpr0='s/^.*<entry name="identity_address_[0-9]*" type="string" value="\([^"]*\)".*$/\1/p'
|
||||
sedexpr1='s/\(..\)/\\x\1/g'
|
||||
sedexpr2='s,$,\\n,'
|
||||
addresses="$addresses "`sed -n -e "$sedexpr0" < $file | while read hexstring; do printf \`echo "$hexstring" | sed -e "$sedexpr1" -e "$sedexpr2"\`; done`
|
||||
;;
|
||||
|
||||
# GNOME balsa addresses
|
||||
.gnome/balsa)
|
||||
addresses="$addresses "`grep -h '^Address=' $file 2>/dev/null | sed -e 's/^Address=//'`
|
||||
;;
|
||||
|
||||
# OpenOffice addresses
|
||||
*/UserProfile.xml)
|
||||
addresses="$addresses "`sed -n -e 's,^.*<mail cfg:type="string">\(.*\)</mail>.*$,\1,p' $file 2>/dev/null`
|
||||
;;
|
||||
|
||||
# StarOffice addresses
|
||||
# Not a typo. They really write "Adress" with a single d.
|
||||
# German orthography...
|
||||
*/sofficerc)
|
||||
addresses="$addresses "`grep -h '^User-Adress=' $file 2>/dev/null | sed -e 's/#[^#]*$//' -e 's/^.*#//'`
|
||||
;;
|
||||
|
||||
# mutt addresses
|
||||
.muttrc)
|
||||
mutt_addresses=`grep -h '^set from="[^"]*"[ ]*$' $file 2>/dev/null | sed -e 's/^set from="\([^"]*\)"[ ]*$/\1/'`
|
||||
if test -n "$mutt_addresses"; then
|
||||
addresses="$addresses $mutt_addresses"
|
||||
else
|
||||
# mutt uses $EMAIL as fallback.
|
||||
if test -n "$EMAIL"; then
|
||||
addresses="$addresses $EMAIL"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
# pine addresses
|
||||
.pinerc)
|
||||
domains=`grep -h '^user-domain=' $file 2>/dev/null | sed -e 's/^user-domain=//'`
|
||||
if test -n "$domains"; then
|
||||
for domain in $domains; do
|
||||
addresses="$addresses ${user}@$domain"
|
||||
done
|
||||
else
|
||||
# The use-only-domain-name option is only used if the user-domain option is not present.
|
||||
domains=`grep -h '^use-only-domain-name=' $file 2>/dev/null | sed -e 's/^use-only-domain-name=//'`
|
||||
if test "Yes" = "$domains"; then
|
||||
addresses="$addresses ${user}@"`echo "$hostfqdn" | sed -e 's/^[^.]*\.//'`
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
# xfmail addresses
|
||||
.xfmail/.xfmailrc)
|
||||
addresses="$addresses "`grep -h '^from=.*<.*>' $file 2>/dev/null | sed -e 's/^.*<\([^<>]*\)>.*$/\1/'`
|
||||
;;
|
||||
|
||||
# tkrat addresses
|
||||
.ratatosk/ratatoskrc)
|
||||
domains=`grep -h '^set option(masquerade_as) ' $file 2>/dev/null | sed -e 's/^set option(masquerade_as) //'`
|
||||
if test -n "$domains"; then
|
||||
for domain in $domains; do
|
||||
addresses="$addresses ${user}@$domain"
|
||||
done
|
||||
else
|
||||
# The domain option is used only if the masquerade_as option is not present.
|
||||
domains=`grep -h '^set option(domain) ' $file 2>/dev/null | sed -e 's/^set option(domain) //'`
|
||||
if test -n "$domains"; then
|
||||
for domain in $domains; do
|
||||
addresses="$addresses ${user}@${host}.$domain"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
# ----------------------- END MAILER SPECIFIC CODE -----------------------
|
||||
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
# Some Debian systems have a file /etc/mailname.
|
||||
if test -r /etc/mailname; then
|
||||
hostmailname=`cat /etc/mailname`
|
||||
if test -n "$hostmailname"; then
|
||||
addresses="$addresses ${user}@$hostmailname"
|
||||
fi
|
||||
fi
|
||||
|
||||
# SuSE Linux >= 8.0 systems have a file /etc/sysconfig/mail.
|
||||
if test -r /etc/sysconfig/mail; then
|
||||
hostmailname=`. /etc/sysconfig/mail && echo "$FROM_HEADER"`
|
||||
if test -n "$hostmailname"; then
|
||||
addresses="$addresses ${user}@$hostmailname"
|
||||
fi
|
||||
fi
|
||||
|
||||
# elm has no user-defined addresses.
|
||||
# mailx has no user-defined addresses.
|
||||
# mh has no user-defined addresses.
|
||||
# They use the system default.
|
||||
addresses="$addresses ${user}@$hostfqdn"
|
||||
|
||||
# Normalize addresses: remove addresses without @, lowercase the part after @,
|
||||
# and remove duplicates.
|
||||
lowercase_sed='{
|
||||
h
|
||||
s/^[^@]*@\(.*\)$/\1/
|
||||
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
|
||||
x
|
||||
s/^\([^@]*\)@.*/\1@/
|
||||
G
|
||||
s/\
|
||||
//
|
||||
p
|
||||
}'
|
||||
naddresses=""
|
||||
for addr in $addresses; do
|
||||
case "$addr" in
|
||||
"<"*">") addr=`echo "$addr" | sed -e 's/^<//' -e 's/>$//'` ;;
|
||||
esac
|
||||
case "$addr" in
|
||||
*@*)
|
||||
addr=`echo "$addr" | sed -n -e "$lowercase_sed"`
|
||||
case " $naddresses " in
|
||||
*" $addr "*) ;;
|
||||
*) naddresses="$naddresses $addr" ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
done
|
||||
addresses="$naddresses"
|
||||
|
||||
# Now it's time to ask the user.
|
||||
case "$addresses" in
|
||||
" "*" "*)
|
||||
# At least two addresses.
|
||||
lines=""
|
||||
i=0
|
||||
for addr in $addresses; do
|
||||
i=`expr $i + 1`
|
||||
lines="${lines}${i} ${addr}
|
||||
"
|
||||
done
|
||||
while true; do
|
||||
{ gettext "Which is your email address?"; echo; } 1>&3
|
||||
echo "$lines" 1>&3
|
||||
{ gettext "Please choose the number, or enter your email address."; echo; } 1>&3
|
||||
read answer < /dev/tty
|
||||
case "$answer" in
|
||||
*@*) ;;
|
||||
[0-9]*)
|
||||
i=0
|
||||
for addr in $addresses; do
|
||||
i=`expr $i + 1`
|
||||
if test "$i" = "$answer"; then
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
case "$answer" in
|
||||
"<"*">") answer=`echo "$answer" | sed -e 's/^<//' -e 's/>$//'` ;;
|
||||
esac
|
||||
case "$answer" in
|
||||
*" "*) { gettext "Invalid email address: invalid character."; echo; echo; } 1>&3 ; continue ;;
|
||||
*@*.*) ;;
|
||||
*@*) { gettext "Invalid email address: need a fully qualified host name or domain name."; echo; echo; } 1>&3 ; continue ;;
|
||||
*) { gettext "Invalid email address: missing @"; echo; echo; } 1>&3 ; continue ;;
|
||||
esac
|
||||
addr=`echo "$answer" | sed -n -e "$lowercase_sed"`
|
||||
break
|
||||
done
|
||||
;;
|
||||
" "*)
|
||||
# One address.
|
||||
while true; do
|
||||
{ gettext "Is the following your email address?"; echo; } 1>&3
|
||||
echo " $addresses" 1>&3
|
||||
{ gettext "Please confirm by pressing Return, or enter your email address."; echo; } 1>&3
|
||||
read answer < /dev/tty
|
||||
if test -z "$answer"; then
|
||||
addr=`echo "$addresses" | sed -e 's/^ //'`
|
||||
break
|
||||
fi
|
||||
case "$answer" in
|
||||
"<"*">") answer=`echo "$answer" | sed -e 's/^<//' -e 's/>$//'` ;;
|
||||
esac
|
||||
case "$answer" in
|
||||
*" "*) { gettext "Invalid email address: invalid character."; echo; echo; } 1>&3 ; continue ;;
|
||||
*@*.*) ;;
|
||||
*@*) { gettext "Invalid email address: need a fully qualified host name or domain name."; echo; echo; } 1>&3 ; continue ;;
|
||||
*) { gettext "Invalid email address: missing @"; echo; echo; } 1>&3 ; continue ;;
|
||||
esac
|
||||
addr=`echo "$answer" | sed -n -e "$lowercase_sed"`
|
||||
break
|
||||
done
|
||||
;;
|
||||
"")
|
||||
# No address.
|
||||
{ gettext "Couldn't find out about your email address."; echo; } 1>&3
|
||||
while true; do
|
||||
{ gettext "Please enter your email address."; echo; } 1>&3
|
||||
read answer < /dev/tty
|
||||
case "$answer" in
|
||||
"<"*">") answer=`echo "$answer" | sed -e 's/^<//' -e 's/>$//'` ;;
|
||||
esac
|
||||
case "$answer" in
|
||||
*" "*) { gettext "Invalid email address: invalid character."; echo; echo; } 1>&3 ; continue ;;
|
||||
*@*.*) ;;
|
||||
*@*) { gettext "Invalid email address: need a fully qualified host name or domain name."; echo; echo; } 1>&3 ; continue ;;
|
||||
*) { gettext "Invalid email address: missing @"; echo; echo; } 1>&3 ; continue ;;
|
||||
esac
|
||||
addr=`echo "$answer" | sed -n -e "$lowercase_sed"`
|
||||
break
|
||||
done
|
||||
;;
|
||||
*) echo "internal error" 1>&3 ; exit 1 ;;
|
||||
esac
|
||||
|
||||
# Print to standard output.
|
||||
echo "$addr"
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Executable
+86
@@ -0,0 +1,86 @@
|
||||
#!/bin/sh
|
||||
# Prints a package's identification PACKAGE VERSION or PACKAGE.
|
||||
#
|
||||
# Copyright (C) 2001-2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
want_version="$1"
|
||||
|
||||
# NLS nuisances: Letter ranges are different in the Estonian locale.
|
||||
LC_ALL=C
|
||||
|
||||
while true; do
|
||||
if test -f configure; then
|
||||
package=`(grep '^PACKAGE_NAME=' configure; grep '^ *PACKAGE=' configure) | grep -v '=[ ]*$' | sed -e '1q' | sed -e 's/^[^=]*=//' | sed -e "s/^'//" -e "s/'$//"`
|
||||
case "$package" in
|
||||
*[\"\$\`\{\}]*)
|
||||
# Some packages (gcal) retrieve the package name dynamically.
|
||||
package=
|
||||
;;
|
||||
esac
|
||||
if test -n "$package"; then
|
||||
is_gnu=`LC_ALL=C grep "GNU $package" * 2>/dev/null | grep -v '^libtool:'`
|
||||
if test -n "$is_gnu"; then
|
||||
package="GNU $package"
|
||||
fi
|
||||
if test -n "$want_version"; then
|
||||
version=`(grep '^PACKAGE_VERSION=' configure; grep '^ *VERSION=' configure) | grep -v '=[ ]*$' | sed -e '1q' | sed -e 's/^[^=]*=//' | sed -e "s/^'//" -e "s/'$//"`
|
||||
case "$version" in
|
||||
*[\"\$\`\{\}]*)
|
||||
# Some packages (gcal, gcc, clisp) retrieve the version dynamically.
|
||||
version=
|
||||
;;
|
||||
esac
|
||||
if test -n "$version"; then
|
||||
echo "$package $version"
|
||||
else
|
||||
echo "$package"
|
||||
fi
|
||||
else
|
||||
echo "$package"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
dir=`basename \`pwd\``
|
||||
case "$dir" in
|
||||
i18n)
|
||||
# This directory name, used in GNU make, is not the top level directory.
|
||||
;;
|
||||
*[A-Za-z]*[0-9]*)
|
||||
package=`echo "$dir" | sed -e 's/^\([^0-9]*\)[0-9].*$/\1/' -e 's/[-_]$//'`
|
||||
if test -n "$want_version"; then
|
||||
version=`echo "$dir" | sed -e 's/^[^0-9]*\([0-9].*\)$/\1/'`
|
||||
echo "$package $version"
|
||||
else
|
||||
echo "$package"
|
||||
fi
|
||||
exit 0
|
||||
;;
|
||||
esac
|
||||
# Go to parent directory
|
||||
last=`/bin/pwd`
|
||||
cd ..
|
||||
curr=`/bin/pwd`
|
||||
if test "$last" = "$curr"; then
|
||||
# Oops, didn't find the package name.
|
||||
if test -n "$want_version"; then
|
||||
echo "PACKAGE VERSION"
|
||||
else
|
||||
echo "PACKAGE"
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
Binary file not shown.
Executable
+436
@@ -0,0 +1,436 @@
|
||||
#!/bin/sh
|
||||
# Prints the user's email address, with confirmation from the user.
|
||||
#
|
||||
# Copyright (C) 2001-2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# 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 3 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, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# Prerequisites for using ${exec_prefix}/lib and ${datarootdir}/locale.
|
||||
prefix="/usr/local/x86_64-w64-mingw32/stow/gettext-0.18.1.1"
|
||||
exec_prefix="${prefix}"
|
||||
datarootdir="${prefix}/share"
|
||||
datadir="${datarootdir}"
|
||||
# Set variables libdir, localedir.
|
||||
libdir="${exec_prefix}/lib"
|
||||
localedir="${datarootdir}/locale"
|
||||
|
||||
# Support for relocatability.
|
||||
if test "no" = yes; then
|
||||
orig_installdir="$libdir"/gettext # see Makefile.am's install rule
|
||||
# Determine curr_installdir without caring for symlinked callers.
|
||||
curr_installdir=`echo "$0" | sed -e 's,/[^/]*$,,'`
|
||||
curr_installdir=`cd "$curr_installdir" && pwd`
|
||||
# Compute the original/current installation prefixes by stripping the
|
||||
# trailing directories off the original/current installation directories.
|
||||
while true; do
|
||||
orig_last=`echo "$orig_installdir" | sed -n -e 's,^.*/\([^/]*\)$,\1,p'`
|
||||
curr_last=`echo "$curr_installdir" | sed -n -e 's,^.*/\([^/]*\)$,\1,p'`
|
||||
if test -z "$orig_last" || test -z "$curr_last"; then
|
||||
break
|
||||
fi
|
||||
if test "$orig_last" != "$curr_last"; then
|
||||
break
|
||||
fi
|
||||
orig_installdir=`echo "$orig_installdir" | sed -e 's,/[^/]*$,,'`
|
||||
curr_installdir=`echo "$curr_installdir" | sed -e 's,/[^/]*$,,'`
|
||||
done
|
||||
# Now relocate the directory variables that we use.
|
||||
libdir=`echo "$libdir/" | sed -e "s%^${orig_installdir}/%${curr_installdir}/%" | sed -e 's,/$,,'`
|
||||
localedir=`echo "$localedir/" | sed -e "s%^${orig_installdir}/%${curr_installdir}/%" | sed -e 's,/$,,'`
|
||||
fi
|
||||
|
||||
# Internationalization.
|
||||
. gettext.sh
|
||||
TEXTDOMAIN=gettext-tools
|
||||
export TEXTDOMAIN
|
||||
TEXTDOMAINDIR="$localedir"
|
||||
export TEXTDOMAINDIR
|
||||
|
||||
# Redirect fileno 3 to interactive I/O.
|
||||
exec 3>/dev/tty
|
||||
|
||||
# Output a prompt.
|
||||
if test $# != 0; then
|
||||
echo "$1" 1>&3
|
||||
fi
|
||||
|
||||
# Find the user name on the local machine.
|
||||
user=`id -u -n 2>/dev/null`
|
||||
if test -z "$user"; then
|
||||
user="$USER"
|
||||
if test -z "$user"; then
|
||||
user="$LOGNAME"
|
||||
if test -z "$user"; then
|
||||
user=unknown
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Find the hostname.
|
||||
# hostname on some systems (SVR3.2, old Linux) returns a bogus exit status,
|
||||
# so uname gets run too, so we keep only the first line of output.
|
||||
#host=`(hostname || uname -n) 2>/dev/null | sed 1q`
|
||||
host=`"$libdir"/gettext/hostname --short 2>/dev/null | sed 1q`
|
||||
|
||||
# Find the hostname.
|
||||
hostfqdn=`"$libdir"/gettext/hostname --fqdn 2>/dev/null | sed 1q`
|
||||
|
||||
# Find a list of email addresses from various mailer configuration files.
|
||||
# All mailers use configuration files under $HOME. We handle them in a
|
||||
# last-modified - first-priority order.
|
||||
cd $HOME
|
||||
files=""
|
||||
|
||||
# ----------------------- BEGIN MAILER SPECIFIC CODE -----------------------
|
||||
|
||||
# Mozilla Thunderbird addresses
|
||||
files="$files .thunderbird/*/prefs.js"
|
||||
|
||||
# Mozilla addresses
|
||||
files="$files .mozilla/*/prefs.js"
|
||||
|
||||
# Netscape 4 addresses
|
||||
files="$files .netscape/liprefs.js .netscape/preferences.js"
|
||||
|
||||
# Netscape 3 addresses
|
||||
files="$files .netscape/preferences"
|
||||
|
||||
# Emacs/XEmacs rmail, Emacs/XEmacs gnus, XEmacs vm addresses
|
||||
# XEmacs mew addresses
|
||||
files="$files .emacs .emacs.el"
|
||||
|
||||
# KDE2 addresses
|
||||
files="$files .kde2/share/config/emaildefaults"
|
||||
|
||||
# KDE kmail addresses
|
||||
files="$files .kde2/share/config/kmailrc"
|
||||
|
||||
# GNOME evolution 2 addresses
|
||||
files="$files .gconf/apps/evolution/mail/%gconf.xml"
|
||||
|
||||
# GNOME evolution 1 addresses
|
||||
files="$files evolution/config.xmldb"
|
||||
|
||||
# GNOME balsa addresses
|
||||
files="$files .gnome/balsa"
|
||||
|
||||
# StarOffice and OpenOffice addresses
|
||||
sed_dos2unix='s/\r$//'
|
||||
sed_soffice51='s,StarOffice 5\.1=\(.*\)$,\1/sofficerc,p'
|
||||
sed_soffice52='s,StarOffice 5\.2=\(.*\)$,\1/user/sofficerc,p'
|
||||
sed_ooffice='s,^OpenOffice[^=]*=\(.*\)$,\1/user/config/registry/instance/org/openoffice/UserProfile.xml,p'
|
||||
files="$files Office51/sofficerc Office52/user/sofficerc "`sed -n -e "$sed_dos2unix" -e "$sed_soffice51" -e "$sed_soffice52" -e "$sed_ooffice" .sversionrc 2>/dev/null | sed -e 's,^file://*,/,'`
|
||||
|
||||
# mutt addresses
|
||||
files="$files .muttrc"
|
||||
|
||||
# pine addresses
|
||||
files="$files .pinerc"
|
||||
|
||||
# xfmail addresses
|
||||
files="$files .xfmail/.xfmailrc"
|
||||
|
||||
# tkrat addresses
|
||||
files="$files .ratatosk/ratatoskrc"
|
||||
|
||||
# ----------------------- END MAILER SPECIFIC CODE -----------------------
|
||||
|
||||
# Expand wildcards and remove nonexistent files from the list.
|
||||
nfiles=""
|
||||
for file in $files; do
|
||||
if test -r "$file" && test ! -d "$file"; then
|
||||
nfiles="$nfiles $file"
|
||||
fi
|
||||
done
|
||||
files="$nfiles"
|
||||
|
||||
addresses=""
|
||||
|
||||
if test -n "$files"; then
|
||||
|
||||
for file in `ls -t $files`; do
|
||||
|
||||
case "$file" in
|
||||
|
||||
# ----------------------- BEGIN MAILER SPECIFIC CODE -----------------------
|
||||
|
||||
# Mozilla and Mozilla Thunderbird addresses
|
||||
.mozilla/*/prefs.js | .thunderbird/*/prefs.js)
|
||||
addresses="$addresses "`grep -h '^user_pref("mail\.identity\..*\.useremail", ".*");$' $file 2>/dev/null | sed -e 's/^user_pref("mail\.identity\..*\.useremail", "\(.*\)");$/\1/'`
|
||||
;;
|
||||
|
||||
# Netscape 4 addresses
|
||||
.netscape/liprefs.js | .netscape/preferences.js)
|
||||
addresses="$addresses "`grep -h '^user_pref("mail\.identity\.useremail", ".*");$' $file 2>/dev/null | sed -e 's/^user_pref("mail\.identity\.useremail", "\(.*\)");$/\1/'`
|
||||
;;
|
||||
|
||||
# Netscape 3 addresses
|
||||
.netscape/preferences)
|
||||
addresses="$addresses "`grep -h '^EMAIL_ADDRESS:' $file 2>/dev/null | sed -e 's/^EMAIL_ADDRESS:[ ]*//'`
|
||||
;;
|
||||
|
||||
.emacs | .emacs.el)
|
||||
# Emacs/XEmacs rmail, Emacs/XEmacs gnus, XEmacs vm addresses
|
||||
addresses="$addresses "`grep -h '[ (]user-mail-address "[^"]*"' $file 2>/dev/null | sed -e 's/^.*[ (]user-mail-address "\([^"]*\)".*$/\1/'`
|
||||
# XEmacs mew addresses
|
||||
domains=`grep -h '[ (]mew-mail-domain "[^"]*"' $file 2>/dev/null | sed -e 's/^.*[ (]mew-mail-domain "\([^"]*\)".*$/\1/'`
|
||||
if test -n "$domains"; then
|
||||
for domain in $domains; do
|
||||
addresses="$addresses ${user}@$domain"
|
||||
done
|
||||
fi
|
||||
;;
|
||||
|
||||
# KDE2 addresses
|
||||
.kde2/share/config/emaildefaults)
|
||||
addresses="$addresses "`grep -h '^EmailAddress=' $file 2>/dev/null | sed -e 's/^EmailAddress=//'`
|
||||
;;
|
||||
|
||||
# KDE kmail addresses
|
||||
.kde2/share/config/kmailrc)
|
||||
addresses="$addresses "`grep -h '^Email Address=' $file 2>/dev/null | sed -e 's/^Email Address=//'`
|
||||
;;
|
||||
|
||||
# GNOME evolution 2 addresses
|
||||
.gconf/apps/evolution/mail/%gconf.xml)
|
||||
sedexpr0='s,^.*<addr-spec>\(.*\)</addr-spec>.*$,\1,p'
|
||||
addresses="$addresses "`sed -n -e "$sedexpr0" < $file`
|
||||
;;
|
||||
|
||||
# GNOME evolution 1 addresses
|
||||
evolution/config.xmldb)
|
||||
sedexpr0='s/^.*<entry name="identity_address_[0-9]*" type="string" value="\([^"]*\)".*$/\1/p'
|
||||
sedexpr1='s/\(..\)/\\x\1/g'
|
||||
sedexpr2='s,$,\\n,'
|
||||
addresses="$addresses "`sed -n -e "$sedexpr0" < $file | while read hexstring; do printf \`echo "$hexstring" | sed -e "$sedexpr1" -e "$sedexpr2"\`; done`
|
||||
;;
|
||||
|
||||
# GNOME balsa addresses
|
||||
.gnome/balsa)
|
||||
addresses="$addresses "`grep -h '^Address=' $file 2>/dev/null | sed -e 's/^Address=//'`
|
||||
;;
|
||||
|
||||
# OpenOffice addresses
|
||||
*/UserProfile.xml)
|
||||
addresses="$addresses "`sed -n -e 's,^.*<mail cfg:type="string">\(.*\)</mail>.*$,\1,p' $file 2>/dev/null`
|
||||
;;
|
||||
|
||||
# StarOffice addresses
|
||||
# Not a typo. They really write "Adress" with a single d.
|
||||
# German orthography...
|
||||
*/sofficerc)
|
||||
addresses="$addresses "`grep -h '^User-Adress=' $file 2>/dev/null | sed -e 's/#[^#]*$//' -e 's/^.*#//'`
|
||||
;;
|
||||
|
||||
# mutt addresses
|
||||
.muttrc)
|
||||
mutt_addresses=`grep -h '^set from="[^"]*"[ ]*$' $file 2>/dev/null | sed -e 's/^set from="\([^"]*\)"[ ]*$/\1/'`
|
||||
if test -n "$mutt_addresses"; then
|
||||
addresses="$addresses $mutt_addresses"
|
||||
else
|
||||
# mutt uses $EMAIL as fallback.
|
||||
if test -n "$EMAIL"; then
|
||||
addresses="$addresses $EMAIL"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
# pine addresses
|
||||
.pinerc)
|
||||
domains=`grep -h '^user-domain=' $file 2>/dev/null | sed -e 's/^user-domain=//'`
|
||||
if test -n "$domains"; then
|
||||
for domain in $domains; do
|
||||
addresses="$addresses ${user}@$domain"
|
||||
done
|
||||
else
|
||||
# The use-only-domain-name option is only used if the user-domain option is not present.
|
||||
domains=`grep -h '^use-only-domain-name=' $file 2>/dev/null | sed -e 's/^use-only-domain-name=//'`
|
||||
if test "Yes" = "$domains"; then
|
||||
addresses="$addresses ${user}@"`echo "$hostfqdn" | sed -e 's/^[^.]*\.//'`
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
# xfmail addresses
|
||||
.xfmail/.xfmailrc)
|
||||
addresses="$addresses "`grep -h '^from=.*<.*>' $file 2>/dev/null | sed -e 's/^.*<\([^<>]*\)>.*$/\1/'`
|
||||
;;
|
||||
|
||||
# tkrat addresses
|
||||
.ratatosk/ratatoskrc)
|
||||
domains=`grep -h '^set option(masquerade_as) ' $file 2>/dev/null | sed -e 's/^set option(masquerade_as) //'`
|
||||
if test -n "$domains"; then
|
||||
for domain in $domains; do
|
||||
addresses="$addresses ${user}@$domain"
|
||||
done
|
||||
else
|
||||
# The domain option is used only if the masquerade_as option is not present.
|
||||
domains=`grep -h '^set option(domain) ' $file 2>/dev/null | sed -e 's/^set option(domain) //'`
|
||||
if test -n "$domains"; then
|
||||
for domain in $domains; do
|
||||
addresses="$addresses ${user}@${host}.$domain"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
# ----------------------- END MAILER SPECIFIC CODE -----------------------
|
||||
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
# Some Debian systems have a file /etc/mailname.
|
||||
if test -r /etc/mailname; then
|
||||
hostmailname=`cat /etc/mailname`
|
||||
if test -n "$hostmailname"; then
|
||||
addresses="$addresses ${user}@$hostmailname"
|
||||
fi
|
||||
fi
|
||||
|
||||
# SuSE Linux >= 8.0 systems have a file /etc/sysconfig/mail.
|
||||
if test -r /etc/sysconfig/mail; then
|
||||
hostmailname=`. /etc/sysconfig/mail && echo "$FROM_HEADER"`
|
||||
if test -n "$hostmailname"; then
|
||||
addresses="$addresses ${user}@$hostmailname"
|
||||
fi
|
||||
fi
|
||||
|
||||
# elm has no user-defined addresses.
|
||||
# mailx has no user-defined addresses.
|
||||
# mh has no user-defined addresses.
|
||||
# They use the system default.
|
||||
addresses="$addresses ${user}@$hostfqdn"
|
||||
|
||||
# Normalize addresses: remove addresses without @, lowercase the part after @,
|
||||
# and remove duplicates.
|
||||
lowercase_sed='{
|
||||
h
|
||||
s/^[^@]*@\(.*\)$/\1/
|
||||
y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
|
||||
x
|
||||
s/^\([^@]*\)@.*/\1@/
|
||||
G
|
||||
s/\
|
||||
//
|
||||
p
|
||||
}'
|
||||
naddresses=""
|
||||
for addr in $addresses; do
|
||||
case "$addr" in
|
||||
"<"*">") addr=`echo "$addr" | sed -e 's/^<//' -e 's/>$//'` ;;
|
||||
esac
|
||||
case "$addr" in
|
||||
*@*)
|
||||
addr=`echo "$addr" | sed -n -e "$lowercase_sed"`
|
||||
case " $naddresses " in
|
||||
*" $addr "*) ;;
|
||||
*) naddresses="$naddresses $addr" ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
done
|
||||
addresses="$naddresses"
|
||||
|
||||
# Now it's time to ask the user.
|
||||
case "$addresses" in
|
||||
" "*" "*)
|
||||
# At least two addresses.
|
||||
lines=""
|
||||
i=0
|
||||
for addr in $addresses; do
|
||||
i=`expr $i + 1`
|
||||
lines="${lines}${i} ${addr}
|
||||
"
|
||||
done
|
||||
while true; do
|
||||
{ gettext "Which is your email address?"; echo; } 1>&3
|
||||
echo "$lines" 1>&3
|
||||
{ gettext "Please choose the number, or enter your email address."; echo; } 1>&3
|
||||
read answer < /dev/tty
|
||||
case "$answer" in
|
||||
*@*) ;;
|
||||
[0-9]*)
|
||||
i=0
|
||||
for addr in $addresses; do
|
||||
i=`expr $i + 1`
|
||||
if test "$i" = "$answer"; then
|
||||
break 2
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
case "$answer" in
|
||||
"<"*">") answer=`echo "$answer" | sed -e 's/^<//' -e 's/>$//'` ;;
|
||||
esac
|
||||
case "$answer" in
|
||||
*" "*) { gettext "Invalid email address: invalid character."; echo; echo; } 1>&3 ; continue ;;
|
||||
*@*.*) ;;
|
||||
*@*) { gettext "Invalid email address: need a fully qualified host name or domain name."; echo; echo; } 1>&3 ; continue ;;
|
||||
*) { gettext "Invalid email address: missing @"; echo; echo; } 1>&3 ; continue ;;
|
||||
esac
|
||||
addr=`echo "$answer" | sed -n -e "$lowercase_sed"`
|
||||
break
|
||||
done
|
||||
;;
|
||||
" "*)
|
||||
# One address.
|
||||
while true; do
|
||||
{ gettext "Is the following your email address?"; echo; } 1>&3
|
||||
echo " $addresses" 1>&3
|
||||
{ gettext "Please confirm by pressing Return, or enter your email address."; echo; } 1>&3
|
||||
read answer < /dev/tty
|
||||
if test -z "$answer"; then
|
||||
addr=`echo "$addresses" | sed -e 's/^ //'`
|
||||
break
|
||||
fi
|
||||
case "$answer" in
|
||||
"<"*">") answer=`echo "$answer" | sed -e 's/^<//' -e 's/>$//'` ;;
|
||||
esac
|
||||
case "$answer" in
|
||||
*" "*) { gettext "Invalid email address: invalid character."; echo; echo; } 1>&3 ; continue ;;
|
||||
*@*.*) ;;
|
||||
*@*) { gettext "Invalid email address: need a fully qualified host name or domain name."; echo; echo; } 1>&3 ; continue ;;
|
||||
*) { gettext "Invalid email address: missing @"; echo; echo; } 1>&3 ; continue ;;
|
||||
esac
|
||||
addr=`echo "$answer" | sed -n -e "$lowercase_sed"`
|
||||
break
|
||||
done
|
||||
;;
|
||||
"")
|
||||
# No address.
|
||||
{ gettext "Couldn't find out about your email address."; echo; } 1>&3
|
||||
while true; do
|
||||
{ gettext "Please enter your email address."; echo; } 1>&3
|
||||
read answer < /dev/tty
|
||||
case "$answer" in
|
||||
"<"*">") answer=`echo "$answer" | sed -e 's/^<//' -e 's/>$//'` ;;
|
||||
esac
|
||||
case "$answer" in
|
||||
*" "*) { gettext "Invalid email address: invalid character."; echo; echo; } 1>&3 ; continue ;;
|
||||
*@*.*) ;;
|
||||
*@*) { gettext "Invalid email address: need a fully qualified host name or domain name."; echo; echo; } 1>&3 ; continue ;;
|
||||
*) { gettext "Invalid email address: missing @"; echo; echo; } 1>&3 ; continue ;;
|
||||
esac
|
||||
addr=`echo "$answer" | sed -n -e "$lowercase_sed"`
|
||||
break
|
||||
done
|
||||
;;
|
||||
*) echo "internal error" 1>&3 ; exit 1 ;;
|
||||
esac
|
||||
|
||||
# Print to standard output.
|
||||
echo "$addr"
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
/* backtrace.h -- Public header file for stack backtrace library.
|
||||
Copyright (C) 2012-2024 Free Software Foundation, Inc.
|
||||
Copyright (C) 2012-2020 Free Software Foundation, Inc.
|
||||
Written by Ian Lance Taylor, Google.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@@ -54,14 +54,13 @@ struct backtrace_state;
|
||||
invalid after this function returns.
|
||||
|
||||
As a special case, the ERRNUM argument will be passed as -1 if no
|
||||
debug info can be found for the executable, or if the debug info
|
||||
exists but has an unsupported version, but the function requires
|
||||
debug info (e.g., backtrace_full, backtrace_pcinfo). The MSG in
|
||||
this case will be something along the lines of "no debug info".
|
||||
Similarly, ERRNUM will be passed as -1 if there is no symbol table,
|
||||
but the function requires a symbol table (e.g., backtrace_syminfo).
|
||||
This may be used as a signal that some other approach should be
|
||||
tried. */
|
||||
debug info can be found for the executable, but the function
|
||||
requires debug info (e.g., backtrace_full, backtrace_pcinfo). The
|
||||
MSG in this case will be something along the lines of "no debug
|
||||
info". Similarly, ERRNUM will be passed as -1 if there is no
|
||||
symbol table, but the function requires a symbol table (e.g.,
|
||||
backtrace_syminfo). This may be used as a signal that some other
|
||||
approach should be tried. */
|
||||
|
||||
typedef void (*backtrace_error_callback) (void *data, const char *msg,
|
||||
int errnum);
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
#All folders
|
||||
SRB2.res
|
||||
depend.dep
|
||||
depend.ped
|
||||
*.o
|
||||
#VC9 folder only
|
||||
/VC9/Win32
|
||||
/VC9/x64
|
||||
@@ -0,0 +1,2 @@
|
||||
# DON'T REMOVE
|
||||
# This keeps the folder from disappearing
|
||||
Loaded 100 of 496 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user