Commit 177f3d1e authored by Alexandre Julliard's avatar Alexandre Julliard

Removed some no longer used programs.

parent 81d03daf
...@@ -1448,7 +1448,6 @@ WINE_CONFIG_EXTRA_DIR(graphics/x11drv) ...@@ -1448,7 +1448,6 @@ WINE_CONFIG_EXTRA_DIR(graphics/x11drv)
WINE_CONFIG_EXTRA_DIR(include/wine) WINE_CONFIG_EXTRA_DIR(include/wine)
WINE_CONFIG_EXTRA_DIR(misc) WINE_CONFIG_EXTRA_DIR(misc)
WINE_CONFIG_EXTRA_DIR(objects) WINE_CONFIG_EXTRA_DIR(objects)
WINE_CONFIG_EXTRA_DIR(programs/regapi/tests)
WINE_CONFIG_EXTRA_DIR(programs/regedit/tests) WINE_CONFIG_EXTRA_DIR(programs/regedit/tests)
WINE_CONFIG_EXTRA_DIR(windows) WINE_CONFIG_EXTRA_DIR(windows)
...@@ -1634,12 +1633,9 @@ programs/cmdlgtst/Makefile ...@@ -1634,12 +1633,9 @@ programs/cmdlgtst/Makefile
programs/control/Makefile programs/control/Makefile
programs/expand/Makefile programs/expand/Makefile
programs/notepad/Makefile programs/notepad/Makefile
programs/osversioncheck/Makefile
programs/progman/Makefile programs/progman/Makefile
programs/regapi/Makefile
programs/regedit/Makefile programs/regedit/Makefile
programs/regsvr32/Makefile programs/regsvr32/Makefile
programs/regtest/Makefile
programs/rpcss/Makefile programs/rpcss/Makefile
programs/rundll32/Makefile programs/rundll32/Makefile
programs/start/Makefile programs/start/Makefile
......
...@@ -2,7 +2,6 @@ TOPSRCDIR = @top_srcdir@ ...@@ -2,7 +2,6 @@ TOPSRCDIR = @top_srcdir@
TOPOBJDIR = .. TOPOBJDIR = ..
SRCDIR = @srcdir@ SRCDIR = @srcdir@
VPATH = @srcdir@ VPATH = @srcdir@
MODULE = none
SUBDIRS = \ SUBDIRS = \
avitools \ avitools \
...@@ -11,12 +10,9 @@ SUBDIRS = \ ...@@ -11,12 +10,9 @@ SUBDIRS = \
control \ control \
expand \ expand \
notepad \ notepad \
osversioncheck \
progman \ progman \
regapi \
regedit \ regedit \
regsvr32 \ regsvr32 \
regtest \
rpcss \ rpcss \
rundll32 \ rundll32 \
start \ start \
......
Makefile
osversioncheck.exe.dbg.c
osversioncheck.exe.spec.c
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = osversioncheck.exe
APPMODE = cui
IMPORTS = kernel32
C_SRCS = osversioncheck.c
@MAKE_PROG_RULES@
### Dependencies:
/*
* Use the GetVersionEx() Win32 API call to show information about
* which version of Windows we're running (or which version of Windows
* Wine believes it is masquerading as).
*
* Copyright 1999 by Morten Eriksen <mailto:mortene@sim.no>
*
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <windows.h>
#include <winbase.h>
#include <stdio.h>
void
show_last_error(void)
{
DWORD lasterr;
LPTSTR buffer;
BOOL result;
lasterr = GetLastError();
result = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
lasterr,
0,
(LPTSTR)&buffer,
0,
NULL);
if (result) {
fprintf(stderr, "Win32 API error (%ld):\t%s", lasterr, buffer);
LocalFree((HLOCAL)buffer);
}
else {
fprintf(stderr, "Win32 API error (%ld)", lasterr);
}
}
int
main(int argc, char ** argv)
{
BOOL result;
OSVERSIONINFO oiv;
/* FIXME: GetVersionEx() is a Win32 API call, so there should be a
preliminary check to see if we're running bare-bones Windows3.xx
(or even lower?). 19990916 mortene. */
oiv.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
result = GetVersionEx(&oiv);
if (result == FALSE) {
show_last_error();
}
else {
char * platforms[] = {
"Win32s on Windows 3.1",
"Win32 on Windows 95 or Windows 98",
"Win32 on Windows NT/Windows 2000",
"unknown!"
};
int platformval = 3;
switch (oiv.dwPlatformId) {
case VER_PLATFORM_WIN32s: platformval = 0; break;
case VER_PLATFORM_WIN32_WINDOWS: platformval = 1; break;
case VER_PLATFORM_WIN32_NT: platformval = 2; break;
}
fprintf(stdout,
"MajorVersion: %ld\nMinorVersion: %ld\nBuildNumber: 0x%lx\n"
"Platform: %s\nCSDVersion: '%s'\n",
oiv.dwMajorVersion, oiv.dwMinorVersion, oiv.dwBuildNumber,
platforms[platformval], oiv.szCSDVersion);
}
return 0;
}
Makefile
regapi.exe.dbg.c
regapi.exe.spec.c
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = regapi.exe
APPMODE = gui
IMPORTS = advapi32 kernel32
C_SRCS = \
regapi.c
PLTESTS = \
tests/regapi.pl
@MAKE_PROG_RULES@
### Dependencies:
Registry Command Line API Tool
------------------------------
This progam is intended to fill a particular need. I needed to make the
wine registry look like it would have been if my application would have
been installed by its installation program. Since this was not possible I
took the following approach.
1 - Use regedit to export my full Windows registry before I install my
application.
2 - Use regedit to export my full Windows registry after I had install my
application.
3 - Generate the differences between the two image. What I obtain from the
diff is what I need to apply to the wine registry.
Obvisouly the process is not that straight forward to solve, first,
you don't get the diff between two Windows regedit exported .reg file by
doing a simple diff. What I had to do is a little more complex, but not
that much...
(Assuming that the registry picture files are
named ./before.reg and ./after.reg)
1 - Parse the before.reg and after.reg file into regFixer.pl, in order to
obtain lines in the form [HKEY\Sub1\Sub2\...\Subn]"Value"="Data"
(where "Data" can be prefixed by the type identifier : hex:, hex(0000000?)
or dword:)
2 - Generate the diff between the before.reg.fix and after.reg.fix
into app.diff
Now we have a app.reg file that contain what has been done by installing the
application. To this we extract the parts that we are interested in using
grep (and fix it with sed) and put that into app.added by example
( let's say we keep the added values only ).
At this point we know which registry entry to add to the wine registry. It
only remains to take the format we have and reset it into a format we get from
regedit.
So, once you parsed app.added into regRestorer.pl you get an app.reg ready to
process by regapi.
So, this package comes with a few pieces:
regFixer.pl - Will convert the export of regedit
into something "diff-able"
regRestorer.pl - Will convert "cleaned" diff file into
something "regapi-able"
regSet.sh - Will do the procedure explained herein
for the added key only.
FAQ
---
Quick Start Guide
-----------------
1 - Get a snapshot of your windows registry in before.reg, (regedit/export)
2 - Install your application,
3 - Get a snapshot of your windows registry in after.reg.
4 - Invoke ./regSet.sh before.reg after.reg
Adding key I have in a regedit export file (nothing to diff with...)
------------------------------------------
1 - Invoke ./regSet.sh /dev/null myRegistry.reg
regapi help
-----------
1 - regapi has some sort of "man page like" help in it, simply invoke it
without any arguments.
Hope this is of any use to you.
Sylvain St-Germain.
#!/usr/bin/perl
# This script takes as STDIN an output from the Registry
# (export from regedit.exe) and prefixes every subkey-value
# pair by their hkey,key data member
#
# Copyright 1999 Sylvain St-Germain
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
${prefix} = "";
LINE: while(<>) {
chomp;
s/\r$//; # Get rid of 0x0a
next LINE if(/^\s*$/); # This is an empty line
next LINE if(/^\s*;/); # This is a comment (no way to diff it)
if( /^\[/ ) {
${prefix} = ${_}; # assign the prefix for the forthcoming section
${prefix} =~ s/\s+\d+$//; # get rid of timestamp
print "${prefix}\n";
next LINE;
}
print "${prefix}$_\n";
}
#!/usr/bin/perl
# This script takes as STDIN an output from the regFixer.pl
# and reformat the file as if it would have been exported from the registry
# in the "REGEDIT4" format.
#
# Copyright 1999 Sylvain St-Germain
# Copyright 2002 Andriy Palamarchuk
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
use strict;
use diagnostics;
# I do not validate the integrity of the file, I am assuming that
# the input file comes from the output of regFixer.pl, therefore things
# should be ok, if they are not, submit a bug
my $curr_key = "";
my $key;
my $value;
my $rest;
my $s;
print "REGEDIT4\n";
LINE: while($s = <>) {
chomp($s); # get rid of new line
next LINE if($s =~ /^$/); # this is an empty line
if ($s =~ /\]$/) # only key name on the line
{
($key) = ($s =~ /^\[(.*)\]$/);
unless ($key)
{
die "Unrecognized string $s";
}
if ($key ne $curr_key)
{
$curr_key = $key;
print "\n[$key]\n";
}
}
else
{
($key, $value) = ($s =~ /^\[(.*?)\](.+)$/);
if (!defined($key))
{
die "Unrecognized string $s";
}
if ($key ne $curr_key) #curr_key might got chopped from regSet.sh
{
print "\n[$key]\n";
}
print "$value\n"
}
}
#!/bin/sh
# This script is the receipe to generate the key that have to be created like
# if an application was installed by its installer. It processes using a
# registry based on the picture of the registry before the application is
# installed and the picture of the registry after the application is installed.
#
# Copyright 1999 Sylvain St-Germain
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
if [ $# -ne 2 ]; then
echo "$0 Usage: "
echo " You must provide 2 arguments."
echo " 1 - Registry output before the application's installation."
echo " 2 - Registry output after the application's installation."
echo
exit 1
fi
if [ ! -f $1 ]; then echo "$1 does not exist."; exit 1; fi
if [ ! -f $2 ]; then echo "$2 does not exist."; exit 1; fi
echo "Assuming that $1 is the \"before\" file..."
echo "Assuming that $2 is the \"after\" file..."
#
# do not attempt to regFix.pl /dev/null ...
#
echo "Fixing exported registry files..."
FIX1_FILE=`mktemp -q /tmp/file1_fix.XXXXXXXXX`
FIX2_FILE=`mktemp -q /tmp/file2_fix.XXXXXXXXX`
DIFF_FILE=`mktemp -q /tmp/file2_diff.XXXXXXXXX`
FILE_TOADD_CLEAN=`mktemp -q /tmp/file_toAdd_clean.XXXXXXXXX`
FILE_TOADD=`mktemp -q /tmp/file_toAdd.XXXXXXXXX`
if [ $1 != "/dev/null" ]; then
cat $1 | ./regFixer.pl > $FIX1_FILE
fi
cat $2 | ./regFixer.pl > $FIX2_FILE
#
# diff accordingly depending on /dev/null
#
echo "Diffing..."
if [ $1 != "/dev/null" ]; then
diff $FIX1_FILE $FIX2_FILE > $DIFF_FILE
else
diff /dev/null $FIX2_FILE > $DIFF_FILE
fi
#
# Keep only added lines
#
echo "Grepping keys to add and generating cleaned fixed registry file."
cat $DIFF_FILE | grep '^> ' | sed -e 's/^> //' > $FILE_TOADD_CLEAN
#
# Restore the file format to the regedit export 'like' format
#
echo "Restoring key's in the regedit export format..."
cat $FILE_TOADD_CLEAN | ./regRestorer.pl > $FILE_TOADD
echo "Cleaning..."
rm $FIX1_FILE $FIX2_FILE >/dev/null 2>&1
rm $DIFF_FILE >/dev/null 2>&1
rm $FILE_TOADD_CLEAN >/dev/null 2>&1
if mv $FILE_TOADD $2.toAdd
then
FILE_TOADD=$2.toAdd
fi
echo "Operation completed, result file is '$FILE_TOADD'"
exit 0
Test data:
after.reg - registry file with the change, exported from regedit
before.reg - registry file without the change, exported from regedit
orig.reg - registry file ot the test change, exported from regedit
Note, orig.reg must me in Unix format, after.reg and before.reg - in Dos format.
REGEDIT4
[HKEY_CURRENT_USER]
[HKEY_CURRENT_USER\Software\WinCvs\wincvs\FileDetailView]
"Column Widths"="150 50 50 100 150 150 150 "
"Column Order"="0 1 2 3 4 5 6 "
[HKEY_CURRENT_USER\Software\WinCvs\wincvs\Settings]
"Window Pos"="2,3,-1,-1,-1,-1,198,198,1062,828"
[HKEY_CURRENT_USER\Software\WinCvs\wincvs\Tip]
"TimeStamp"="Mon Feb 11 13:20:51 2002"
"StartUp"=dword:00000001
"FilePos"=dword:00000247
[HKEY_CURRENT_USER\Test Regapi]
[HKEY_CURRENT_USER\Test Regapi\New Key #1]
@="222Sample default value data, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long,end"
"A- \" Binary Value #1, long name \\ []= long long long long long long long long long long long long end"=hex:30,\
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
36
"a1"=""
"New Binary Value #2"=hex:
"New DWORD Value #1"=dword:00000200
"New DWORD Value #2"=dword:000000c9
"New DWORD Value #3"=dword:00000000
"New String Value #1"="One more long string value 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6 end"
"New String Value #2"=""
"v1"="\" \\,=[]"
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2]
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2\New Key #3]
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2\New Key #3\New Key #4]
@=""
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2\New Key #3\New Key #4\New Key #5]
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2\New Key #3\New Key #4.1]
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2\New Key #3\New Key #6]
[HKEY_CURRENT_USER\UNICODE Program Groups]
[HKEY_CURRENT_USER\Windows 3.1 Migration Status]
[HKEY_CURRENT_USER\Windows 3.1 Migration Status\Groups]
[HKEY_CURRENT_USER\Windows 3.1 Migration Status\IniFiles]
[HKEY_CURRENT_USER\Volatile Environment]
"NWUSERNAME"="APalamar"
"LOGONSERVER"="\\\\BX08N200"
"=M:"="M:\\"
"=O:"="O:\\"
"=P:"="P:\\"
"=U:"="U:\\"
"=Z:"="Z:\\"
"PATH"="Z:."
"USERNAME"="APalamar"
"=N:"="N:\\"
"=Q:"="Q:\\"
"=S:"="S:\\"
"NWLANGUAGE"="English"
"=T:"="T:\\"
"WINDOWS_LOGIN"="0"
REGEDIT4
[HKEY_CURRENT_USER]
[HKEY_CURRENT_USER\Software\WinCvs\wincvs\FileDetailView]
"Column Widths"="150 50 50 100 150 150 150 "
"Column Order"="0 1 2 3 4 5 6 "
[HKEY_CURRENT_USER\Software\WinCvs\wincvs\Settings]
"Window Pos"="2,3,-1,-1,-1,-1,198,198,1062,828"
[HKEY_CURRENT_USER\Software\WinCvs\wincvs\Tip]
"TimeStamp"="Mon Feb 11 13:20:51 2002"
"StartUp"=dword:00000001
"FilePos"=dword:00000247
[HKEY_CURRENT_USER\UNICODE Program Groups]
[HKEY_CURRENT_USER\Windows 3.1 Migration Status]
[HKEY_CURRENT_USER\Windows 3.1 Migration Status\Groups]
[HKEY_CURRENT_USER\Windows 3.1 Migration Status\IniFiles]
[HKEY_CURRENT_USER\Volatile Environment]
"NWUSERNAME"="APalamar"
"LOGONSERVER"="\\\\BX08N200"
"=M:"="M:\\"
"=O:"="O:\\"
"=P:"="P:\\"
"=U:"="U:\\"
"=Z:"="Z:\\"
"PATH"="Z:."
"USERNAME"="APalamar"
"=N:"="N:\\"
"=Q:"="Q:\\"
"=S:"="S:\\"
"NWLANGUAGE"="English"
"=T:"="T:\\"
"WINDOWS_LOGIN"="0"
REGEDIT4
[HKEY_CURRENT_USER\Test Regapi]
[HKEY_CURRENT_USER\Test Regapi\New Key #1]
@="222Sample default value data, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long, very long,end"
"A- \" Binary Value #1, long name \\ []= long long long long long long long long long long long long end"=hex:30,\
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,\
31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,36,37,38,39,30,31,32,33,34,35,\
36
"a1"=""
"New Binary Value #2"=hex:
"New DWORD Value #1"=dword:00000200
"New DWORD Value #2"=dword:000000c9
"New DWORD Value #3"=dword:00000000
"New String Value #1"="One more long string value 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6,7,8,9,0 1,2,3,4,5,6 end"
"New String Value #2"=""
"v1"="\" \\,=[]"
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2]
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2\New Key #3]
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2\New Key #3\New Key #4]
@=""
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2\New Key #3\New Key #4\New Key #5]
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2\New Key #3\New Key #4.1]
[HKEY_CURRENT_USER\Test Regapi\New Key #1\New Key #2\New Key #3\New Key #6]
#!/usr/bin/perl -w
# This script tests regapi functionality
#
# Copyright 2002 Andriy Palamarchuk
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
use strict;
use diagnostics;
test_diff();
#removes all test output files
sub clear_output
{
unlink './tests/after.reg.toAdd';
}
#tests scripts which implement "diff" functionality for registry
sub test_diff
{
my $generated = './tests/after.reg.toAdd';
my $orig = './tests/orig.reg';
my $s;
$s = './regSet.sh ./tests/before.reg ./tests/after.reg > /dev/null';
qx/$s/;
#files must be the same
if (-z($generated) || (-s($generated) != -s($orig))) {
die "Original and generated registry files ($orig and $generated) " .
"are different";
}
clear_output();
}
Makefile
regtest.exe.dbg.c
regtest.exe.spec.c
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = regtest.exe
APPMODE = gui
IMPORTS = advapi32 kernel32
C_SRCS = regtest.c
@MAKE_PROG_RULES@
### Dependencies:
#!/usr/bin/perl
#
# Update the list of debug channels of a given spec file
#
# Copyright 2000 Alexandre Julliard
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Usage: make_debug spec_file [source_files...]
#
die "Usage: make_debug spec_file [source]\n" unless @ARGV;
$SPEC = shift @ARGV;
# read in all the source files
if (@ARGV)
{
while (<>)
{
if (/DECLARE_DEBUG_CHANNEL\s*\(\s*([A-Za-z0-9_]+)\s*\)/) { $channels{$1} = 1; }
if (/DEFAULT_DEBUG_CHANNEL\s*\(\s*([A-Za-z0-9_]+)\s*\)/) { $channels{$1} = 1; }
}
}
@dbg_channels = sort keys %channels;
# read the whole spec file
undef $/;
open SPEC or die "Cannot open $SPEC\n";
$spec = <SPEC>;
close SPEC;
# build the new channel list
$channel_str = "debug_channels (";
$pos = length($channel_str);
for ($i = 0; $i <= $#dbg_channels; $i++)
{
$channel_str .= $dbg_channels[$i];
$pos += length($dbg_channels[$i]);
if ($i < $#dbg_channels)
{
if ($pos >= 75) { $pos = 16; $channel_str .= "\n" . (" " x $pos); }
else { $channel_str .= " "; $pos++; }
}
}
$channel_str .= ")";
# replace the list in the spec file
if (!($spec =~ s/debug_channels\s*\(([^)]*)\)/$channel_str/))
{
die "Could not replace debug_channels\n" if @dbg_channels;
exit 0;
}
# output the modified spec file
open OUTPUT, ">$SPEC" or die "Cannot modify $SPEC\n";
print OUTPUT $spec;
close OUTPUT;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment