1
0
mirror of https://github.com/adamyg/mcwin32.git synced 2025-04-18 01:17:37 +03:00
* #113 - legacy owc
* #114 - warnings
* #115 - widechar handling
This commit is contained in:
adamyg 2025-03-22 02:42:20 +08:00 committed by GitHub
parent c29dd79890
commit b7b7a86767
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
54 changed files with 14063 additions and 665 deletions

View File

@ -32,6 +32,12 @@ jobs:
toolchain: owc20,
toolversion: owc20
}
- {
name: "Windows Legacy OWC",
os: windows-latest,
toolchain: owc19,
toolversion: owc19
}
steps:
@ -66,32 +72,42 @@ jobs:
version: "2.0"
location: "C:\\Watcom"
- name: OpenWatcom legacy setup
uses: open-watcom/setup-watcom@v0
if: startsWith(matrix.config.name, 'Windows Legacy OWC')
with:
version: "1.9"
location: "C:\\Watcom"
- name: Windows extra
if: startsWith(matrix.config.name, 'Windows Latest MSVC') || startsWith(matrix.config.name, 'Windows Latest OWC')
if: contains(matrix.config.name, 'MSVC') || contains(matrix.config.name, 'OWC')
run: |
c:\msys64\usr\bin\pacman --noconfirm -S mingw-w64-x86_64-gettext-tools
- name: Generate
if: startsWith(matrix.config.name, 'Windows Latest')
if: startsWith(matrix.config.name, 'Windows')
shell: cmd
run: |
@if "${{ matrix.config.toolchain }}"=="mingw32" set PATH=c:\msys64\mingw32\bin;%PATH%
@if "${{ matrix.config.toolchain }}"=="mingw64" set PATH=c:\msys64\mingw64\bin;%PATH%
@if "${{ matrix.config.toolchain }}"=="owc20" call .\mcwin32\support\owc20setenv.bat C:\Watcom
@if "${{ matrix.config.toolchain }}"=="owc19" call .\mcwin32\support\owc19setenv.bat C:\Watcom
@set BUSYBOX=./support/busybox
@if "${{ matrix.config.toolchain }}"=="mingw64" set BUSYBOX=./support/busybox64
@set PERL=c:/Strawberry/perl/bin/perl
cd mcwin32
c:/Strawberry/perl/bin/perl makelib.pl --perlpath=c:/Strawberry/perl/bin --busybox=%BUSYBOX% --verbose "${{ matrix.config.toolchain }}"
c:/Strawberry/perl/bin/perl makelib.pl --perlpath=c:/Strawberry/perl/bin --busybox=%BUSYBOX% "${{ matrix.config.toolchain }}"
- name: Compile
if: startsWith(matrix.config.name, 'Windows Latest')
if: startsWith(matrix.config.name, 'Windows')
shell: cmd
run: |
@if "${{ matrix.config.toolchain }}"=="mingw32" set PATH=c:\msys64\mingw32\bin;%PATH%
@if "${{ matrix.config.toolchain }}"=="mingw64" set PATH=c:\msys64\mingw64\bin;%PATH%
@if "${{ matrix.config.toolchain }}"=="owc20" call .\mcwin32\support\owc20setenv.bat C:\Watcom
@if "${{ matrix.config.toolchain }}"=="owc20" set PATH=%PATH%;c:\msys64\mingw64\bin
@if "${{ matrix.config.toolchain }}"=="owc19" call .\mcwin32\support\owc19setenv.bat C:\Watcom
@if "${{ matrix.config.toolchain }}"=="owc19" set PATH=%PATH%;c:\msys64\mingw64\bin
@if "${{ matrix.config.toolchain }}"=="vc2022" set PATH=%PATH%;c:\msys64\mingw64\bin
@set PERL=c:/Strawberry/perl/bin/perl
cd mcwin32
@ -104,6 +120,7 @@ jobs:
path: mcwin32/bin.${{ matrix.config.toolversion }}/release/*
- name: Installer
if: startsWith(matrix.config.name, 'Windows')
shell: cmd
run: |
@set PERL=c:/Strawberry/perl/bin/perl
@ -113,6 +130,7 @@ jobs:
"%programfiles(x86)%\Inno Setup 5\ISCC" -DBUILD_INFO=1 -DBUILD_TYPE=release ".\releases\mc-inno-setup.iss"
- name: Release artifacts
if: startsWith(matrix.config.name, 'Windows')
uses: softprops/action-gh-release@v1
with:
files: ./mcwin32/releases/mcwin32-build*-setup.exe

View File

@ -269,6 +269,10 @@ main (int argc, char *argv[])
int exit_code = EXIT_FAILURE;
const char *tmpdir = NULL;
#if defined(WIN32)
WIN32_HeapInit ();
#endif
mc_global.run_from_parent_mc = !check_sid ();
/* We had LC_CTYPE before, LC_ALL includes LC_TYPE as well */
@ -590,7 +594,12 @@ main (int argc, char *argv[])
exit_code = EXIT_FAILURE;
}
(void) putchar ('\n'); /* Hack to make shell's prompt start at left of screen */
(void) putchar ('\n');
/* Hack to make shell's prompt start at left of screen */
#if defined(WIN32)
WIN32_HeapCheck ();
#endif
return exit_code;
}

View File

@ -315,8 +315,11 @@ init_subshell_child (const char *pty_name)
{
char sid_str[BUF_SMALL];
g_snprintf (sid_str, sizeof (sid_str), "MC_SID=%ld", (long) mc_sid);
putenv (g_strdup (sid_str));
//WIN32,setenv
//g_snprintf (sid_str, sizeof (sid_str), "MC_SID=%ld", (long) mc_sid);
//putenv (g_strdup (sid_str));
g_snprintf (sid_str, sizeof (sid_str), "%ld", (long) mc_sid);
g_setenv ("MC_SID", sid_str);
}
switch (mc_global.shell->type)
@ -334,7 +337,9 @@ init_subshell_child (const char *pty_name)
/* Make MC's special commands not show up in bash's history and also suppress
* consecutive identical commands*/
putenv ((char *) "HISTCONTROL=ignoreboth");
//WIN32,setenv
//putenv ((char *) "HISTCONTROL=ignoreboth");
g_setenv ("HISTCONTROL", "ignoreboth");
/* Allow alternative readline settings for MC */
{
@ -382,7 +387,9 @@ init_subshell_child (const char *pty_name)
g_setenv ("ENV", init_file, FALSE);
/* Make MC's special commands not show up in history */
putenv ((char *) "HISTCONTROL=ignorespace");
//WIN32,setenv
//putenv ((char *) "HISTCONTROL=ignorespace");
g_setenv ("HISTCONTROL", "ignorespace");
break;

View File

@ -1015,7 +1015,7 @@ shell_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, const char *remot
vfs_print_message (_("shell: Reading directory %s..."), remote_path);
dir->timestamp = g_get_monotonic_time () + shell_directory_timeout * G_USEC_PER_SEC;
dir->timestamp = g_get_monotonic_time () + ((gint64)shell_directory_timeout * G_USEC_PER_SEC);
quoted_path = str_shell_escape (remote_path);
(void) shell_command_v (me, super, NONE, SHELL_SUPER (super)->scr_ls, "SHELL_FILENAME=%s;\n",

View File

@ -1,483 +0,0 @@
shell_patterns=0 # expression type
# The macros are:
#
# %c The cursor column position number. For edit menu only.
# %i The indent of blank space, equal the cursor column
# position. For edit menu only.
# %y The syntax type of current file. For edit menu only.
# %b The block file name.
# %f The current file name.
# %n Only the current file name without extension.
# %x The extension of current file name.
# %d The current directory name.
# %F The current file in the unselected panel.
# %D The directory name of the unselected panel.
# %t The currently tagged files.
# %T The tagged files in the unselected panel.
# %u and %U Similar to the %t and %T macros, but in
# addition the files are untagged. You can use this macro
# only once per menu file entry or extension file entry,
# because next time there will be no tagged files.
# %s and %S The selected files: The tagged files if
# there are any. Otherwise the current file.
#
# %% The % character
#
# %{some text} Prompt for the substitution. An input box
# is shown and the text inside the braces is used as a
# prompt. The macro is substituted by the text typed by the
# user. The user can press ESC or F10 to cancel. This macro
# doesn't work on the command line yet.
#----------------------- Begin [perl] language template -----------------------
+ y Perl\ Program | f \.pl$
1 Author description header
unset LANG
unset LANGUAGE
LC_ALL=
MY_UID="`id | sed 's/^.*uid=\([^(]*\).*$/\1/'`"
AUTHOR="`awk -F: '$3 == '$MY_UID' {print $5}' /etc/passwd`"
cat >>%b <<EOF
#----------------------------------------------------------------------
# Description:
# Author: $AUTHOR <$REPLYTO>
# Created at: `date`
# Computer: `uname -n`
# System: `uname -sr` on `uname -m`
#
# Copyright (c) `date +%%Y` $AUTHOR All rights reserved.
#
#----------------------------------------------------------------------
# Configure section:
#----------------------------------------------------------------------
#
# main()
EOF
+ y Perl\ Program | f \.pl$
2 while ()
cat <<EOF > %b
%iwhile() {
%i}
EOF
+ y Perl\ Program | f \.pl$
3 for ()
cat <<EOF > %b
%ifor ($i = ; $i < ; $i++) {
%i}
EOF
+ y Perl\ Program | f \.pl$
4 foreach ()
cat <<EOF > %b
%iforeach ($ ) {
%i}
EOF
+ y Perl\ Program | f \.pl$
5 if ()
cat <<EOF > %b
%iif () {
%i}
EOF
+ y Perl\ Program | f \.pl$
6 if () else
cat <<EOF > %b
%iif () {
%i} else {
%i}
EOF
+ y Perl\ Program | f \.pl$
7 if () elsif ()
cat <<EOF > %b
%iif () {
%i} elsif () {
%i}
EOF
+ y Perl\ Program | f \.pl$
8 substr ()
echo "%i$ = substr(\$str, \$off, \$cnt);" >%b
+ y Perl\ Program | f \.pl$
9 opendir ()
cat <<EOF > %b
%iopendir(DIR, \$dir) || die("\$0: can't open \$dir\n");
EOF
+ y Perl\ Program | f \.pl$
a sub ()
NAME=%{ Enter name of subroutine: }
cat <<EOF > %b
sub
$NAME ()
{
} # end of $NAME()
EOF
#----------------------- End [perl] language template -------------------------
#---------------------- Begin [shell] language template -----------------------
+ y Shell\ Script | f \.sh$
1 Author description header
unset LANG
unset LANGUAGE
LC_ALL=
MY_UID="`id | sed 's/^.*uid=\([^(]*\).*$/\1/'`"
AUTHOR="`awk -F: '$3 == '$MY_UID' {print $5}' /etc/passwd`"
cat >>%b <<EOF
#----------------------------------------------------------------------
# Description:
# Author: $AUTHOR <$REPLYTO>
# Created at: `date`
# Computer: `uname -n`
# System: `uname -sr` on `uname -m`
#
# Copyright (c) `date +%%Y` $AUTHOR All rights reserved.
#
#----------------------------------------------------------------------
# Configure section:
#----------------------------------------------------------------------
#
# main()
EOF
+ y Shell\ Script | f \.sh$
3 for
cat <<EOF > %b
%ifor i in \$
%ido
%idone
EOF
+ y Shell\ Script | f \.sh$
4 while
cat <<EOF > %b
%iwhile
%ido
%idone
EOF
+ y Shell\ Script | f \.sh$
5 if [] then else
cat <<EOF >> %b
%iif [ ];then
%ielse
%ifi
EOF
+ y Shell\ Script | f \.sh$
6 case
NUMBER=%{ Enter number elements of case:}
cat <<EOF > %b
%icase "\$" in
EOF
while [ "$NUMBER" -gt 0 ]
do
cat <<EOF >> %b
%i)
%i ;;
EOF
let NUMBER=$NUMBER-1
done
cat <<EOF >> %b
%i*)
%iesac
EOF
+ y Shell\ Script | f \.sh$
7 function
NAME=%{ Enter name of function:}
cat <<EOF >> %b
$NAME() {
} # end of $NAME()
EOF
+ y Shell\ Script | f \.sh$
8 select of bash
cat <<EOF >> %b
%iselect i in \$l
%ido
%i if [ -n "\$i" ];then
%i break
%i else
%i continue
%i fi
%idone
EOF
#----------------------- End [shell] language template ------------------------
#------------------------- Begin [c] language template ------------------------
+ f \.h$ | f \.c$ | f \.cc$
1 Author description header
unset LANG
unset LANGUAGE
LC_ALL=
MY_UID="`id | sed 's/^.*uid=\([^(]*\).*$/\1/'`"
AUTHOR="`awk -F: '$3 == '$MY_UID' {print $5}' /etc/passwd`"
cat >> %b <<EOF
/********************************************************************
* Description:
* Author: $AUTHOR <$REPLYTO>
* Created at: `date`
* Computer: `uname -n`
* System: `uname -sr` on `uname -m`
*
* Copyright (c) `date +%%Y` $AUTHOR All rights reserved.
*
********************************************************************/
EOF
+ f \.h$ | f \.c$ | f \.cc$
2 GPL description header
cat >>%b <<EOF
/*
* 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/>.
*/
EOF
+ f \.c$ | f \.cc$
3 if ()
cat <<EOF > %b
%iif () {
%i}
EOF
+ f \.c$ | f \.cc$
4 if () else
cat <<EOF > %b
%iif () {
%i} else {
%i}
EOF
+ f \.c$ | f \.cc$
5 if () else if ()
cat <<EOF > %b
%iif ( ) {
%i} else if ( ) {
%i}
EOF
+ f \.c$ | f \.cc$
6 switch ()
NUMBER=%{ Enter number elements of switch:}
echo "%iswitch () {" >%b
while [ "$NUMBER" -gt 0 ]
do
echo "%icase '':" >>%b
echo "%i break;" >>%b
let NUMBER=$NUMBER-1
done
echo "%i default:" >>%b
echo "%i}" >>%b
+ f \.c$ | f \.cc$
7 for ()
cat <<EOF > %b
%ifor (i = ; i < ; i++) {
%i}
EOF
+ f \.c$ | f \.cc$
8 while ()
cat <<EOF > %b
%iwhile () {
%i}
EOF
+ f \.c$ | f \.cc$
9 do {} while ()
cat <<EOF > %b
%ido {
%i} while ()
EOF
+ f \.c$ | f \.cc$
a array
cat <<EOF > %b
%ichar const x[] = {
%i, ,
%i};
EOF
+ f \.c$ | f \.cc$
b enum
cat <<EOF > %b
%ienum x {
%i, ,
%i};
EOF
+ f \.c$ | f \.cc$
c struct
cat <<EOF > %b
%istruct ? {
%i;
%i};
EOF
+ f \.c$ | f \.cc$
d union
cat <<EOF > %b
%iunion ? {
%i;
%i};
EOF
+ f \.c$ | f \.cc$
e typedef struct
cat <<EOF > %b
%itypedef struct {
%i;
%i} ?;
EOF
+ f \.c$ | f \.cc$
f function
NAME=%{ Enter name of function:}
cat <<EOF >> %b
$NAME()
{
} /* end of $NAME() */
EOF
+ f \.c$ | f \.h$ | f \.cc$
g #include
INC=%{ Enter include name: }
if [ -r "$INC" ];then
echo \#include \"$INC\" >%b
else
echo \#include \<$INC\> >%b
fi
+ f \.c$ | f \.h$ | f \.cc$
d #define
echo "#define " >%b
+ f \.c$ | f \.h$ | f \.cc$
d #ifdef
cat <<EOF > %b
#ifdef
#else
#endif
EOF
+ f \.c$ | f \.h$ | f \.cc$
...............................................................................
+ f \.c$ | f \.h$ | f \.cc$
h View all *.h into current directory
cat *.h |less
+ f \.c$ | f \.cc$
d Run gdb for current file
[ -x "./%n" ] && gdb ./%n
= f \.c$ | f \.cc$
+ f \.c$ | f \.cc$
c Compile, link and run the current .c file
export CFLAGS="-g -Wall -O2"
make || make %n || cc $CFLAGS -o %n %f
[ -r "%n" ] && (echo "*** press any key for run... ***"; read)
[ -x "%n" ] && ./%n
(echo -ne "\n--- Press any key for return to edit. ---"; read)
+ f \.c$ | f \.h$
t Indent `C' formatter
indent -kr -pcs %b 1>/dev/null 2> %e
#--------------------- End [c/c++] language template --------------------------
#------------------------- Begin unknown template -----------------------------
+ y unknown & t r
s #! /bin/sh
echo "#! /bin/sh" >%b
+ y unknown & t r
p #! /usr/bin/perl
echo "#! /usr/bin/perl" >%b
+ y unknown & t r
a Author description header
unset LANG
unset LANGUAGE
LC_ALL=
MY_UID="`id | sed 's/^.*uid=\([^(]*\).*$/\1/'`"
AUTHOR="`awk -F: '$3 == '$MY_UID' {print $5}' /etc/passwd`"
cat >>%b <<EOF
----------------------------------------------------------------------
Description:
Author: $AUTHOR <$REPLYTO>
Created at: `date`
Computer: `uname -n`
System: `uname -sr` on `uname -m`
Copyright (c) `date +%%Y` $AUTHOR All rights reserved.
----------------------------------------------------------------------
EOF
#--------------------------- End unknown template -----------------------------
-------------------------------------------------------------------------------
#----------------------- Begin common section ---------------------------------
S Sort selection
TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/up.XXXXXX` || exit 1
cat %b > $TMPFILE
cat $TMPFILE| sort >%b
rm -f $TMPFILE
I Insert `Changelog' string
DATE="`date +%%Y-%%m-%%d`"
MY_UID="`id | sed 's/^.*uid=\([^(]*\).*$/\1/'`"
AUTHOR="`awk -F: '$3 == '$MY_UID' {print $5}' /etc/passwd`"
EMAIL="<$REPLYTO>"
echo "$DATE $AUTHOR $EMAIL" >%b
s Invoke `shell'
sh
m view `man'
MAN=%{Enter name of man:}
%view{ascii,nroff} MANROFFOPT='' MAN_KEEP_FORMATTING=1 man -P cat $MAN
i Insert output of command to cursor
CMD=%{ Enter command: }
eval $CMD > %b
o Open bash to next free console
open -s -- /bin/bash
u Upper case selection
TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/up.XXXXXX` || exit 1
cat %b > $TMPFILE
sed 's/\(.*\)/\U\1/' $TMPFILE >%b
rm -f $TMPFILE
l Lower case selection
TMPFILE=`mktemp ${MC_TMPDIR:-/tmp}/up.XXXXXX` || exit 1
cat %b > $TMPFILE
sed 's/\(.*\)/\L\1/' $TMPFILE >%b
rm -f $TMPFILE
#-------------------------- End of common section -----------------------------

1
mcwin32/.gitignore vendored
View File

@ -16,7 +16,6 @@ Makefile
buildinfo.h
packageinfo.h
busyboxcmds.h
BUILDNUMBER
owcsetup.dbg
testaccounts.txt
.created

1
mcwin32/BUILDNUMBER Normal file
View File

@ -0,0 +1 @@
231

View File

@ -1,4 +1,4 @@
Fri Mar 7 11:26:56 2025 adamy
Wed Mar 19 16:03:57 2025 adamy
* build-231
@ -12,6 +12,7 @@ Fri Mar 7 11:26:56 2025 adamy
* upgrades/bugfixes
o wputenv() cross tool-chain usage (#113)
o pcre2 10.45 (#106)
o appupdater (#102)
o glib 2.54.3 (#102)
@ -564,7 +565,6 @@ Wed Aug 15 00:36:55 2012 adamy
- additional UNC support, local shares available under //<hostname>/
- build number exported (e.g. --help).
Tue Aug 14 16:39:56 2012 adamy
* build 157

View File

@ -965,7 +965,11 @@ BUILD_DATE= $(shell $(BUSYBOX) date +'%Y%m%d')
ifneq ($(APPVEYOR_BUILD_NUMBER),)
BUILD_NUMBER= $(APPVEYOR_BUILD_NUMBER)
else ifneq ($(GITHUB_RUN_NUMBER),)
BUILD_NUMBER= $(GITHUB_RUN_NUMBER)
ifeq (master,$(findstring master,$(GITHUB_REF)))
BUILD_NUMBER= $(shell $(BUSYBOX) cat BUILDNUMBER)
else
BUILD_NUMBER= $(shell $(BUSYBOX) expr 10000 + $(GITHUB_RUN_NUMBER))
endif
else
BUILD_NUMBER= $(shell $(BUSYBOX) cat BUILDNUMBER)
endif

BIN
mcwin32/art/kbtest01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

View File

@ -1 +0,0 @@
expat_legacy/

View File

@ -0,0 +1,22 @@
Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
and Clark Cooper
Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,137 @@
Expat, Release 2.0.1
This is Expat, a C library for parsing XML, written by James Clark.
Expat is a stream-oriented XML parser. This means that you register
handlers with the parser before starting the parse. These handlers
are called when the parser discovers the associated structures in the
document being parsed. A start tag is an example of the kind of
structures for which you may register handlers.
Windows users should use the expat_win32bin package, which includes
both precompiled libraries and executables, and source code for
developers.
Expat is free software. You may copy, distribute, and modify it under
the terms of the License contained in the file COPYING distributed
with this package. This license is the same as the MIT/X Consortium
license.
Versions of Expat that have an odd minor version (the middle number in
the release above), are development releases and should be considered
as beta software. Releases with even minor version numbers are
intended to be production grade software.
If you are building Expat from a check-out from the CVS repository,
you need to run a script that generates the configure script using the
GNU autoconf and libtool tools. To do this, you need to have
autoconf 2.52 or newer and libtool 1.4 or newer (1.5 or newer preferred).
Run the script like this:
./buildconf.sh
Once this has been done, follow the same instructions as for building
from a source distribution.
To build Expat from a source distribution, you first run the
configuration shell script in the top level distribution directory:
./configure
There are many options which you may provide to configure (which you
can discover by running configure with the --help option). But the
one of most interest is the one that sets the installation directory.
By default, the configure script will set things up to install
libexpat into /usr/local/lib, expat.h into /usr/local/include, and
xmlwf into /usr/local/bin. If, for example, you'd prefer to install
into /home/me/mystuff/lib, /home/me/mystuff/include, and
/home/me/mystuff/bin, you can tell configure about that with:
./configure --prefix=/home/me/mystuff
Another interesting option is to enable 64-bit integer support for
line and column numbers and the over-all byte index:
./configure CPPFLAGS=-DXML_LARGE_SIZE
However, such a modification would be a breaking change to the ABI
and is therefore not recommended for general use - e.g. as part of
a Linux distribution - but rather for builds with special requirements.
After running the configure script, the "make" command will build
things and "make install" will install things into their proper
location. Have a look at the "Makefile" to learn about additional
"make" options. Note that you need to have write permission into
the directories into which things will be installed.
If you are interested in building Expat to provide document
information in UTF-16 rather than the default UTF-8, follow these
instructions (after having run "make distclean"):
1. For UTF-16 output as unsigned short (and version/error
strings as char), run:
./configure CPPFLAGS=-DXML_UNICODE
For UTF-16 output as wchar_t (incl. version/error strings),
run:
./configure CFLAGS="-g -O2 -fshort-wchar" \
CPPFLAGS=-DXML_UNICODE_WCHAR_T
2. Edit the MakeFile, changing:
LIBRARY = libexpat.la
to:
LIBRARY = libexpatw.la
(Note the additional "w" in the library name.)
3. Run "make buildlib" (which builds the library only).
Or, to save step 2, run "make buildlib LIBRARY=libexpatw.la".
4. Run "make installlib" (which installs the library only).
Or, if step 2 was omitted, run "make installlib LIBRARY=libexpatw.la".
Using DESTDIR or INSTALL_ROOT is enabled, with INSTALL_ROOT being the default
value for DESTDIR, and the rest of the make file using only DESTDIR.
It works as follows:
$ make install DESTDIR=/path/to/image
overrides the in-makefile set DESTDIR, while both
$ INSTALL_ROOT=/path/to/image make install
$ make install INSTALL_ROOT=/path/to/image
use DESTDIR=$(INSTALL_ROOT), even if DESTDIR eventually is defined in the
environment, because variable-setting priority is
1) commandline
2) in-makefile
3) environment
Note for Solaris users: The "ar" command is usually located in
"/usr/ccs/bin", which is not in the default PATH. You will need to
add this to your path for the "make" command, and probably also switch
to GNU make (the "make" found in /usr/ccs/bin does not seem to work
properly -- appearantly it does not understand .PHONY directives). If
you're using ksh or bash, use this command to build:
PATH=/usr/ccs/bin:$PATH make
When using Expat with a project using autoconf for configuration, you
can use the probing macro in conftools/expat.m4 to determine how to
include Expat. See the comments at the top of that file for more
information.
A reference manual is available in the file doc/reference.html in this
distribution.
The homepage for this project is http://www.libexpat.org/. There
are links there to connect you to the bug reports page. If you need
to report a bug when you don't have access to a browser, you may also
send a bug report by email to expat-bugs@mail.libexpat.org.
Discussion related to the direction of future expat development takes
place on expat-discuss@mail.libexpat.org. Archives of this list and
other Expat-related lists may be found at:
http://mail.libexpat.org/mailman/listinfo/

View File

@ -0,0 +1,32 @@
#ifndef AMIGACONFIG_H
#define AMIGACONFIG_H
/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
#define BYTEORDER 4321
/* Define to 1 if you have the `bcopy' function. */
#define HAVE_BCOPY 1
/* Define to 1 if you have the <check.h> header file. */
#undef HAVE_CHECK_H
/* Define to 1 if you have the `memmove' function. */
#define HAVE_MEMMOVE 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* whether byteorder is bigendian */
#define WORDS_BIGENDIAN
/* Define to specify how much context to retain around the current parse
point. */
#define XML_CONTEXT_BYTES 1024
/* Define to make parameter entity parsing functionality available. */
#define XML_DTD
/* Define to make XML Namespaces functionality available. */
#define XML_NS
#endif /* AMIGACONFIG_H */

View File

@ -0,0 +1,92 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
#define ASCII_A 0x41
#define ASCII_B 0x42
#define ASCII_C 0x43
#define ASCII_D 0x44
#define ASCII_E 0x45
#define ASCII_F 0x46
#define ASCII_G 0x47
#define ASCII_H 0x48
#define ASCII_I 0x49
#define ASCII_J 0x4A
#define ASCII_K 0x4B
#define ASCII_L 0x4C
#define ASCII_M 0x4D
#define ASCII_N 0x4E
#define ASCII_O 0x4F
#define ASCII_P 0x50
#define ASCII_Q 0x51
#define ASCII_R 0x52
#define ASCII_S 0x53
#define ASCII_T 0x54
#define ASCII_U 0x55
#define ASCII_V 0x56
#define ASCII_W 0x57
#define ASCII_X 0x58
#define ASCII_Y 0x59
#define ASCII_Z 0x5A
#define ASCII_a 0x61
#define ASCII_b 0x62
#define ASCII_c 0x63
#define ASCII_d 0x64
#define ASCII_e 0x65
#define ASCII_f 0x66
#define ASCII_g 0x67
#define ASCII_h 0x68
#define ASCII_i 0x69
#define ASCII_j 0x6A
#define ASCII_k 0x6B
#define ASCII_l 0x6C
#define ASCII_m 0x6D
#define ASCII_n 0x6E
#define ASCII_o 0x6F
#define ASCII_p 0x70
#define ASCII_q 0x71
#define ASCII_r 0x72
#define ASCII_s 0x73
#define ASCII_t 0x74
#define ASCII_u 0x75
#define ASCII_v 0x76
#define ASCII_w 0x77
#define ASCII_x 0x78
#define ASCII_y 0x79
#define ASCII_z 0x7A
#define ASCII_0 0x30
#define ASCII_1 0x31
#define ASCII_2 0x32
#define ASCII_3 0x33
#define ASCII_4 0x34
#define ASCII_5 0x35
#define ASCII_6 0x36
#define ASCII_7 0x37
#define ASCII_8 0x38
#define ASCII_9 0x39
#define ASCII_TAB 0x09
#define ASCII_SPACE 0x20
#define ASCII_EXCL 0x21
#define ASCII_QUOT 0x22
#define ASCII_AMP 0x26
#define ASCII_APOS 0x27
#define ASCII_MINUS 0x2D
#define ASCII_PERIOD 0x2E
#define ASCII_COLON 0x3A
#define ASCII_SEMI 0x3B
#define ASCII_LT 0x3C
#define ASCII_EQUALS 0x3D
#define ASCII_GT 0x3E
#define ASCII_LSQB 0x5B
#define ASCII_RSQB 0x5D
#define ASCII_UNDERSCORE 0x5F
#define ASCII_LPAREN 0x28
#define ASCII_RPAREN 0x29
#define ASCII_FF 0x0C
#define ASCII_SLASH 0x2F
#define ASCII_HASH 0x23
#define ASCII_PIPE 0x7C
#define ASCII_COMMA 0x2C

View File

@ -0,0 +1,36 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
/* 0x0C */ BT_NONXML, BT_CR, BT_NONXML, BT_NONXML,
/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,115 @@
/* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
#ifndef Expat_External_INCLUDED
#define Expat_External_INCLUDED 1
/* External API definitions */
#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
#define XML_USE_MSC_EXTENSIONS 1
#endif
/* Expat tries very hard to make the API boundary very specifically
defined. There are two macros defined to control this boundary;
each of these can be defined before including this header to
achieve some different behavior, but doing so it not recommended or
tested frequently.
XMLCALL - The calling convention to use for all calls across the
"library boundary." This will default to cdecl, and
try really hard to tell the compiler that's what we
want.
XMLIMPORT - Whatever magic is needed to note that a function is
to be imported from a dynamically loaded library
(.dll, .so, or .sl, depending on your platform).
The XMLCALL macro was added in Expat 1.95.7. The only one which is
expected to be directly useful in client code is XMLCALL.
Note that on at least some Unix versions, the Expat library must be
compiled with the cdecl calling convention as the default since
system headers may assume the cdecl convention.
*/
#ifndef XMLCALL
#if defined(_MSC_VER)
#define XMLCALL __cdecl
#elif defined(__GNUC__) && defined(__i386) && !defined(__INTEL_COMPILER)
#define XMLCALL __attribute__((cdecl))
#else
/* For any platform which uses this definition and supports more than
one calling convention, we need to extend this definition to
declare the convention used on that platform, if it's possible to
do so.
If this is the case for your platform, please file a bug report
with information on how to identify your platform via the C
pre-processor and how to specify the same calling convention as the
platform's malloc() implementation.
*/
#define XMLCALL
#endif
#endif /* not defined XMLCALL */
#if !defined(XML_STATIC) && !defined(XMLIMPORT)
#ifndef XML_BUILDING_EXPAT
/* using Expat from an application */
#ifdef XML_USE_MSC_EXTENSIONS
#define XMLIMPORT __declspec(dllimport)
#endif
#endif
#endif /* not defined XML_STATIC */
/* If we didn't define it above, define it away: */
#ifndef XMLIMPORT
#define XMLIMPORT
#endif
#define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
#ifdef __cplusplus
extern "C" {
#endif
#ifdef XML_UNICODE_WCHAR_T
#define XML_UNICODE
#endif
#ifdef XML_UNICODE /* Information is UTF-16 encoded. */
#ifdef XML_UNICODE_WCHAR_T
typedef wchar_t XML_Char;
typedef wchar_t XML_LChar;
#else
typedef unsigned short XML_Char;
typedef char XML_LChar;
#endif /* XML_UNICODE_WCHAR_T */
#else /* Information is UTF-8 encoded. */
typedef char XML_Char;
typedef char XML_LChar;
#endif /* XML_UNICODE */
#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
#if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
typedef __int64 XML_Index;
typedef unsigned __int64 XML_Size;
#else
typedef long long XML_Index;
typedef unsigned long long XML_Size;
#endif
#else
typedef long XML_Index;
typedef unsigned long XML_Size;
#endif /* XML_LARGE_SIZE */
#ifdef __cplusplus
}
#endif
#endif /* not Expat_External_INCLUDED */

View File

@ -0,0 +1,37 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
/* Like asciitab.h, except that 0xD has code BT_S rather than BT_CR */
/* 0x00 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x04 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x08 */ BT_NONXML, BT_S, BT_LF, BT_NONXML,
/* 0x0C */ BT_NONXML, BT_S, BT_NONXML, BT_NONXML,
/* 0x10 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x14 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x18 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x1C */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0x20 */ BT_S, BT_EXCL, BT_QUOT, BT_NUM,
/* 0x24 */ BT_OTHER, BT_PERCNT, BT_AMP, BT_APOS,
/* 0x28 */ BT_LPAR, BT_RPAR, BT_AST, BT_PLUS,
/* 0x2C */ BT_COMMA, BT_MINUS, BT_NAME, BT_SOL,
/* 0x30 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x34 */ BT_DIGIT, BT_DIGIT, BT_DIGIT, BT_DIGIT,
/* 0x38 */ BT_DIGIT, BT_DIGIT, BT_COLON, BT_SEMI,
/* 0x3C */ BT_LT, BT_EQUALS, BT_GT, BT_QUEST,
/* 0x40 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x44 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x48 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x4C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x50 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x54 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x58 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_LSQB,
/* 0x5C */ BT_OTHER, BT_RSQB, BT_OTHER, BT_NMSTRT,
/* 0x60 */ BT_OTHER, BT_HEX, BT_HEX, BT_HEX,
/* 0x64 */ BT_HEX, BT_HEX, BT_HEX, BT_NMSTRT,
/* 0x68 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x6C */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x70 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x74 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0x78 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
/* 0x7C */ BT_VERBAR, BT_OTHER, BT_OTHER, BT_OTHER,

View File

@ -0,0 +1,73 @@
/* internal.h
Internal definitions used by Expat. This is not needed to compile
client code.
The following calling convention macros are defined for frequently
called functions:
FASTCALL - Used for those internal functions that have a simple
body and a low number of arguments and local variables.
PTRCALL - Used for functions called though function pointers.
PTRFASTCALL - Like PTRCALL, but for low number of arguments.
inline - Used for selected internal functions for which inlining
may improve performance on some platforms.
Note: Use of these macros is based on judgement, not hard rules,
and therefore subject to change.
*/
#if defined(__GNUC__) && defined(__i386__) && !defined(__MINGW32__)
/* We'll use this version by default only where we know it helps.
regparm() generates warnings on Solaris boxes. See SF bug #692878.
Instability reported with egcs on a RedHat Linux 7.3.
Let's comment out:
#define FASTCALL __attribute__((stdcall, regparm(3)))
and let's try this:
*/
#define FASTCALL __attribute__((regparm(3)))
#define PTRFASTCALL __attribute__((regparm(3)))
#endif
/* Using __fastcall seems to have an unexpected negative effect under
MS VC++, especially for function pointers, so we won't use it for
now on that platform. It may be reconsidered for a future release
if it can be made more effective.
Likely reason: __fastcall on Windows is like stdcall, therefore
the compiler cannot perform stack optimizations for call clusters.
*/
/* Make sure all of these are defined if they aren't already. */
#ifndef FASTCALL
#define FASTCALL
#endif
#ifndef PTRCALL
#define PTRCALL
#endif
#ifndef PTRFASTCALL
#define PTRFASTCALL
#endif
#ifndef XML_MIN_SIZE
#if !defined(__cplusplus) && !defined(inline)
#ifdef __GNUC__
#define inline __inline
#endif /* __GNUC__ */
#endif
#endif /* XML_MIN_SIZE */
#ifdef __cplusplus
#define inline inline
#else
#ifndef inline
#define inline
#endif
#endif

View File

@ -0,0 +1,36 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
/* 0x80 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x84 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x88 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x8C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x90 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x94 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x98 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0x9C */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xA0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xA4 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xA8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER,
/* 0xAC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xB0 */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xB4 */ BT_OTHER, BT_NMSTRT, BT_OTHER, BT_NAME,
/* 0xB8 */ BT_OTHER, BT_OTHER, BT_NMSTRT, BT_OTHER,
/* 0xBC */ BT_OTHER, BT_OTHER, BT_OTHER, BT_OTHER,
/* 0xC0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xC4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xC8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xCC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xD0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xD4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
/* 0xD8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xDC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xE0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xE4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xE8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xEC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xF0 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xF4 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_OTHER,
/* 0xF8 */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,
/* 0xFC */ BT_NMSTRT, BT_NMSTRT, BT_NMSTRT, BT_NMSTRT,

View File

@ -0,0 +1,53 @@
/*================================================================
** Copyright 2000, Clark Cooper
** All rights reserved.
**
** This is free software. You are permitted to copy, distribute, or modify
** it under the terms of the MIT/X license (contained in the COPYING file
** with this distribution.)
**
*/
#ifndef MACCONFIG_H
#define MACCONFIG_H
/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
#define BYTEORDER 4321
/* Define to 1 if you have the `bcopy' function. */
#undef HAVE_BCOPY
/* Define to 1 if you have the `memmove' function. */
#define HAVE_MEMMOVE
/* Define to 1 if you have a working `mmap' system call. */
#undef HAVE_MMAP
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* whether byteorder is bigendian */
#define WORDS_BIGENDIAN
/* Define to specify how much context to retain around the current parse
point. */
#undef XML_CONTEXT_BYTES
/* Define to make parameter entity parsing functionality available. */
#define XML_DTD
/* Define to make XML Namespaces functionality available. */
#define XML_NS
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `long' if <sys/types.h> does not define. */
#define off_t long
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
#endif /* ifndef MACCONFIG_H */

View File

@ -0,0 +1,150 @@
static const unsigned namingBitmap[] = {
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
0x00000000, 0x04000000, 0x87FFFFFE, 0x07FFFFFE,
0x00000000, 0x00000000, 0xFF7FFFFF, 0xFF7FFFFF,
0xFFFFFFFF, 0x7FF3FFFF, 0xFFFFFDFE, 0x7FFFFFFF,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFE00F, 0xFC31FFFF,
0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF,
0xFFFFFFFF, 0xF80001FF, 0x00000003, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0xFFFFD740, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD,
0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF,
0xFFFF0003, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF,
0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE,
0x0000007F, 0x00000000, 0xFFFF0000, 0x000707FF,
0x00000000, 0x07FFFFFE, 0x000007FE, 0xFFFE0000,
0xFFFFFFFF, 0x7CFFFFFF, 0x002F7FFF, 0x00000060,
0xFFFFFFE0, 0x23FFFFFF, 0xFF000000, 0x00000003,
0xFFF99FE0, 0x03C5FDFF, 0xB0000000, 0x00030003,
0xFFF987E0, 0x036DFDFF, 0x5E000000, 0x001C0000,
0xFFFBAFE0, 0x23EDFDFF, 0x00000000, 0x00000001,
0xFFF99FE0, 0x23CDFDFF, 0xB0000000, 0x00000003,
0xD63DC7E0, 0x03BFC718, 0x00000000, 0x00000000,
0xFFFDDFE0, 0x03EFFDFF, 0x00000000, 0x00000003,
0xFFFDDFE0, 0x03EFFDFF, 0x40000000, 0x00000003,
0xFFFDDFE0, 0x03FFFDFF, 0x00000000, 0x00000003,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0xFFFFFFFE, 0x000D7FFF, 0x0000003F, 0x00000000,
0xFEF02596, 0x200D6CAE, 0x0000001F, 0x00000000,
0x00000000, 0x00000000, 0xFFFFFEFF, 0x000003FF,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0xFFFFFFFF, 0xFFFF003F, 0x007FFFFF,
0x0007DAED, 0x50000000, 0x82315001, 0x002C62AB,
0x40000000, 0xF580C900, 0x00000007, 0x02010800,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
0x0FFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x03FFFFFF,
0x3F3FFFFF, 0xFFFFFFFF, 0xAAFF3F3F, 0x3FFFFFFF,
0xFFFFFFFF, 0x5FDFFFFF, 0x0FCF1FDC, 0x1FDC1FFF,
0x00000000, 0x00004C40, 0x00000000, 0x00000000,
0x00000007, 0x00000000, 0x00000000, 0x00000000,
0x00000080, 0x000003FE, 0xFFFFFFFE, 0xFFFFFFFF,
0x001FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x07FFFFFF,
0xFFFFFFE0, 0x00001FFF, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
0xFFFFFFFF, 0x0000003F, 0x00000000, 0x00000000,
0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,
0xFFFFFFFF, 0x0000000F, 0x00000000, 0x00000000,
0x00000000, 0x07FF6000, 0x87FFFFFE, 0x07FFFFFE,
0x00000000, 0x00800000, 0xFF7FFFFF, 0xFF7FFFFF,
0x00FFFFFF, 0x00000000, 0xFFFF0000, 0xFFFFFFFF,
0xFFFFFFFF, 0xF80001FF, 0x00030003, 0x00000000,
0xFFFFFFFF, 0xFFFFFFFF, 0x0000003F, 0x00000003,
0xFFFFD7C0, 0xFFFFFFFB, 0x547F7FFF, 0x000FFFFD,
0xFFFFDFFE, 0xFFFFFFFF, 0xDFFEFFFF, 0xFFFFFFFF,
0xFFFF007B, 0xFFFFFFFF, 0xFFFF199F, 0x033FCFFF,
0x00000000, 0xFFFE0000, 0x027FFFFF, 0xFFFFFFFE,
0xFFFE007F, 0xBBFFFFFB, 0xFFFF0016, 0x000707FF,
0x00000000, 0x07FFFFFE, 0x0007FFFF, 0xFFFF03FF,
0xFFFFFFFF, 0x7CFFFFFF, 0xFFEF7FFF, 0x03FF3DFF,
0xFFFFFFEE, 0xF3FFFFFF, 0xFF1E3FFF, 0x0000FFCF,
0xFFF99FEE, 0xD3C5FDFF, 0xB080399F, 0x0003FFCF,
0xFFF987E4, 0xD36DFDFF, 0x5E003987, 0x001FFFC0,
0xFFFBAFEE, 0xF3EDFDFF, 0x00003BBF, 0x0000FFC1,
0xFFF99FEE, 0xF3CDFDFF, 0xB0C0398F, 0x0000FFC3,
0xD63DC7EC, 0xC3BFC718, 0x00803DC7, 0x0000FF80,
0xFFFDDFEE, 0xC3EFFDFF, 0x00603DDF, 0x0000FFC3,
0xFFFDDFEC, 0xC3EFFDFF, 0x40603DDF, 0x0000FFC3,
0xFFFDDFEC, 0xC3FFFDFF, 0x00803DCF, 0x0000FFC3,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0xFFFFFFFE, 0x07FF7FFF, 0x03FF7FFF, 0x00000000,
0xFEF02596, 0x3BFF6CAE, 0x03FF3F5F, 0x00000000,
0x03000000, 0xC2A003FF, 0xFFFFFEFF, 0xFFFE03FF,
0xFEBF0FDF, 0x02FE3FFF, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x1FFF0000, 0x00000002,
0x000000A0, 0x003EFFFE, 0xFFFFFFFE, 0xFFFFFFFF,
0x661FFFFF, 0xFFFFFFFE, 0xFFFFFFFF, 0x77FFFFFF,
};
static const unsigned char nmstrtPages[] = {
0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00,
0x00, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13,
0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x15, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static const unsigned char namePages[] = {
0x19, 0x03, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x00,
0x00, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25,
0x10, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x13,
0x26, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x27, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x17,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x18,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};

View File

@ -0,0 +1,37 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
/* 0x80 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x84 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x88 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x8C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x90 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x94 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x98 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0x9C */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xA0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xA4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xA8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xAC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xB0 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xB4 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xB8 */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xBC */ BT_TRAIL, BT_TRAIL, BT_TRAIL, BT_TRAIL,
/* 0xC0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xC4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xC8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xCC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xD0 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xD4 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xD8 */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xDC */ BT_LEAD2, BT_LEAD2, BT_LEAD2, BT_LEAD2,
/* 0xE0 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
/* 0xE4 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
/* 0xE8 */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
/* 0xEC */ BT_LEAD3, BT_LEAD3, BT_LEAD3, BT_LEAD3,
/* 0xF0 */ BT_LEAD4, BT_LEAD4, BT_LEAD4, BT_LEAD4,
/* 0xF4 */ BT_LEAD4, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0xF8 */ BT_NONXML, BT_NONXML, BT_NONXML, BT_NONXML,
/* 0xFC */ BT_NONXML, BT_NONXML, BT_MALFORM, BT_MALFORM,

View File

@ -0,0 +1,30 @@
/*================================================================
** Copyright 2000, Clark Cooper
** All rights reserved.
**
** This is free software. You are permitted to copy, distribute, or modify
** it under the terms of the MIT/X license (contained in the COPYING file
** with this distribution.)
*/
#ifndef WINCONFIG_H
#define WINCONFIG_H
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
#include <memory.h>
#include <string.h>
#define XML_NS 1
#define XML_DTD 1
#define XML_CONTEXT_BYTES 1024
/* we will assume all Windows platforms are little endian */
#define BYTEORDER 1234
/* Windows has memmove() available. */
#define HAVE_MEMMOVE
#endif /* ndef WINCONFIG_H */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,114 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
#ifndef XmlRole_INCLUDED
#define XmlRole_INCLUDED 1
#ifdef __VMS
/* 0 1 2 3 0 1 2 3
1234567890123456789012345678901 1234567890123456789012345678901 */
#define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt
#endif
#include "xmltok.h"
#ifdef __cplusplus
extern "C" {
#endif
enum {
XML_ROLE_ERROR = -1,
XML_ROLE_NONE = 0,
XML_ROLE_XML_DECL,
XML_ROLE_INSTANCE_START,
XML_ROLE_DOCTYPE_NONE,
XML_ROLE_DOCTYPE_NAME,
XML_ROLE_DOCTYPE_SYSTEM_ID,
XML_ROLE_DOCTYPE_PUBLIC_ID,
XML_ROLE_DOCTYPE_INTERNAL_SUBSET,
XML_ROLE_DOCTYPE_CLOSE,
XML_ROLE_GENERAL_ENTITY_NAME,
XML_ROLE_PARAM_ENTITY_NAME,
XML_ROLE_ENTITY_NONE,
XML_ROLE_ENTITY_VALUE,
XML_ROLE_ENTITY_SYSTEM_ID,
XML_ROLE_ENTITY_PUBLIC_ID,
XML_ROLE_ENTITY_COMPLETE,
XML_ROLE_ENTITY_NOTATION_NAME,
XML_ROLE_NOTATION_NONE,
XML_ROLE_NOTATION_NAME,
XML_ROLE_NOTATION_SYSTEM_ID,
XML_ROLE_NOTATION_NO_SYSTEM_ID,
XML_ROLE_NOTATION_PUBLIC_ID,
XML_ROLE_ATTRIBUTE_NAME,
XML_ROLE_ATTRIBUTE_TYPE_CDATA,
XML_ROLE_ATTRIBUTE_TYPE_ID,
XML_ROLE_ATTRIBUTE_TYPE_IDREF,
XML_ROLE_ATTRIBUTE_TYPE_IDREFS,
XML_ROLE_ATTRIBUTE_TYPE_ENTITY,
XML_ROLE_ATTRIBUTE_TYPE_ENTITIES,
XML_ROLE_ATTRIBUTE_TYPE_NMTOKEN,
XML_ROLE_ATTRIBUTE_TYPE_NMTOKENS,
XML_ROLE_ATTRIBUTE_ENUM_VALUE,
XML_ROLE_ATTRIBUTE_NOTATION_VALUE,
XML_ROLE_ATTLIST_NONE,
XML_ROLE_ATTLIST_ELEMENT_NAME,
XML_ROLE_IMPLIED_ATTRIBUTE_VALUE,
XML_ROLE_REQUIRED_ATTRIBUTE_VALUE,
XML_ROLE_DEFAULT_ATTRIBUTE_VALUE,
XML_ROLE_FIXED_ATTRIBUTE_VALUE,
XML_ROLE_ELEMENT_NONE,
XML_ROLE_ELEMENT_NAME,
XML_ROLE_CONTENT_ANY,
XML_ROLE_CONTENT_EMPTY,
XML_ROLE_CONTENT_PCDATA,
XML_ROLE_GROUP_OPEN,
XML_ROLE_GROUP_CLOSE,
XML_ROLE_GROUP_CLOSE_REP,
XML_ROLE_GROUP_CLOSE_OPT,
XML_ROLE_GROUP_CLOSE_PLUS,
XML_ROLE_GROUP_CHOICE,
XML_ROLE_GROUP_SEQUENCE,
XML_ROLE_CONTENT_ELEMENT,
XML_ROLE_CONTENT_ELEMENT_REP,
XML_ROLE_CONTENT_ELEMENT_OPT,
XML_ROLE_CONTENT_ELEMENT_PLUS,
XML_ROLE_PI,
XML_ROLE_COMMENT,
#ifdef XML_DTD
XML_ROLE_TEXT_DECL,
XML_ROLE_IGNORE_SECT,
XML_ROLE_INNER_PARAM_ENTITY_REF,
#endif /* XML_DTD */
XML_ROLE_PARAM_ENTITY_REF
};
typedef struct prolog_state {
int (PTRCALL *handler) (struct prolog_state *state,
int tok,
const char *ptr,
const char *end,
const ENCODING *enc);
unsigned level;
int role_none;
#ifdef XML_DTD
unsigned includeLevel;
int documentEntity;
int inEntityValue;
#endif /* XML_DTD */
} PROLOG_STATE;
void XmlPrologStateInit(PROLOG_STATE *);
#ifdef XML_DTD
void XmlPrologStateInitExternalEntity(PROLOG_STATE *);
#endif /* XML_DTD */
#define XmlTokenRole(state, tok, ptr, end, enc) \
(((state)->handler)(state, tok, ptr, end, enc))
#ifdef __cplusplus
}
#endif
#endif /* not XmlRole_INCLUDED */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,316 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
#ifndef XmlTok_INCLUDED
#define XmlTok_INCLUDED 1
#ifdef __cplusplus
extern "C" {
#endif
/* The following token may be returned by XmlContentTok */
#define XML_TOK_TRAILING_RSQB -5 /* ] or ]] at the end of the scan; might be
start of illegal ]]> sequence */
/* The following tokens may be returned by both XmlPrologTok and
XmlContentTok.
*/
#define XML_TOK_NONE -4 /* The string to be scanned is empty */
#define XML_TOK_TRAILING_CR -3 /* A CR at the end of the scan;
might be part of CRLF sequence */
#define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */
#define XML_TOK_PARTIAL -1 /* only part of a token */
#define XML_TOK_INVALID 0
/* The following tokens are returned by XmlContentTok; some are also
returned by XmlAttributeValueTok, XmlEntityTok, XmlCdataSectionTok.
*/
#define XML_TOK_START_TAG_WITH_ATTS 1
#define XML_TOK_START_TAG_NO_ATTS 2
#define XML_TOK_EMPTY_ELEMENT_WITH_ATTS 3 /* empty element tag <e/> */
#define XML_TOK_EMPTY_ELEMENT_NO_ATTS 4
#define XML_TOK_END_TAG 5
#define XML_TOK_DATA_CHARS 6
#define XML_TOK_DATA_NEWLINE 7
#define XML_TOK_CDATA_SECT_OPEN 8
#define XML_TOK_ENTITY_REF 9
#define XML_TOK_CHAR_REF 10 /* numeric character reference */
/* The following tokens may be returned by both XmlPrologTok and
XmlContentTok.
*/
#define XML_TOK_PI 11 /* processing instruction */
#define XML_TOK_XML_DECL 12 /* XML decl or text decl */
#define XML_TOK_COMMENT 13
#define XML_TOK_BOM 14 /* Byte order mark */
/* The following tokens are returned only by XmlPrologTok */
#define XML_TOK_PROLOG_S 15
#define XML_TOK_DECL_OPEN 16 /* <!foo */
#define XML_TOK_DECL_CLOSE 17 /* > */
#define XML_TOK_NAME 18
#define XML_TOK_NMTOKEN 19
#define XML_TOK_POUND_NAME 20 /* #name */
#define XML_TOK_OR 21 /* | */
#define XML_TOK_PERCENT 22
#define XML_TOK_OPEN_PAREN 23
#define XML_TOK_CLOSE_PAREN 24
#define XML_TOK_OPEN_BRACKET 25
#define XML_TOK_CLOSE_BRACKET 26
#define XML_TOK_LITERAL 27
#define XML_TOK_PARAM_ENTITY_REF 28
#define XML_TOK_INSTANCE_START 29
/* The following occur only in element type declarations */
#define XML_TOK_NAME_QUESTION 30 /* name? */
#define XML_TOK_NAME_ASTERISK 31 /* name* */
#define XML_TOK_NAME_PLUS 32 /* name+ */
#define XML_TOK_COND_SECT_OPEN 33 /* <![ */
#define XML_TOK_COND_SECT_CLOSE 34 /* ]]> */
#define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */
#define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */
#define XML_TOK_CLOSE_PAREN_PLUS 37 /* )+ */
#define XML_TOK_COMMA 38
/* The following token is returned only by XmlAttributeValueTok */
#define XML_TOK_ATTRIBUTE_VALUE_S 39
/* The following token is returned only by XmlCdataSectionTok */
#define XML_TOK_CDATA_SECT_CLOSE 40
/* With namespace processing this is returned by XmlPrologTok for a
name with a colon.
*/
#define XML_TOK_PREFIXED_NAME 41
#ifdef XML_DTD
#define XML_TOK_IGNORE_SECT 42
#endif /* XML_DTD */
#ifdef XML_DTD
#define XML_N_STATES 4
#else /* not XML_DTD */
#define XML_N_STATES 3
#endif /* not XML_DTD */
#define XML_PROLOG_STATE 0
#define XML_CONTENT_STATE 1
#define XML_CDATA_SECTION_STATE 2
#ifdef XML_DTD
#define XML_IGNORE_SECTION_STATE 3
#endif /* XML_DTD */
#define XML_N_LITERAL_TYPES 2
#define XML_ATTRIBUTE_VALUE_LITERAL 0
#define XML_ENTITY_VALUE_LITERAL 1
/* The size of the buffer passed to XmlUtf8Encode must be at least this. */
#define XML_UTF8_ENCODE_MAX 4
/* The size of the buffer passed to XmlUtf16Encode must be at least this. */
#define XML_UTF16_ENCODE_MAX 2
typedef struct position {
/* first line and first column are 0 not 1 */
XML_Size lineNumber;
XML_Size columnNumber;
} POSITION;
typedef struct {
const char *name;
const char *valuePtr;
const char *valueEnd;
char normalized;
} ATTRIBUTE;
struct encoding;
typedef struct encoding ENCODING;
typedef int (PTRCALL *SCANNER)(const ENCODING *,
const char *,
const char *,
const char **);
struct encoding {
SCANNER scanners[XML_N_STATES];
SCANNER literalScanners[XML_N_LITERAL_TYPES];
int (PTRCALL *sameName)(const ENCODING *,
const char *,
const char *);
int (PTRCALL *nameMatchesAscii)(const ENCODING *,
const char *,
const char *,
const char *);
int (PTRFASTCALL *nameLength)(const ENCODING *, const char *);
const char *(PTRFASTCALL *skipS)(const ENCODING *, const char *);
int (PTRCALL *getAtts)(const ENCODING *enc,
const char *ptr,
int attsMax,
ATTRIBUTE *atts);
int (PTRFASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr);
int (PTRCALL *predefinedEntityName)(const ENCODING *,
const char *,
const char *);
void (PTRCALL *updatePosition)(const ENCODING *,
const char *ptr,
const char *end,
POSITION *);
int (PTRCALL *isPublicId)(const ENCODING *enc,
const char *ptr,
const char *end,
const char **badPtr);
void (PTRCALL *utf8Convert)(const ENCODING *enc,
const char **fromP,
const char *fromLim,
char **toP,
const char *toLim);
void (PTRCALL *utf16Convert)(const ENCODING *enc,
const char **fromP,
const char *fromLim,
unsigned short **toP,
const unsigned short *toLim);
int minBytesPerChar;
char isUtf8;
char isUtf16;
};
/* Scan the string starting at ptr until the end of the next complete
token, but do not scan past eptr. Return an integer giving the
type of token.
Return XML_TOK_NONE when ptr == eptr; nextTokPtr will not be set.
Return XML_TOK_PARTIAL when the string does not contain a complete
token; nextTokPtr will not be set.
Return XML_TOK_INVALID when the string does not start a valid
token; nextTokPtr will be set to point to the character which made
the token invalid.
Otherwise the string starts with a valid token; nextTokPtr will be
set to point to the character following the end of that token.
Each data character counts as a single token, but adjacent data
characters may be returned together. Similarly for characters in
the prolog outside literals, comments and processing instructions.
*/
#define XmlTok(enc, state, ptr, end, nextTokPtr) \
(((enc)->scanners[state])(enc, ptr, end, nextTokPtr))
#define XmlPrologTok(enc, ptr, end, nextTokPtr) \
XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr)
#define XmlContentTok(enc, ptr, end, nextTokPtr) \
XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr)
#define XmlCdataSectionTok(enc, ptr, end, nextTokPtr) \
XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr)
#ifdef XML_DTD
#define XmlIgnoreSectionTok(enc, ptr, end, nextTokPtr) \
XmlTok(enc, XML_IGNORE_SECTION_STATE, ptr, end, nextTokPtr)
#endif /* XML_DTD */
/* This is used for performing a 2nd-level tokenization on the content
of a literal that has already been returned by XmlTok.
*/
#define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \
(((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr))
#define XmlAttributeValueTok(enc, ptr, end, nextTokPtr) \
XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr)
#define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \
XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr)
#define XmlSameName(enc, ptr1, ptr2) (((enc)->sameName)(enc, ptr1, ptr2))
#define XmlNameMatchesAscii(enc, ptr1, end1, ptr2) \
(((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2))
#define XmlNameLength(enc, ptr) \
(((enc)->nameLength)(enc, ptr))
#define XmlSkipS(enc, ptr) \
(((enc)->skipS)(enc, ptr))
#define XmlGetAttributes(enc, ptr, attsMax, atts) \
(((enc)->getAtts)(enc, ptr, attsMax, atts))
#define XmlCharRefNumber(enc, ptr) \
(((enc)->charRefNumber)(enc, ptr))
#define XmlPredefinedEntityName(enc, ptr, end) \
(((enc)->predefinedEntityName)(enc, ptr, end))
#define XmlUpdatePosition(enc, ptr, end, pos) \
(((enc)->updatePosition)(enc, ptr, end, pos))
#define XmlIsPublicId(enc, ptr, end, badPtr) \
(((enc)->isPublicId)(enc, ptr, end, badPtr))
#define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) \
(((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim))
#define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) \
(((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim))
typedef struct {
ENCODING initEnc;
const ENCODING **encPtr;
} INIT_ENCODING;
int XmlParseXmlDecl(int isGeneralTextEntity,
const ENCODING *enc,
const char *ptr,
const char *end,
const char **badPtr,
const char **versionPtr,
const char **versionEndPtr,
const char **encodingNamePtr,
const ENCODING **namedEncodingPtr,
int *standalonePtr);
int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name);
const ENCODING *XmlGetUtf8InternalEncoding(void);
const ENCODING *XmlGetUtf16InternalEncoding(void);
int FASTCALL XmlUtf8Encode(int charNumber, char *buf);
int FASTCALL XmlUtf16Encode(int charNumber, unsigned short *buf);
int XmlSizeOfUnknownEncoding(void);
typedef int (XMLCALL *CONVERTER) (void *userData, const char *p);
ENCODING *
XmlInitUnknownEncoding(void *mem,
int *table,
CONVERTER convert,
void *userData);
int XmlParseXmlDeclNS(int isGeneralTextEntity,
const ENCODING *enc,
const char *ptr,
const char *end,
const char **badPtr,
const char **versionPtr,
const char **versionEndPtr,
const char **encodingNamePtr,
const ENCODING **namedEncodingPtr,
int *standalonePtr);
int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name);
const ENCODING *XmlGetUtf8InternalEncodingNS(void);
const ENCODING *XmlGetUtf16InternalEncodingNS(void);
ENCODING *
XmlInitUnknownEncodingNS(void *mem,
int *table,
CONVERTER convert,
void *userData);
#ifdef __cplusplus
}
#endif
#endif /* not XmlTok_INCLUDED */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,46 @@
/*
Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
enum {
BT_NONXML,
BT_MALFORM,
BT_LT,
BT_AMP,
BT_RSQB,
BT_LEAD2,
BT_LEAD3,
BT_LEAD4,
BT_TRAIL,
BT_CR,
BT_LF,
BT_GT,
BT_QUOT,
BT_APOS,
BT_EQUALS,
BT_QUEST,
BT_EXCL,
BT_SOL,
BT_SEMI,
BT_NUM,
BT_LSQB,
BT_S,
BT_NMSTRT,
BT_COLON,
BT_HEX,
BT_DIGIT,
BT_NAME,
BT_MINUS,
BT_OTHER, /* known not to be a name or name start character */
BT_NONASCII, /* might be a name or name start character */
BT_PERCNT,
BT_LPAR,
BT_RPAR,
BT_AST,
BT_PLUS,
BT_COMMA,
BT_VERBAR
};
#include <stddef.h>

View File

@ -0,0 +1,115 @@
/* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
See the file COPYING for copying permission.
*/
/* This file is included! */
#ifdef XML_TOK_NS_C
const ENCODING *
NS(XmlGetUtf8InternalEncoding)(void)
{
return &ns(internal_utf8_encoding).enc;
}
const ENCODING *
NS(XmlGetUtf16InternalEncoding)(void)
{
#if BYTEORDER == 1234
return &ns(internal_little2_encoding).enc;
#elif BYTEORDER == 4321
return &ns(internal_big2_encoding).enc;
#else
const short n = 1;
return (*(const char *)&n
? &ns(internal_little2_encoding).enc
: &ns(internal_big2_encoding).enc);
#endif
}
static const ENCODING * const NS(encodings)[] = {
&ns(latin1_encoding).enc,
&ns(ascii_encoding).enc,
&ns(utf8_encoding).enc,
&ns(big2_encoding).enc,
&ns(big2_encoding).enc,
&ns(little2_encoding).enc,
&ns(utf8_encoding).enc /* NO_ENC */
};
static int PTRCALL
NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end,
const char **nextTokPtr)
{
return initScan(NS(encodings), (const INIT_ENCODING *)enc,
XML_PROLOG_STATE, ptr, end, nextTokPtr);
}
static int PTRCALL
NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end,
const char **nextTokPtr)
{
return initScan(NS(encodings), (const INIT_ENCODING *)enc,
XML_CONTENT_STATE, ptr, end, nextTokPtr);
}
int
NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr,
const char *name)
{
int i = getEncodingIndex(name);
if (i == UNKNOWN_ENC)
return 0;
SET_INIT_ENC_INDEX(p, i);
p->initEnc.scanners[XML_PROLOG_STATE] = NS(initScanProlog);
p->initEnc.scanners[XML_CONTENT_STATE] = NS(initScanContent);
p->initEnc.updatePosition = initUpdatePosition;
p->encPtr = encPtr;
*encPtr = &(p->initEnc);
return 1;
}
static const ENCODING *
NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end)
{
#define ENCODING_MAX 128
char buf[ENCODING_MAX];
char *p = buf;
int i;
XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);
if (ptr != end)
return 0;
*p = 0;
if (streqci(buf, KW_UTF_16) && enc->minBytesPerChar == 2)
return enc;
i = getEncodingIndex(buf);
if (i == UNKNOWN_ENC)
return 0;
return NS(encodings)[i];
}
int
NS(XmlParseXmlDecl)(int isGeneralTextEntity,
const ENCODING *enc,
const char *ptr,
const char *end,
const char **badPtr,
const char **versionPtr,
const char **versionEndPtr,
const char **encodingName,
const ENCODING **encoding,
int *standalone)
{
return doParseXmlDecl(NS(findEncoding),
isGeneralTextEntity,
enc,
ptr,
end,
badPtr,
versionPtr,
versionEndPtr,
encodingName,
encoding,
standalone);
}
#endif /* XML_TOK_NS_C */

View File

@ -1,4 +1,4 @@
// $Id: mcsignature.cpp,v 1.6 2023/12/03 16:16:13 cvsuser Exp $
// $Id: mcsignature.cpp,v 1.7 2025/03/09 13:43:38 cvsuser Exp $
//
// AutoUpdater: Manifest generation tool.
//

View File

@ -81,12 +81,17 @@ const char * mc_EXTHELPERSDIR(void);
#define EXTHELPERSDIR mc_EXTHELPERSDIR() /* ???, 4.8.7 */
extern void WIN32_Setup(void);
extern void WIN32_HeapInit(void);
extern int WIN32_HeapCheck(void);
extern FILE * win32_popen(const char *cmd, const char *mode);
extern int win32_pclose(FILE *file);
extern void win32_ptrace(void);
extern int win32_perror(int error, const char *msg);
extern void mc_setenv(const char *name, const char *value, int overwrite);
extern void mc_setpathenv(const char *name, const char *value, int overwrite, int quote_ws);
#if !defined(popen)
#define popen(__cmd,__mode) win32_popen(__cmd, __mode)
#define pclose(__file) win32_pclose(__file)
@ -191,3 +196,4 @@ extern void tty_set_title(const char *title);
#define PROMOTED_MODE_T int
#endif /*CONFIG_H_INCLUDED*/

View File

@ -1,5 +1,5 @@
glib-2.*
*.org
*.org*
.unpacked.*
Makefile
*.err

View File

@ -1,5 +1,5 @@
glib-2.*/
*.org
*.org*
.unpacked.*
Makefile
*.err

Binary file not shown.

View File

@ -0,0 +1,83 @@
Source: glib-2.54.3
o galloca.h
OWC:
+ # if defined(__WATCOMC__)
+ # include <malloc.h>
| # elif defined(_MSC_VER) || defined(__DMC__)
o gtypes.h:
OWC:
+ #if defined(__WATCOMC__)
+ # define GLIB_VAR extern __declspec(dllexport) /* remove multiple definition warnings */
+ #else
# define GLIB_VAR __declspec(dllexport)
+ #endif
o gatomic.c
OWC: ATOMIC_CAST()
o genviron.c
OWC: _wsetenv() replacement of _wputenv()
+ #if defined(__WATCOMC__)
+ wchar_t *wname, *wvalue;
+ #else
wchar_t *wname, *wvalue, *wassignment;
gchar *tem;
+ #endif
and
+ #if defined(__WATCOMC__)
+ _wsetenv (wname, wvalue, 1 /*overwrite*/);
+ #else
tem = g_strconcat (variable, "=", value, NULL);
wassignment = g_utf8_to_utf16 (tem, -1, NULL, NULL, NULL);
g_free (tem);
_wputenv (wassignment);
g_free (wassignment);
+ #endif
o gthread-deprecated.c:
OWC: structure initialisation
o grand.c:
OWC: #pragma message() replacement of #warning
o gstdio.c:
OWC:
#if (defined (__MINGW64_VERSION_MAJOR) || defined (_MSC_VER)) && !defined(_WIN64) && \
+ !defined(__WATCOMC__)
#undef _wstat
#define _wstat _wstat32
o gwin32.c:
OWC:
+ #if defined(__WATCOMC__) /* missing from OCW 1.9 DSK */
+ typedef struct _OSVERSIONINFOEXW *PRTL_OSVERSIONINFOEXW;
+ #endif //__WATCOMC__
+ #if defined(__WATCOMC__) && !defined(WC_NO_BEST_FIT_CHARS)
+ #define WC_NO_BEST_FIT_CHARS 0x00000400 // do not use best fit chars
+ #endif
o win_iconv.c:
+ #if defined(__WATCOMC__)
+ static int * _errno(void)
+ {
+ return __get_errno_ptr();
+ }
+ #endif

View File

@ -1,10 +1,10 @@
*2.27.0*
*2_27_0*
*3.3.*
*3.4.*
mbedtls-2.*/
mbedtls-3.*/
ref/
*2.27.0*
*2_27_0*
*3.*
*3_*
.unpacked.*
Makefile.in.*
Makefile

View File

@ -1,11 +1,14 @@
libssh2-1.8.0*
libssh2-1.9.0*
libssh2-1.10.0*
Makefile.in.1.10
libssh2-1.11.0/
libssh2-1.11.0.tgz
libssh2-1.11.1/
libssh2-1.11.0.tgz
libssh2-1.11.1.tgz
*1.9.0*
*1_9_0*
*1.10.0*
*1_10_0*
*1.11.*
*1_11_*
Makefile.in.1.10
.unpacked.*
Makefile
*.err

View File

@ -232,12 +232,13 @@ static __inline int vtnormal(const int color);
static void CopyIn(unsigned pos, unsigned cnt, WCHAR_INFO *image);
static void CopyOut(copyoutctx_t *ctx, unsigned offset, unsigned len, unsigned flags);
static void CopyOutLegacy(copyoutctx_t* ctx, unsigned pos, unsigned cnt, unsigned flags);
#if defined(WIN32_CONSOLEEXT)
#if defined(WIN32_CONSOLE256)
static void CopyOutEx(copyoutctx_t *ctx, unsigned pos, unsigned cnt, unsigned flags);
#define WIN32_CONSOLEVIRTUAL
#if defined(WIN32_CONSOLEVIRTUAL)
static void CopyOutEx2(copyoutctx_t *ctx, size_t pos, size_t cnt, unsigned flags);
static void CopyOutVirtual(copyoutctx_t *ctx, size_t pos, size_t cnt, unsigned flags);
#endif //WIN32_CONSOLEVIRTUAL
#endif //WIN32_CONSOLE256
static void UnderOutEx(copyoutctx_t *ctx, unsigned pos, unsigned cnt);
@ -1483,7 +1484,25 @@ CopyOutFinal(copyoutctx_t *ctx)
static void
CopyOut(copyoutctx_t *ctx, unsigned pos, unsigned cnt, unsigned flags)
CopyOut(copyoutctx_t* ctx, unsigned pos, unsigned cnt, unsigned flags)
{
#if defined(WIN32_CONSOLEVIRTUAL)
//
// windows 10+ virtual console.
if (vio.isvirtualconsole) {
CopyOutVirtual(ctx, pos, cnt, flags);
return;
}
#endif //WIN32_CONSOLEVIRTUAL
//
// legacy modes
CopyOutLegacy(ctx, pos, cnt, flags);
}
static void
CopyOutLegacy(copyoutctx_t *ctx, unsigned pos, unsigned cnt, unsigned flags)
{
const unsigned activecolors = (vio.displaymode || 0 == vio.activecolors ? 16 : vio.activecolors);
const int /*rows = vio.rows,*/ cols = vio.cols;
@ -1491,7 +1510,8 @@ CopyOut(copyoutctx_t *ctx, unsigned pos, unsigned cnt, unsigned flags)
COORD is = {0}, ic = {0};
SMALL_RECT wr = {0};
unsigned underline = 0, strike = 0, /* special attribute counts */
modcnt = vio.c_trashed|(flags&TRASHED); /* modified cell count */
mcnt = vio.c_trashed|(flags & TRASHED), /* modified cell count */
wcnt = 0; /* wide-character count */
WORD attr;
assert(pos < vio.size); /* starting position within window */
@ -1517,10 +1537,13 @@ CopyOut(copyoutctx_t *ctx, unsigned pos, unsigned cnt, unsigned flags)
attr = AttributesShadow(&cursor->Info);
if (oshadow->Attributes != attr ||
oshadow->Char.UnicodeChar != cursor->Char.UnicodeChar) {
oshadow->Char.UnicodeChar = (WCHAR)cursor->Char.UnicodeChar;
oshadow->Char.UnicodeChar != cursor->Char.UnicodeChar) {
const WCHAR wch = (WCHAR)cursor->Char.UnicodeChar;
if (0 == (oshadow->Char.UnicodeChar = wch)) {
++wcnt;
}
oshadow->Attributes = attr;
++modcnt;
++mcnt;
}
}
}
@ -1539,16 +1562,6 @@ CopyOut(copyoutctx_t *ctx, unsigned pos, unsigned cnt, unsigned flags)
#if defined(WIN32_CONSOLEEXT)
#if defined(WIN32_CONSOLE256)
if (activecolors > 16) {
#if defined(WIN32_CONSOLEVIRTUAL)
//
// windows 10 virtual console.
if (vio.isvirtualconsole) {
CopyOutEx2(ctx, pos, cnt, flags); // export text
return;
}
#endif //WIN32_CONSOLEVIRTUAL
// // update console buffer
// cursor-get
// cursor-hide
@ -1566,7 +1579,7 @@ CopyOut(copyoutctx_t *ctx, unsigned pos, unsigned cnt, unsigned flags)
}
}
if (modcnt) {
if (mcnt) {
const BOOL isvisible = IsWindowVisible(vio.whandle);
if (isvisible) { // flush changes, disable updates
@ -1584,8 +1597,35 @@ CopyOut(copyoutctx_t *ctx, unsigned pos, unsigned cnt, unsigned flags)
CopyOutEx(ctx, pos, cnt, flags); // export text
} else {
if (modcnt) {
WriteConsoleOutputW(chandle, vio.oshadow + pos, is, ic, &wr);
if (mcnt) {
if (wcnt) {
CHAR_INFO wcbuf[VIO_MAXCOLS], *wcend;
const CHAR_INFO *cursor = vio.oshadow + pos, *end;
const SHORT Bottom = wr.Bottom;
while (wr.Top <= Bottom) { // export line-by-line
SHORT nchrs = 0;
for (wcend = wcbuf, end = cursor + cols; cursor < end; ++cursor) {
if (cursor->Char.UnicodeChar) {
*wcend++ = *cursor; // omit padding
++nchrs;
}
}
wr.Bottom = wr.Top;
is.Y = (SHORT)(vio.rows - wr.Top);
is.X = nchrs;
WriteConsoleOutputW(chandle, wcbuf, is, ic, &wr);
++wr.Top;
}
} else {
WriteConsoleOutputW(chandle, vio.oshadow + pos, is, ic, &wr);
}
}
}
#endif //CONSOLE256
@ -1699,7 +1739,7 @@ COLOR256(const struct WCHAR_COLORINFO *color, COLORREF *fg, COLORREF *bg)
if (t_fg == t_bg) { // default, normal
t_fg = vio.rgb256[ COLIDX_FOREGROUND ];
t_bg = vio.rgb256[ COLIDX_BACKGROUND ];
if (t_fg == t_bg) { // fallback
if (t_fg == t_bg) { // fall-back
t_bg = vio.rgb256[ VT_COLOR_BLACK ];
t_fg = vio.rgb256[ VT_COLOR_LIGHT_GREY ];
}
@ -1754,7 +1794,6 @@ SameAttributesBG(const WCHAR_INFO *cell, const struct WCHAR_COLORINFO *info, con
}
/*private*/
/* Function: CopyOutEx
* Extended export characters within the specified region to the console window.
@ -1775,8 +1814,8 @@ CopyOutEx(copyoutctx_t *ctx, unsigned pos, unsigned cnt, unsigned flags)
const int rows = vio.rows, cols = vio.cols;
float fcwidth, fcheight; // proportional sizing
int row = (int)(pos / cols);
WCHAR textbuf[1024], // ExtTextOut limit 8192
*etext = textbuf + (sizeof(textbuf)/sizeof(textbuf[0]));
WCHAR wcbuf[1024], // ExtTextOut limit 8192
*wcend = wcbuf + (sizeof(wcbuf)/sizeof(wcbuf[0]));
HFONT oldfont;
HDC wdc;
@ -1800,23 +1839,29 @@ CopyOutEx(copyoutctx_t *ctx, unsigned pos, unsigned cnt, unsigned flags)
}
oldfont = SelectObject(wdc, vio.fnHandle); // base font
do { //forearch(row)
do { // foreach(row)
WCHAR_INFO *ocursor = vio.oimage + (row * cols);
int start = -1, col = 0;
struct WCHAR_COLORINFO info = {0}; // accumulator
COLORREF bg = (COLORREF)-1, fg = (COLORREF)-1; // current colors
WCHAR *text = NULL;
int col = 0;
while (col < cols) {
start = -1;
int start = -1;
do {
const WCHAR_INFO cell = *cursor++;
if (0 == cell.Char.UnicodeChar) {
ocursor[col++] = cell; // update out image
continue; // NUL, padding
}
if (start >= 0) { // attribute run
if (SameAttributesFGBG(&cell, &info, fg, bg, VIO_BOLD|VIO_BLINK|VIO_ITALIC|VIO_FAINT|VIO_INVERSE)) {
ocursor[col++] = cell; // update out image
*text = (WCHAR)cell.Char.UnicodeChar;
if (++text >= etext)
if (++text >= wcend)
break; // flush
continue;
} //else, attribute change
@ -1833,7 +1878,7 @@ CopyOutEx(copyoutctx_t *ctx, unsigned pos, unsigned cnt, unsigned flags)
// start of new draw arena
start = col++;
text = textbuf;
text = wcbuf;
info = cell.Info;
COLOR256(&info, &fg, &bg);
if (info.Attributes & VIO_INVERSE) {
@ -1880,12 +1925,12 @@ CopyOutEx(copyoutctx_t *ctx, unsigned pos, unsigned cnt, unsigned flags)
const int left = (int)(fcwidth * start);
const int top = (int)(fcheight * row);
HPEN oldbrush, oldpen;
const WCHAR *otext = textbuf;
const WCHAR *otext = wcbuf;
unsigned idx = 0;
oldbrush = SelectObject(wdc, CreateSolidBrush(bg));
oldpen = SelectObject(wdc, CreatePen(PS_SOLID, 0, bg));
Rectangle(wdc, left, top, left + (int)(fcwidth * (text - textbuf)), top + (int)fcheight);
Rectangle(wdc, left, top, left + (int)(fcwidth * (text - wcbuf)), top + (int)fcheight);
oldpen = SelectObject(wdc, oldpen);
oldbrush = SelectObject(wdc, oldbrush);
DeleteObject(oldpen);
@ -1894,11 +1939,14 @@ CopyOutEx(copyoutctx_t *ctx, unsigned pos, unsigned cnt, unsigned flags)
SetBkColor(wdc, bg);
SetTextColor(wdc, fg);
SetTextAlign(wdc, GetTextAlign(wdc) | TA_CENTER);
for (idx = 0; otext < text; ++idx) {
for (idx = 0; otext < text;) {
WCHAR t_ch = *otext++;
if (t_ch && !IsSpace(t_ch)) {
ExtTextOutW(wdc, left + (int)(fcwidth * (0.5 + idx)), top, ETO_OPAQUE, NULL, &t_ch, 1, NULL);
if (t_ch) { // omit padding
if (! IsSpace(t_ch)) {
ExtTextOutW(wdc, left + (int)(fcwidth * (0.5 + idx)), top, ETO_OPAQUE, NULL, &t_ch, 1, NULL);
}
++idx;
}
}
@ -1927,14 +1975,14 @@ CopyOutEx(copyoutctx_t *ctx, unsigned pos, unsigned cnt, unsigned flags)
#if defined(WIN32_CONSOLEVIRTUAL)
/* Function: CopyOutEx2
/* Function: CopyOutVirtual
* Virtual console drivers.
*
* Reference:
* https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences
*/
static void
CopyOutEx2(copyoutctx_t *ctx, size_t pos, size_t cnt, unsigned flags)
CopyOutVirtual(copyoutctx_t *ctx, size_t pos, size_t cnt, unsigned flags)
{
const WCHAR_INFO *cursor = vio.image + pos, *end = cursor + cnt;
HANDLE chandle = vio.chandle;
@ -1988,21 +2036,22 @@ CopyOutEx2(copyoutctx_t *ctx, size_t pos, size_t cnt, unsigned flags)
#define L_VTESC L"\x1b"
#define L_VTCSI L"\x1b["
do { //forearch(row)
do { // foreach(row)
WCHAR_INFO *ocursor = vio.oimage + (row * cols);
int start = -1, col = 0;
struct WCHAR_COLORINFO info = {0}; // accumulator
COLORREF bg = (COLORREF)-1, fg = (COLORREF)-1; // current colors
WCHAR *wctext = NULL;
int col = 0; // current column
while (col < cols) {
start = -1;
int start = -1; // start of change
do {
const WCHAR_INFO cell = *cursor++;
if (0 == cell.Char.UnicodeChar) {
++col;
continue; // NULL, padding
ocursor[col++] = cell; // update out image
continue; // NUL, padding
}
// ESC[<y>; <x> H CUP, Cursor Position *Cursor moves to <x>; <y> coordinate within the view-port, where <x> is the column of the <y> line.
@ -2689,7 +2738,7 @@ parse_color(const char *color, const char *defname, const struct attrmap *map, i
const int len = (int)(a - color);
strncpy(t_name, color, sizeof(t_name)-1);// remove attribute component.
if (len < (int)sizeof(t_name))
if (len < (int)sizeof(t_name))
t_name[len] = 0;
color = t_name;
@ -2927,7 +2976,6 @@ LIBVIO_API void
vio_restore(void)
{
HANDLE console = (vio.inited ? vio.chandle : GetStdHandle(STD_OUTPUT_HANDLE));
CONSOLE_SCREEN_BUFFER_INFO sbi = {0};
COORD iHome = {0,0};
CHAR_INFO * nimage;
int rows = 0, cols = 0;

View File

@ -1,5 +1,5 @@
#include <edidentifier.h>
__CIDENT_RCSID(gr_w32_dir_c, "$Id: w32_dir.c,v 1.27 2025/03/06 16:59:46 cvsuser Exp $")
__CIDENT_RCSID(gr_w32_dir_c, "$Id: w32_dir.c,v 1.28 2025/03/20 17:22:45 cvsuser Exp $")
/* -*- mode: c; indent-width: 4; -*- */
/*
@ -764,8 +764,8 @@ w32_expandlinkA(const char *name, char *buf, size_t buflen, unsigned flags)
memcpy(t_name, name, length + 1 /*nul*/);
for (cursor = t_name + length, end = cursor; --cursor >= t_name;) {
if ('.' == *cursor) { // extension
if (1 == ++dots) { // last/trailing
if ('.' == *cursor) { // extension
if (1 == ++dots) { // last/trailing
if (0 == w32_io_strnicmp(cursor, ".lnk", 4) && (cursor + 4) == end) {
//
// <shortcut>.lnk
@ -779,13 +779,13 @@ w32_expandlinkA(const char *name, char *buf, size_t buflen, unsigned flags)
if (flags & (term ? SHORTCUT_COMPONENT : SHORTCUT_TRAILING)) {
*end = 0; // remove trailing component.
*end = 0; // remove trailing component.
if ((t_ret = w32_readlinkA(t_name, buf, buflen)) > 0) {
if (buflen > (t_ret + trailing)) {
if (trailing) { // appending trailing component(s).
*end = term, memcpy(buf + t_ret, end, trailing + 1 /*nul*/);
}
ret = 1; // success.
ret = 1; // success.
}
}
}
@ -794,7 +794,7 @@ w32_expandlinkA(const char *name, char *buf, size_t buflen, unsigned flags)
}
} else if ('/' == *cursor || '\\' == *cursor) {
end = cursor; // new component.
end = cursor; // new component.
dots = 0;
}
}
@ -822,8 +822,8 @@ w32_expandlinkW(const wchar_t *name, wchar_t *buf, size_t buflen, unsigned flags
wmemcpy(t_name, name, length + 1 /*nul*/);
for (cursor = t_name + length, end = cursor; --cursor >= t_name;) {
if ('.' == *cursor) { // extension
if (1 == ++dots) { // last/trailing
if ('.' == *cursor) { // extension
if (1 == ++dots) { // last/trailing
if (0 == w32_io_wstrnicmp(cursor, ".lnk", 4) && (cursor + 4) == end) {
//
// <shortcut>.lnk
@ -837,13 +837,13 @@ w32_expandlinkW(const wchar_t *name, wchar_t *buf, size_t buflen, unsigned flags
if (flags & (term ? SHORTCUT_COMPONENT : SHORTCUT_TRAILING)) {
*end = 0; // remove trailing component.
*end = 0; // remove trailing component.
if ((t_ret = w32_readlinkW(t_name, buf, buflen)) > 0) {
if (buflen > (t_ret + trailing)) {
if (trailing) { // appending trailing component(s).
*end = term, wmemcpy(buf + t_ret, end, trailing + 1 /*nul*/);
}
ret = 1; // success.
ret = 1; // success.
}
}
}
@ -852,7 +852,7 @@ w32_expandlinkW(const wchar_t *name, wchar_t *buf, size_t buflen, unsigned flags
}
} else if ('/' == *cursor || '\\' == *cursor) {
end = cursor; // new component.
end = cursor; // new component.
dots = 0;
}
}

View File

@ -418,7 +418,7 @@ SLtt_tgetnum(const char *key)
if (0 == strcmp(key, "Co")) { // colors
if (vio.inited)
return vio.maxcolors; // 16 or 256
return WIN32_COLORS; // assumeed support
return WIN32_COLORS; // assumed support
}
}
return -1;
@ -463,7 +463,7 @@ SLsmg_gotorc(int r, int c)
/*
* SLsmg_get_row ---
* Retrieve the current cursor row corrdinate.
* Retrieve the current cursor row coordinate.
**/
int
SLsmg_get_row(void)
@ -474,7 +474,7 @@ SLsmg_get_row(void)
/*
* SLsmg_get_column ---
* Retrieve the current cursor column corrdinate.
* Retrieve the current cursor column coordinate.
**/
int
SLsmg_get_column(void)
@ -634,7 +634,7 @@ top: /* get here only on newline */
if (SLsmg_Display_Alt_Chars) cooked = acs_lookup(cooked);
flags |= WCHAR_UPDATE(cursor, cooked, color);
if (width > 1) { /* wide-character, NULL padding */
if (width > 1) { /* wide-character, NUL padding */
flags |= WCHAR_UPDATE(++cursor, 0, color);
++col;
}

View File

@ -1,5 +1,5 @@
#include <edidentifier.h>
__CIDENT_RCSID(gr_w32_sysconf_c,"$Id: w32_sysconf.c,v 1.4 2025/03/08 16:40:00 cvsuser Exp $")
__CIDENT_RCSID(gr_w32_sysconf_c,"$Id: w32_sysconf.c,v 1.5 2025/03/20 17:23:09 cvsuser Exp $")
/* -*- mode: c; indent-width: 4; -*- */
/*
@ -176,7 +176,6 @@ GetProcessorInfo(struct ProcessorInfo *pi)
{
SYSTEM_LOGICAL_PROCESSOR_INFORMATION *slpi = NULL;
DWORD len = 0;
int count = 0;
while (! GetLogicalProcessorInformation(slpi, &len)) {
if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
@ -217,6 +216,8 @@ GetProcessorInfo(struct ProcessorInfo *pi)
case RelationProcessorPackage:
pi->processorPackageCount++;
break;
default:
break;
}
offset += sizeof(SYSTEM_LOGICAL_PROCESSOR_INFORMATION);
++cursor;
@ -315,6 +316,10 @@ sysinfo(struct sysinfo *info)
memset(info, 0, sizeof(*info)); // zero unsupported fields
#if defined(GCC_VERSION) && (GCC_VERSION >= 80000)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
{ SYSTEM_TIMEOFDAY_INFORMATION sti = {0};
HMODULE ntdll = GetModuleHandleA("ntdll");
NtQuerySystemInformation_t fNtQuerySystemInformation =
@ -329,6 +334,9 @@ sysinfo(struct sysinfo *info)
}
info->uptime = uptime;
}
#if defined(GCC_VERSION) && (GCC_VERSION >= 80000)
#pragma GCC diagnostic pop
#endif
ms.dwLength = sizeof(ms);
if (! GlobalMemoryStatusEx(&ms)) {

View File

@ -1,5 +1,5 @@
#include <edidentifier.h>
__CIDENT_RCSID(gr_w32_truncate_c,"$Id: w32_truncate.c,v 1.15 2025/03/08 16:40:00 cvsuser Exp $")
__CIDENT_RCSID(gr_w32_truncate_c,"$Id: w32_truncate.c,v 1.16 2025/03/20 17:23:29 cvsuser Exp $")
/* -*- mode: c; indent-width: 4; -*- */
/*
@ -270,7 +270,7 @@ truncateA(const char *path, off_t length)
CloseHandle(handle);
}
}
return 0;
return ret;
}
@ -294,7 +294,7 @@ truncate64A(const char *path, _off64_t length)
CloseHandle(handle);
}
}
return 0;
return ret;
}

View File

@ -1,5 +1,5 @@
#include <edidentifier.h>
__CIDENT_RCSID(gr_w32_user_c,"$Id: w32_user.c,v 1.23 2025/03/06 16:59:47 cvsuser Exp $")
__CIDENT_RCSID(gr_w32_user_c,"$Id: w32_user.c,v 1.24 2025/03/20 17:23:54 cvsuser Exp $")
/* -*- mode: c; indent-width: 4; -*- */
/*
@ -379,6 +379,7 @@ initialise_user()
DWORD ulen = _countof(wlogin), dlen = _countof(wdomain);
if (LookupAccountSidW(NULL, tu->User.Sid, wlogin, &ulen, wdomain, &dlen, &user_type)) {
_wcslwr(wlogin);
w32_wc2utf(wlogin, login, sizeof(login));
}
}
@ -440,9 +441,22 @@ initialise_user()
// old-school
} else {
DWORD cbBuffer = sizeof(x_passwd_name) - 1;
WCHAR t_username[WIN32_LOGIN_LEN];
DWORD cbBuffer = _countof(t_username) - 1;
if (! GetUserNameA(x_passwd_name, &cbBuffer)) {
x_passwd_name[0] = 0;
if (GetUserNameW(t_username, &cbBuffer)) {
int ret, maxlen = sizeof(x_passwd_name) - 1;
_wcslwr(t_username);
if ((ret = WideCharToMultiByte(CP_UTF8, 0,
t_username, -1, x_passwd_name, (int)maxlen, NULL, NULL)) >= 0) {
x_passwd_name[ret] = 0;
}
}
if (0 == x_passwd_name[0]) {
const char *name = NULL;
if (NULL == name) name = getenv("USER");
@ -460,7 +474,6 @@ initialise_user()
}
// additional account attributes
_strlwr(x_passwd_name);
strncpy(x_passwd_dir, w32_gethome(FALSE), sizeof(x_passwd_dir) - 1);
strncpy(x_passwd_shell, w32_getshell(), sizeof(x_passwd_shell) - 1);

View File

@ -1,6 +1,6 @@
midnight-commander.org
mcwin32.manifest.bat
mcwin32.signature.bat
mcwin32.manifest*
mcwin32*manifest.bat
mcwin32*signature.bat
mcwin32*manifest*
*.exe
*.zip

View File

@ -0,0 +1,30 @@
# kbtest - standalone keyboard interface test
![](https://github.com/adamyg/mcwin32/blob/master/mcwin32/art/kbtest01.png?raw=true)
## Usage
```
kbtest - keyboard encode test application
usage: kbtest [options] <command>
Options:
--klid=<id> keyboard layout ID.
--layout=<path> layout definition.
--version application version.
--help command line.
Commands:
dump report keyboard definition.
test interactive.
```
### Notes
Assumed keyboard scancode assignment
![](https://github.com/adamyg/mcwin32/blob/master/mcwin32/src/kbtest/VKGuide.png?raw=true)

View File

@ -76,22 +76,18 @@ isconsole (int fd)
void
tty_init (gboolean mouse_enable, gboolean is_xterm)
{
if (NULL == getenv("TERM")) {
(void) putenv("TERM=dos");
}
mc_setenv ("TERM", "dos", FALSE);
if (NULL == getenv("COLORTERM")) {
if (tty_use_256colors(NULL)) { /* TODO: command line, max colors. */
(void) putenv("COLORTERM=24bit"); /* allow true-color skins */
} else {
(void) putenv("COLORTERM=16");
}
if (tty_use_256colors(NULL)) { /* TODO: command line, max colors. */
mc_setenv ("COLORTERM", "24bit", FALSE); /* allow true-color skins */
} else {
mc_setenv ("COLORTERM", "16", FALSE);
}
key_mouse_mode (mouse_enable);
SLsmg_init_smg ();
if (! isconsole(STDIN_FILENO)) {
if (! isconsole (STDIN_FILENO)) {
fprintf(stderr, _("Console not detected.\n"));
exit (EXIT_FAILURE);
}

View File

@ -1,22 +1,49 @@
/* -*- mode: c; indent-width: 4; -*- */
/*
WIN32 util implementation
WIN32 util implementation
#include "../lib/utilunix.h"
mc_BUSYBOX
mc_TMPDIR
mc_aspell_dllpath
mc_get_locale
mc_MAGICPATH
mc_SYSCONFDIR
mc_DATADIR
mc_LOCALEDIR
mc_LIBEXECDIR
mc_EXTHELPERSDIR
mc_USERCONFIGDIR
mc_setenv
mc_setpathenv
WIN32_HeapInit
WIN32_HeapInit
get_group
get_user_permissions
save_stop_handler
my_signal
my_sigaction
my_get_current_dir
my_systemv_flags
my_system
tilde_expand
open_error_pipe
close_error_pipe
mc_busybox_exts
mc_isscript
my_unquote
win32_popen
win32_pclose
win32_perror
custom_canonicalize_pathname
canonicalize_pathname
mc_realpath
my_build_filenamev
my_build_filename
mc_build_filenamev
mc_build_filename
Adam Young 2015 - 2025
@ -53,6 +80,10 @@
#include <shlobj.h> /* SHxx */
#include <stdio.h>
#if defined(_MSC_VER)
#include <crtdbg.h>
#endif
#include <wchar.h>
#include <sys/types.h>
#include <unistd.h>
@ -99,9 +130,6 @@ static void set_tmpdir (void);
static void set_editor (void);
static void set_busybox (void);
static void my_setenv (const char *name, const char *value, int overwrite);
static void my_setpathenv (const char *name, const char *value, int overwrite, int quote_ws);
static void unixpath (char *path);
static void dospath (char *path);
@ -178,29 +206,29 @@ WIN32_Setup(void)
static void
set_shell(void)
{
my_setpathenv("SHELL", w32_getshell(), FALSE, FALSE);
mc_setpathenv ("SHELL", w32_getshell(), FALSE, FALSE);
}
static void
set_term(void)
{
my_setenv("TERM", "dos-console", FALSE);
mc_setenv ("TERM", "dos-console", FALSE);
}
static void
set_home(void)
{
//my_setenv("MC_HOME", mc_USERCONFDIR(), FALSE);
//mc_setenv ("MC_HOME", mc_USERCONFDIR(), FALSE);
}
static void
set_editor(void)
{
my_setenv("EDITOR", "notepad.exe", FALSE);
my_setenv("PAGER", "notepad.exe", FALSE);
mc_setenv ("EDITOR", "notepad.exe", FALSE);
mc_setenv ("PAGER", "notepad.exe", FALSE);
}
@ -218,7 +246,7 @@ ugetenv(const char *varname)
if (env) {
#define MAX_VARNAME 128
wchar_t wvarname[MAX_VARNAME + 1 /*NUL*/];
const wchar_t *wenv;
const wchar_t *wenv = NULL;
(void) MultiByteToWideChar(CP_UTF8, 0, varname, -1, wvarname, MAX_VARNAME);
wvarname[MAX_VARNAME] = 0;
@ -330,7 +358,7 @@ set_busybox(void)
}
/* publish, quote if path contains whitespace */
my_setpathenv("MC_BUSYBOX", busybox, TRUE, TRUE);
mc_setpathenv ("MC_BUSYBOX", busybox, TRUE, TRUE);
busybox_path = strdup(busybox);
}
@ -378,7 +406,7 @@ set_tmpdir(void)
}
if (tmpdir) {
my_setpathenv("MC_TMPDIR", tmpdir, TRUE, FALSE);
mc_setpathenv ("MC_TMPDIR", tmpdir, TRUE, FALSE);
}
}
}
@ -595,7 +623,11 @@ get_conf_dir(const char *subdir, char *buffer, size_t buflen)
_snprintf(buffer, buflen, "%s/%s/%s/", env, MC_APPLICATION_DIR, subdir);
} else {
#if defined(_WIN32)
_snprintf(buffer, buflen, "c:/Program Files (x86)/%s/%s/", MC_APPLICATION_DIR, subdir);
#else
_snprintf(buffer, buflen, "c:/Program Files/%s/%s/", MC_APPLICATION_DIR, subdir);
#endif
}
buffer[buflen - 1] = 0;
mkdir(buffer, S_IRWXU);
@ -740,7 +772,7 @@ mc_EXTHELPERSDIR(void)
*
* <XDG_CONFIG_HOME>
* If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.
* XDG Base Directory Specification, glib compatiblity ??
* XDG Base Directory Specification, glib compatibility ??
*
* <SYSCONFDIR>
* x:\Documents and Settings\<user>\Application Data\<Midnight Commander>\
@ -877,69 +909,123 @@ mc_USERCONFIGDIR(const char *subdir)
}
static void
my_setenv(const char *name, const char *value, int overwrite)
void
mc_setenv(const char *name, const char *value, int overwrite)
{
if ((1 == overwrite) || NULL == getenv(name)) {
#if defined(__WATCOMC__)
setenv(name, value, TRUE);
setenv(name, value, 1); // putenv() semantics unclear
#else
char buf[1024];
snprintf(buf, sizeof(buf), "%s=%s", name, value);
buf[sizeof(buf)-1] = 0;
(void) putenv(strdup(buf));
_putenv_s(name, value); // copy semantics
#endif
(void) SetEnvironmentVariableA (name, value);
}
}
static void
my_setpathenv(const char *name, const char *value, int overwrite, int quote_ws)
void
mc_setpathenv(const char *name, const char *value, int overwrite, int quote_ws)
{
char path[1024]={0}, buf[1024 + 80]={0};
if ((1 == overwrite) || NULL == getenv(name)) {
strncpy(path, value, sizeof(path)-1);
canonicalize_pathname (path);
dospath(path);
char t_path[WIN32_PATH_MAX], t_quoted[WIN32_PATH_MAX + 16];
wchar_t *wname, *wvalue;
strncpy (t_path, value, sizeof(t_path) - 1);
t_path[sizeof(t_path) - 1] = 0; // working copy
canonicalize_pathname (t_path);
dospath (t_path);
value = t_path;
if (quote_ws && strchr(value, ' ')) {
snprintf (t_quoted, sizeof(t_quoted) - 1, "\"%s\"", value);
t_quoted[sizeof(t_quoted) - 1] = 0;
value = t_quoted;
}
if (NULL != (wname = w32_utf2wca (name, NULL))) {
if (NULL != (wvalue = w32_utf2wca (value, NULL))) {
#if defined(__WATCOMC__)
if (quote_ws && strchr(path, ' ')) {
snprintf(buf, sizeof(buf)-1, "\"%s\"", path);
setenv(name, (const char *)buf, TRUE);
} else {
setenv(name, (const char *)path, TRUE);
}
_wsetenv (wname, wvalue, 1 /*overwrite*/);
#else
if (quote_ws && strchr(path, ' ')) {
snprintf(buf, sizeof(buf)-1, "%s=\"%s\"", name, path);
} else {
snprintf(buf, sizeof(buf)-1, "%s=%s", name, path);
}
(void) putenv(buf);
_wputenv_s (wname, wvalue);
#endif
(void) SetEnvironmentVariableW (wname, wvalue);
free (wvalue);
}
free (wname);
}
}
}
void
WIN32_HeapInit(void)
{
#if defined(_MSC_VER) && !defined(NDEBUG)
int flags = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
//flags = (flags & 0x0000FFFF) | _CRTDBG_CHECK_EVERY_1024_DF;
//flags = (flags & 0x0000FFFF) | _CRTDBG_CHECK_ALWAYS_DF;
flags |= _CRTDBG_DELAY_FREE_MEM_DF;
flags |= _CRTDBG_CHECK_CRT_DF;
_CrtSetDbgFlag(flags);
#endif //_MSC_VER
}
int
WIN32_checkheap(void)
WIN32_HeapCheck(void)
{
int rc = 0;
#if defined(_MSC_VER)
if (! _CrtCheckMemory()) {
puts("ERROR - heap corruption detected\n");
}
#endif //_MSC_VER
switch (_heapchk()) {
case _HEAPOK:
case _HEAPEMPTY:
break;
case _HEAPBADBEGIN:
printf("ERROR - heap is damaged\n");
printf("ERROR - heapchk: heap is damaged\n");
rc = -1;
break;
case _HEAPBADNODE:
printf("ERROR - bad node in heap\n");
printf("ERROR - heapchk: bad node in heap\n");
rc = -1;
break;
}
#if !defined(NDEBUG)
{ struct _heapinfo hi = {0};
int hstatus;
for (;;) {
hstatus = _heapwalk(&hi);
if (hstatus != _HEAPOK) {
break;
}
}
switch (hstatus) {
case _HEAPEND:
case _HEAPEMPTY:
break;
case _HEAPBADBEGIN:
puts("ERROR - heapwalk: heap is damaged\n");
break;
case _HEAPBADPTR:
puts("ERROR - heapwalk: bad pointer to heap\n");
break;
case _HEAPBADNODE:
puts("ERROR - heapwalk: bad node in heap\n");
}
}
#endif //NDEBUG
return (rc);
}
@ -999,7 +1085,6 @@ get_user_permissions(struct stat *st)
ngroups = 0; /* ignore errors */
}
/* allocate space for one element in addition to what
* will be filled by getgroups(). */
groups = g_new (gid_t, ngroups + 1);
@ -1038,7 +1123,6 @@ save_stop_handler(void)
}
/** 4.8.33+
* Wrapper for signal() system call.
*/
@ -1104,7 +1188,8 @@ my_systemv_flags (int flags, const char *command, char *const xargv[])
for (argc = 0; xargv[argc]; ++argc)
continue;
if (NULL == (argv = calloc(argc + 1, sizeof(const char *)))) {
if (NULL == (argv = calloc(argc + 1 /*NULL*/, sizeof(const char *)))) {
return -1;
}
@ -1149,9 +1234,16 @@ my_systemv_flags (int flags, const char *command, char *const xargv[])
error:;
if (argv) {
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable: 6001) // false positive, calloc() usage not understood
#endif
for (idx = 0; idx < argc && argv[idx]; ++idx) {
free((void *)argv[idx]);
}
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
free ((void *)argv);
}
return status;
@ -1166,7 +1258,7 @@ error:;
* Shell (or command) will be found in paths described in PATH variable
* (if shell parameter doesn't begin from path delimiter)
* @parameter command Command for shell (or first parameter for command, if flags contain EXECUTE_AS_SHELL)
* @return 0 if successfull, -1 otherwise
* @return 0 if successful, -1 otherwise
*/
int
my_system (int flags, const char *shell, const char *cmd)
@ -1264,7 +1356,7 @@ system_impl (int flags, const char *shell, const char *cmd)
}
if ((flags & EXECUTE_AS_SHELL) && cmd) { /* internal commands */
#define MAX_ARGV 10
#define MAX_ARGV 10
#define MAX_CMDLINE (4 * 1024)
const char *argv[MAX_ARGV];
char cbuf[MAX_CMDLINE];
@ -1275,7 +1367,7 @@ system_impl (int flags, const char *shell, const char *cmd)
(argc = system_bustargs(cbuf, argv, MAX_ARGV)) <= MAX_ARGV && argc > 0) {
if (0 == strcmp(argv[0], "set")) {
return system_SET(argc, argv);
return system_SET (argc, argv);
} else if (use_internal_busybox) {
const size_t cmdlen = strlen(argv[0]);
@ -1326,36 +1418,71 @@ mc_busybox_exts(unsigned *count)
/**
* 'set' command replacement
*/
static void
wputs(const wchar_t *buffer, ...)
{
HANDLE cout = GetStdHandle(STD_OUTPUT_HANDLE);
const wchar_t *nl;
va_list ap;
va_start (ap, buffer);
while (buffer) {
size_t len = wcslen(buffer);
while ((nl = wcschr (buffer, '\n')) != NULL) {
const int part = (nl - buffer) + 1;
WriteConsoleW (cout, buffer, part - 1, NULL, NULL);
WriteConsoleW (cout, L"\n\r", 2, NULL, NULL);
buffer += part;
len -= part;
}
WriteConsoleW (cout, buffer, len, NULL, NULL);
buffer = va_arg (ap, const wchar_t *);
}
va_end (ap);
}
static int
system_SET(int argc, const char **argv)
{
if (argc == 1) {
#if defined(_MSC_VER) || defined(__WATCOMC__)
extern char **environ;
#endif
char **env = environ;
// list
wchar_t **env = _wenviron;
if (env) {
while (*env) {
printf( "%s\n", *env);
wputs(*env, L"\n", NULL);
++env;
}
}
} else {
char *p;
if ((p = strchr(argv[1], '=')) != NULL) {
*p++ = '\0';
my_setenv(argv[1], p, 1);
} else {
if ((p = getenv(argv[1])) == NULL) {
printf("Environment variable %s not defined\n", argv[1]);
} else if (argc > 1) {
// set or lookup
const wchar_t *wname;
if (NULL != (wname = w32_utf2wca (argv[1], NULL))) {
wchar_t *wvalue;
if (NULL != (wvalue = wcschr (wname, '='))) {
*wvalue++ = '\0'; // delimiter
#if defined(__WATCOMC__)
_wsetenv (wname, wvalue, 1 /*overwrite*/);
#else
_wputenv_s (wname, wvalue);
#endif
(void) SetEnvironmentVariableW (wname, wvalue);
} else if (NULL != (wvalue = _wgetenv(wname))) {
wputs (wname, L"=", wvalue, L"\n", NULL);
} else {
printf("%s=%s\n", argv[1], p );
wputs (L"Environment variable <", wname, L"> not defined\n", NULL);
}
free ((void *)wname);
}
}
return (0);
return 0;
}
@ -1472,7 +1599,7 @@ my_unquote(const char *cmd, int quotews)
while (1) {
if ('\\' == *cmd) {
switch(*++cmd) {
case '\'': // escapeable characters
case '\'': // escapable characters
case '\\':
case '"':
case ';':

View File

@ -2,10 +2,10 @@
/*
win32 tty/win implementation
void do_enter_ca_mode (void)
void do_exit_ca_mode (void)
void show_rxvt_contents (int starty, unsigned char y1, unsigned char y2)
gboolean look_for_rxvt_extensions (void)
do_enter_ca_mode
do_exit_ca_mode
show_rxvt_contents
look_for_rxvt_extensions
Adam Young 2015 - 2025
@ -23,7 +23,6 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <config.h>

View File

@ -0,0 +1,12 @@
@echo off
echo Open Watcom 1.9 Build Environment
if not "%1" == "" SET OWC19=%1
if not defined OWC19 (
SET OWC19=d:\tools\WC19
)
PATH %OWC19%\BINNT;%OWC19%\BINW;%PATH%
SET INCLUDE=%OWC19%\H;%OWC19%\H\NT;%OWC19%\H\NT\DIRECTX;%OWC19%\H\NT\DDK;%INCLUDE%
SET WATCOM=%OWC19%
SET EDPATH=%OWC19%\EDDAT
SET WHTMLHELP=%OWC19%\BINNT\HELP
SET WIPFC=%OWC19%\WIPFC

View File

@ -1,9 +1,9 @@
@echo off
echo Open Watcom 2.0 Build Environment
if not "%1" == "" SET OWC20=%1
if not defined OWC20 (
SET OWC20=d:\tools\WC20
)
if NOT "%1" == "" SET OWC20=%1
PATH %OWC20%\BINNT64;%OWC20%\BINNT;%PATH%
SET INCLUDE=%OWC20%\H;%OWC20%\H\NT;%OWC20%\H\NT\DIRECTX;%OWC20%\H\NT\DDK;%INCLUDE%
SET WATCOM=%OWC20%