[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 7 commits - boost/boost_1_55_0.patch postprocess/rebase sc/prj sc/source soldep/bootstrp soldep/inc soldep/prj soldep/source soldep/util solenv/inc vcl/source
Andre Fischer
af at apache.org
Mon Mar 10 09:08:02 PDT 2014
boost/boost_1_55_0.patch | 22
dev/null |binary
postprocess/rebase/coffbase.txt | 1
sc/prj/build.lst | 1
sc/source/core/data/makefile.mk | 1
sc/source/core/inc/makefile.mk | 22
sc/source/core/tool/addincol.cxx | 1
sc/source/core/tool/interpr1.cxx | 2
sc/source/core/tool/makefile.mk | 2
sc/source/core/tool/rangelst.cxx | 6
sc/source/filter/dif/makefile.mk | 1
sc/source/filter/excel/makefile.mk | 1
sc/source/filter/excel/xistyle.cxx | 2
sc/source/filter/excel/xlpivot.cxx | 2
sc/source/filter/ftools/makefile.mk | 1
sc/source/filter/html/makefile.mk | 1
sc/source/filter/inc/makefile.mk | 22
sc/source/filter/lotus/makefile.mk | 1
sc/source/filter/qpro/makefile.mk | 1
sc/source/filter/rtf/makefile.mk | 1
sc/source/filter/starcalc/makefile.mk | 1
sc/source/filter/xcl97/makefile.mk | 1
sc/source/filter/xml/xmlexprt.cxx | 1
sc/source/filter/xml/xmlimprt.cxx | 1
sc/source/ui/Accessibility/AccessibleTableBase.cxx | 3
sc/source/ui/Accessibility/makefile.mk | 1
sc/source/ui/app/makefile.mk | 4
sc/source/ui/attrdlg/makefile.mk | 6
sc/source/ui/cctrl/makefile.mk | 1
sc/source/ui/dbgui/makefile.mk | 1
sc/source/ui/docshell/docsh5.cxx | 2
sc/source/ui/docshell/makefile.mk | 1
sc/source/ui/drawfunc/makefile.mk | 1
sc/source/ui/formdlg/makefile.mk | 1
sc/source/ui/inc/makefile.mk | 22
sc/source/ui/miscdlgs/makefile.mk | 1
sc/source/ui/namedlg/makefile.mk | 1
sc/source/ui/navipi/makefile.mk | 1
sc/source/ui/optdlg/makefile.mk | 1
sc/source/ui/pagedlg/makefile.mk | 2
sc/source/ui/styleui/makefile.mk | 1
sc/source/ui/undo/makefile.mk | 1
sc/source/ui/view/makefile.mk | 2
soldep/bootstrp/appdef.cxx | 161 -
soldep/bootstrp/build_list_converter.pl | 888 ------
soldep/bootstrp/command.cxx | 679 ----
soldep/bootstrp/dep.cxx | 112
soldep/bootstrp/hashtbl.cxx | 507 ---
soldep/bootstrp/makefile.mk | 80
soldep/bootstrp/minormk.cxx | 183 -
soldep/bootstrp/prj.cxx | 2858 ---------------------
soldep/bootstrp/prodmap.cxx | 513 ---
soldep/bootstrp/sstring.cxx | 310 --
soldep/inc/dep.hxx | 65
soldep/inc/dtsodcmp.hrc | 95
soldep/inc/minormk.hxx | 73
soldep/inc/prodmap.hxx | 80
soldep/inc/soldep/appdef.hxx | 157 -
soldep/inc/soldep/command.hxx | 159 -
soldep/inc/soldep/connctr.hxx | 80
soldep/inc/soldep/depper.hxx | 204 -
soldep/inc/soldep/depwin.hxx | 71
soldep/inc/soldep/graphwin.hxx | 50
soldep/inc/soldep/hashobj.hxx | 41
soldep/inc/soldep/hashtbl.hxx | 200 -
soldep/inc/soldep/listmacr.hxx | 56
soldep/inc/soldep/objwin.hxx | 156 -
soldep/inc/soldep/prj.hxx | 476 ---
soldep/inc/soldep/sdtresid.hxx | 48
soldep/inc/soldep/soldep.hxx | 112
soldep/inc/soldep/soldlg.hrc | 75
soldep/inc/soldep/soldlg.hxx | 156 -
soldep/inc/soldep/sstring.hxx | 101
soldep/inc/soldep/tbox.hxx | 98
soldep/prj/build.lst | 5
soldep/prj/d.lst | 41
soldep/source/connctr.cxx | 268 -
soldep/source/depapp.cxx | 143 -
soldep/source/depapp.hxx | 105
soldep/source/depper.cxx | 683 -----
soldep/source/depwin.cxx | 160 -
soldep/source/graphwin.cxx | 73
soldep/source/hashobj.cxx | 33
soldep/source/makefile.mk | 130
soldep/source/objwin.cxx | 817 ------
soldep/source/sdtresid.cxx | 45
soldep/source/soldep.cxx | 1803 -------------
soldep/source/soldlg.cxx | 263 -
soldep/source/soldlg.src | 382 --
soldep/source/tbox.cxx | 592 ----
soldep/util/perl.mk | 67
solenv/inc/libs.mk | 2
solenv/inc/unxlng.mk | 3
solenv/inc/unxsoli4.mk | 3
solenv/inc/unxsols4.mk | 3
solenv/inc/unxsolu4.mk | 3
solenv/inc/wntgcci.mk | 1
solenv/inc/wntmsci10.mk | 3
solenv/inc/wntmsci11.mk | 3
vcl/source/glyphs/graphite_adaptors.cxx | 2
100 files changed, 60 insertions(+), 14565 deletions(-)
New commits:
commit 379afae15286916aa7a9b01ba7bca6fea8511004
Author: Andre Fischer <af at apache.org>
Date: Mon Mar 10 14:25:16 2014 +0000
i124316: Removed unused module soldep.
diff --git a/postprocess/rebase/coffbase.txt b/postprocess/rebase/coffbase.txt
index b198d77..862e2b4 100644
--- a/postprocess/rebase/coffbase.txt
+++ b/postprocess/rebase/coffbase.txt
@@ -239,7 +239,6 @@ sn_tools.dll 0x000000005e7a0000 0x00020000
so_activex.dll 0x000000005e770000 0x00020000
socomp.dll 0x000000005e750000 0x00010000
sofficeapp.dll 0x000000005e6e0000 0x00060000
-soldepmi.dll 0x000000005e6a0000 0x00030000
solvermi.dll 0x000000005e680000 0x00010000
sotmi.dll 0x000000005e620000 0x00050000
spellmi.dll 0x000000005e5e0000 0x00030000
diff --git a/soldep/bootstrp/appdef.cxx b/soldep/bootstrp/appdef.cxx
deleted file mode 100644
index 35270e6..0000000
--- a/soldep/bootstrp/appdef.cxx
+++ /dev/null
@@ -1,161 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <soldep/appdef.hxx>
-
-const char* GetDefStandList()
-{
- char* pRet;
- char* pEnv = getenv("STAR_STANDLST");
- if ( pEnv )
- {
- int nLen = strlen( pEnv );
- pRet = ( char *) malloc( nLen + 1 );
- (void) strcpy( pRet, pEnv );
- }
- else
- {
- int nLen = strlen( _DEF_STAND_LIST );
- pRet = ( char *) malloc( nLen + 1 );
- (void) strcpy( pRet, _DEF_STAND_LIST );
- }
- return pRet;
-}
-
-
-const char* GetIniRoot()
-{
- char* pRet;
- char* pEnv = getenv("STAR_INIROOT");
- if ( pEnv )
- {
- int nLen = strlen( pEnv );
- pRet = ( char *) malloc( nLen + 1 );
- (void) strcpy( pRet, pEnv );
- }
- else
- {
- int nLen = strlen( _INIROOT );
- pRet = ( char *) malloc( nLen + 1 );
- (void) strcpy( pRet, _INIROOT );
- }
- return pRet;
-}
-
-const char* GetIniRootOld()
-{
- char* pRet;
- char* pEnv = getenv("STAR_INIROOTOLD");
- if ( pEnv )
- {
- int nLen = strlen( pEnv );
- pRet = ( char *) malloc( nLen + 1 );
- (void) strcpy( pRet, pEnv );
- }
- else
- {
- int nLen = strlen( _INIROOT_OLD );
- pRet = ( char *) malloc( nLen + 1 );
- (void) strcpy( pRet, _INIROOT_OLD );
- }
- return pRet;
-}
-
-const char* GetSSolarIni()
-{
- char* pRet;
- char* pEnv = getenv("STAR_SSOLARINI");
- if ( pEnv )
- {
- int nLen = strlen( pEnv );
- pRet = ( char *) malloc( nLen + 1 );
- (void) strcpy( pRet, pEnv );
- }
- else
- {
- int nLen = strlen( _DEF_SSOLARINI );
- pRet = ( char *) malloc( nLen + 1 );
- (void) strcpy( pRet, _DEF_SSOLARINI );
- }
- return pRet;
-}
-
-
-const char* GetSSCommon()
-{
- char* pRet;
- char* pEnv = getenv("STAR_SSCOMMON");
- if ( pEnv )
- {
- int nLen = strlen( pEnv );
- pRet = ( char *) malloc( nLen + 1 );
- (void) strcpy( pRet, pEnv );
- }
- else
- {
- int nLen = strlen( _DEF_SSCOMMON );
- pRet = ( char *) malloc( nLen + 1 );
- (void) strcpy( pRet, _DEF_SSCOMMON );
- }
- return pRet;
-}
-
-
-const char* GetBServerRoot()
-{
- char* pRet;
- char* pEnv = getenv("STAR_BSERVERROOT");
- if ( pEnv )
- {
- int nLen = strlen( pEnv );
- pRet = ( char *) malloc( nLen + 1 );
- (void) strcpy( pRet, pEnv );
- }
- else
- {
- int nLen = strlen( B_SERVER_ROOT );
- pRet = ( char *) malloc( nLen + 1 );
- (void) strcpy( pRet, B_SERVER_ROOT );
- }
- return pRet;
-}
-
-const char* GetEnv( const char *pVar )
-{
- char *pRet = getenv( pVar );
- if ( !pRet )
- pRet = "";
- return pRet;
-}
-
-const char* GetEnv( const char *pVar, const char *pDefault )
-{
- char *pRet = getenv( pVar );
- if ( !pRet )
- return pDefault;
- return pRet;
-}
diff --git a/soldep/bootstrp/build_list_converter.pl b/soldep/bootstrp/build_list_converter.pl
deleted file mode 100644
index 4462d26..0000000
--- a/soldep/bootstrp/build_list_converter.pl
+++ /dev/null
@@ -1,888 +0,0 @@
-:
-eval 'exec perl -wS $0 ${1+"$@"}'
- if 0;
-
-#**************************************************************
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#**************************************************************
-
-
-
-
-#*****************************************************************************************
-# ASCII parser for the changeover of the current build.lst files to XML files *
-# programmer: Pascal Junck, Sun Microsystems GmbH *
-#*****************************************************************************************
-
-# this is the first step for the changeover of the current 'build.lst' files to the new
-# 'build.xlist'(XML) files
-# before we create the new ones we have to parse all important informations from the old files
-# important parameters are:
-# 1. 'module name'
-# 2. 'module dependency names'
-# 3. 'dependency type'
-# 4. 'job dir'
-# 5. 'depending directories'
-# 6. 'job platform'(only: 'w', 'u', 'm' and 'all')
-# 7. 'job'(only: 'nmake' means 'make')
-# 8. 'build requirements'(here called: 'restrictions')
-
-
-################################# begin of main #######################################
-
-use strict;
-use lib ("/home/vg119683/work/modules");
-
-use XMLBuildListParser;
-
-# get and work with each argument(build.lst files) of the commando line
-# e.g. if the user wants to parse the build.lst file(s):
-# user input (on unix) for all modules : 'perl -w ascii_parser.pl /so/ws/SRC680/src.m42/*/prj/build.lst'
-# user input (on windows) for one module : 'perl -w ascii_parser.pl O:/SRC680/src.m42/[module]/prj/build.lst'
-# get all arguments (build.lst files) of the commando line in this global variable '@buildlist_files'
-my @buildlist_files = @ARGV;
-# global variable for each file name that we want to parse in ASCII
-my $parse_file = "";
-# set the global variable '$debug' (= 1) to see all results on the terminal,
-# else (= 0) it shows nothing of the working output!
-my $debug = 0;
-
-# open the filehandle 'ERROR_LOG' for all errors
-open (ERROR_LOG, ">>ascii_parse.log")
- or die "Error. Open the file <ascii_parse.log> wasn't successful!\n\n";
-
-# reference of the instance of a new object
-my $XMLTree;
-
-foreach (@buildlist_files)
-{
- # get each element (= module) in '$parse_file'
- $parse_file = $_;
-
- # open the filehandle 'PARSE_ASCII' for each module/file that we want to parse
- open (PARSE_ASCII, $parse_file)
- or die "Error. Open the module <$parse_file> wasn't successful!\n\n";
-
- # create a new object
- $XMLTree = XMLBuildListParser->new();
-
- # invoking of the main subroutine
- reading_file();
-
- # is the file name 'build.lst' in the path on the command line?
- # if not, we can not parse and create the new 'build.xlist' file
- if ($parse_file =~ /build(\w+)?\.lst\S*$/)
- {
- my $path = $parse_file;
-
- $path =~ s/build(\w+)?\.lst\S*$/build\.xlist/;
-
- $XMLTree->saveXMLFile($path);
- }
- else
- {
- add_errorlog_no_buildlst_file_found_statement($parse_file);
- }
-
- # close the current $parse_file
- close(PARSE_ASCII);
-
-}
-# after all files were read close the errorlog file
-close(ERROR_LOG);
-
-
-########################### begin of subroutines #####################################
-#
-# global used variable: $parse_file
-#
-########################################################################################
-
-
-########################################################################################
-# sub: reading_file
-# gets: $_ (current file)
-# returns: -
-########################################################################################
-sub reading_file
-{
- # variable for the name of the current module
- my $module_name = "";
-
- # hashes for the infos beginning at the second line of the build.lst files
- my %dir_of_job_platform = ();
- my %dir_of_alias = ();
-
- # control variable for the module dependency line of the file
- # like line 1 of module 'sal' (dependencies means the colon(s)) (SRC680/src.m42)
- # "sa sal : xml2cmp NULL"
- my $module_dependency_line_exists = 0;
- my $module_dependency_line_was_read = 0;
-
- # this line variables are for checking that all lines will be read
- # counts each line
- my $line_number = 0;
- # for the sum of the informative lines (='module dependency line' and 'nmake' lines of the file)
- my $info_line_sum = 0;
- # for the sum of the no-info lines, like:
- # job lines: 'usr1', 'get', ... and comment lines: '# ...' or empty lines
- my $no_info_line_sum = 0;
-
- # read all lines of the file to resolve the first alias
- # with the matching dir to know all aliases and directories
- # at the later second file reading
- while (<PARSE_ASCII>)
- {
- # the variable for each line of a file
- my $line = $_;
-
- # count each line for more exact error descriptions in the log file
- $line_number += 1;
-
- # remember it, if this line exists
- if ( (is_module_dependency_line($line)) && ($module_dependency_line_exists == 0) )
- {
- $module_dependency_line_exists = 1;
-
- # get the name of the current module
- $module_name = get_module_name($line);
- }
-
- # skip all lines, that hasn't the job 'nmake'
- next if (!(is_nmake_line($line)));
-
- # check that the infos (job directory, job platform and alias) exist
- if (my ($job_dir, $job_platform, $alias) = get_alias_resolving_infos($line))
- {
- # prove that it's a valid job_platform
- # and that each first alias and matching job platform exists only once
- check_alias_and_job_platform($job_dir, $job_platform, $alias, \%dir_of_job_platform,
- \%dir_of_alias, $module_name, $line_number);
- }
- else
- {
- chomp;
- add_errorlog_unknown_format_statement($line, $module_name, $line_number);
- next;
- }
- }
- # reset the $line_number, because we count it again
- $line_number = 0;
-
- # read the same file again
- seek (PARSE_ASCII,0,0);
-
- # read each line of the file for all other informations
- # e.g. line 8 of module 'sal'
- # "sa sal\systools\win32\guistdio nmake - n sa_guistdio sa_uwinapi.n NULL"
- # $job_dir $job $job_platform 1.$alias 2.$alias + alias platform
- while (<PARSE_ASCII>)
- {
- # the variable for each line of a file
- my $line = $_;
-
- # count each line to check at the end of the file that all lines were read
- # and for more exact error descriptions in the log file
- $line_number += 1;
-
- # is it a 'nmake' or a 'module dependency' line?
- # if not: print this line to STDOUT,
- # count one to the no-info lines,
- # try to get the information about the module name from this line
- # and skip the line
- if ( (!(is_nmake_line($line))) && (!(is_module_dependency_line($line))) )
- {
- my $no_info_line = show_no_info_line($line, $line_number);
-
- $no_info_line_sum += $no_info_line;
-
- # if no module dependency line exists get the name of the current module from another line
- $module_name = get_module_name($line) if (!($module_name));
-
- # skip the no-info line
- next;
- }
-
- # only if the module dependency line exists and it wasn't read get the infos about it
- if ( ($module_dependency_line_exists) && (!($module_dependency_line_was_read)) )
- {
- ($module_dependency_line_was_read, $info_line_sum) = get_module_dependency_line_infos
- ($line, $module_name, $line_number);
- }
-
- # get all 'nmake' line infos
- my $info_line = get_nmake_line_infos($line, \%dir_of_alias, \%dir_of_job_platform,
- $module_name, $line_number);
-
- # count the info lines;
- $info_line_sum += $info_line;
- }
-
- if ($debug == 1)
- {
- # show the sums of the info and no-info lines
- lines_sums_output($module_name, $line_number, $info_line_sum, $no_info_line_sum);
- }
-}
-
-########################################################################################
-# sub: is_module_dependency_line
-# gets: $line
-# returns: 1 (true) or 0 (false)
-########################################################################################
-sub is_module_dependency_line
-{
- my $line = shift;
-
- # if the module dpendency line exists return 1, otherwise 0
- ($line =~ /^\w+\s+\S+\s+:+\s+/)
- ? return 1
- : return 0;
-}
-
-########################################################################################
-# sub: is_nmake_line
-# gets: $line
-# returns: '1' (true) or '0' (false)
-########################################################################################
-sub is_nmake_line
-{
- my $line = shift;
-
- # these lines are NO nmake lines:
- # 1. a empty line
- # 2. a comment line (perhaps with the job 'nmake')
- # like line 20 of module 'bridges' (SRC680/src.m42)
- # "#br bridges\source\cli_uno nmake - w,vc7 br_cli_uno br_unotypes NULL========= "
- # 3. the module dependency line
- # like line 1 of module 'sal' (dependencies means the colon(s)) (SRC680/src.m42)
- # "sa sal : xml2cmp N ULL"
- # 4. a 'p' job platform line (for OS2)
- # 5. a line with a job, which is not 'nmake'
- ($line =~ (/^[^\s+\#]/) && (!(/\s+:+\s+/)) && (!(/\s+p\s+/)) && (/\bnmake\b/) )
- ? return 1
- : return 0;
-}
-
-########################################################################################
-# sub: get_alias_resolving_infos
-# gets: $line
-# returns: $job_dir, $job_platform, $alias
-########################################################################################
-sub get_alias_resolving_infos
-{
- my $line = shift;
-
- if ($line =~ /^\w+\s+(\S+)\s+\w+\s+\-\s+(\w+)\,?(\w+)?\s+(\S+)\s+/)
- {
- # get the current work directory
- my $temp_job_dir = $1;
-
- my $job_dir = change_job_directory($temp_job_dir);
-
- # get the job platform of the current job
- # if it is a 'n' job platform transform it to 'w'
- # because 'n' can be used now as 'w' (both means windows)
- my $job_platform = $2;
- $job_platform = "w" if($job_platform eq "n");
-
- # get the first alias in each line
- my $alias = $4;
-
- return ($job_dir, $job_platform, $alias);
- }
- return (undef, undef, undef);
-}
-
-########################################################################################
-# sub: change_job_directory
-# gets: $job_dir
-# returns: $changed_job_dir
-########################################################################################
-# we don't need the module name and the first '\' in the current directory
-sub change_job_directory
-{
- my $changed_job_dir = shift;
-
- # ignore the module name
- $changed_job_dir =~ s/^\w+//;
- # change all other '\' against the '/' of the current dir
- $changed_job_dir =~ s/\\/\//g;
-
- # get only a "/" if we are in the root directory
- $changed_job_dir = "/" if ($changed_job_dir eq "");
-
- return $changed_job_dir;
-}
-
-########################################################################################
-# sub: check_alias_and_job_platform
-# gets: $job_dir, $job_platform, $alias, $dir_of_job_platform_ref,
-# $dir_of_alias_ref, $module_name, $line_number
-# returns: -
-########################################################################################
-# get it in the hash only if it is a valid job platform,
-# like 'w', 'u', 'm' and 'n'
-# 'all' is also valid but it doesn't exist in an alias platform(!)
-sub check_alias_and_job_platform
-{
- my ($job_dir, $job_platform, $alias, $dir_of_job_platform_ref,
- $dir_of_alias_ref, $module_name, $line_number) = @_;
-
- # is it a valid job_platform?
- if ($job_platform =~ /(w|u|m|n|all)/)
- {
- # get only the 'w', 'u', 'm' and 'n' based job platforms
- if ($job_platform =~ /[wumn]/)
- {
- # doesn't the key already exist?
- (!(exists $$dir_of_job_platform_ref{$job_platform.$alias}))
- # get the first alias with the matching job platform in the hash
- ? get_alias_and_job_platform($job_platform, $alias, $dir_of_job_platform_ref)
- # this is a line with a redundant alias and job platform
- : add_errorlog_alias_redundancy_statement($module_name, $alias, $job_platform, $line_number);
- }
- if (!(exists $$dir_of_alias_ref{$alias}))
- {
- # get each first alias with the matching job platform
- get_alias_and_matching_directory($dir_of_alias_ref, $alias, $job_dir);
- }
- }
- # it's not a valid job platform
- else
- {
- add_errorlog_invalid_platform_statement($module_name, $job_platform, $line_number);
- }
-}
-
-########################################################################################
-# sub: get_alias_and_job_platform
-# gets: $job_platform, $alias, $dir_of_job_platform_ref
-# returns: -
-########################################################################################
-# get the the job platform and the first alias as a unique key
-# and the job platform as value of the hash
-# it's for checking later that the alias platform is equal to the job platform
-# e.g.: line 6 + 7 of the module 'gtk' (SRC680/src.m42)
-# "gt gtk\pkgconfig nmake - u gt_pkg NULL"
-# "gt gtk\glib nmake - u gt_glib gt_pkg.u NULL"
-# the alias 'gt_pkg' has the directory 'gtk\pkgconfig' (we need only 'pkgconfig')
-# and it has the job platform 'u' - compare it with the alias platform 'gt_pkg.u'
-sub get_alias_and_job_platform
-{
- my ($job_platform, $alias, $dir_of_job_platform_ref) = @_;
-
- # key = 'job platform' and 'first alias' => value = 'job platform'
- $$dir_of_job_platform_ref{$job_platform.$alias} = $job_platform;
-}
-
-########################################################################################
-# sub: get_alias_and_matching_directory
-# gets: $dir_of_alias_ref, $alias, $job_dir
-# returns: -
-########################################################################################
-# fill the hash with the first alias and the matching directory
-# e.g. line 14 of module 'setup2' (SRC680/src.m42)
-# "se setup2\win\source\unloader nmake - w se_wulo se_unotypes NULL"
-# key = 'se_wulo' => value = 'win/source/unloader'
-sub get_alias_and_matching_directory
-{
- my ($dir_of_alias_ref, $alias, $job_dir) = @_;
-
- # key = 'first alias' => value = 'job directory'
- $$dir_of_alias_ref{$alias} = $job_dir;
-}
-
-########################################################################################
-# sub: show_no_info_line
-# gets: $line, $line_number
-# returns: $no_info_line
-########################################################################################
-sub show_no_info_line
-{
- my ($line, $line_number) = @_;
- my $no_info_line += 1;
-
- chomp($line);
-
- print"Ignore line <$line_number>:\n\"$line\"\n\n" if ($debug);
-
- return $no_info_line;
-}
-
-########################################################################################
-# sub: get_module_name
-# gets: $line
-# returns: $module_name
-########################################################################################
-sub get_module_name
-{
- my $line = shift;
- my $module_name = "";
-
- if ($line =~ /^\w+\s+([\w\.\-]+)\\?/)
- {
- $module_name = $1;
- }
-
- # set the 'module name' in the data structure tree
- $XMLTree->setModuleName($module_name);
-
- return $module_name;
-}
-
-########################################################################################
-# sub: get_module_dependency_line_infos
-# gets: $line, $module_name, $line_number
-# returns: $module_dependency_line_was_read, $info_line_sum
-########################################################################################
-# get the informations about the module dependency line
-# like line 1 of module 'sal' (SRC680/src.m42)
-# "sa sal : xml2cmp NULL"
-# $module_name $module_dependency @module_dependency_names
-sub get_module_dependency_line_infos
-{
- my ($line, $module_name, $line_number) = @_;
- my $module_dependency = "";
- my @module_dependency_names = ();
- my %dep_modules_and_products = ();
- my $product = "";
-
- my $module_dependency_line_was_read = 1;
- my $info_line_sum = 1;
-
- if ($debug)
- {
- print"\nline number : <$line_number>\n";
- print"module-name : <$module_name>\n";
- }
-
- # get the dependencies
- if ($line =~ /\s+(:+)\s+/)
- {
- $module_dependency = $1;
- print"module-dependency : <$module_dependency>\n" if ($debug);
-
- # transform the dependency type to the corresponding tag name
- if ($module_dependency eq ":")
- {
- $module_dependency = "md-simple";
- }
- elsif ($module_dependency eq "::")
- {
- $module_dependency = "md-always";
- }
- elsif ($module_dependency eq ":::")
- {
- $module_dependency = "md-force";
- }
- }
-
- # get a list of all depending module names
- if ($line =~ /:+\s+([\S\s]+)\s+NULL/)
- {
- @module_dependency_names = split(/\s+/, $1);
-
- foreach my $module (@module_dependency_names)
- {
- # check whether that there is another product (as "all") of a module
- if ($module =~ /(\S+):+(\S+)/)
- {
- $dep_modules_and_products{$2} = $1;
- }
- else
- {
- $dep_modules_and_products{$module} = "all";
- }
- }
- }
-
- # add the dependency module names, the module dependency type and the product to the data structure
- foreach my $module (sort keys %dep_modules_and_products)
- {
- print"module-dependency-name(s) : key <$module> value <".$dep_modules_and_products{$module}.">\n" if ($debug);
-
- $XMLTree->addModuleDependencies($module, $module_dependency, $dep_modules_and_products{$module});
- }
-
- return ($module_dependency_line_was_read, $info_line_sum);
-}
-
-########################################################################################
-# sub: get_nmake_line_infos
-# gets: $line, \%dir_of_alias, \%dir_of_job_platform, $module_name, $line_number
-# returns: $info_line
-########################################################################################
-# get all infos about the 'nmake' lines
-# e.g. line 8 of module 'sal'
-# "sa sal\systools\win32\guistdio nmake - n sa_guistdio sa_uwinapi.n NULL"
-# $job_dir $job $job_platform 1.$alias 2.$alias + alias platform
-sub get_nmake_line_infos
-{
- my ($line, $dir_of_alias_ref, $dir_of_job_platform_ref, $module_name, $line_number) = @_;
- my $directories_ref = "";
- my $info_line = 0;
-
- # get the infos about the 'nmake' lines
- if ($line =~ /^\w+\s+(\S+)\s+(\w+)\s+\-\s+(\w+)\,?(\S+)?/)
- {
- # get the current working directory
- my $temp_job_dir = $1;
- my $job_dir = change_job_directory($temp_job_dir);
-
- # get the job
- my $job = $2;
- $job = "make" if ($job eq "nmake");
-
- # get the job platform of the current job
- # if it is a 'n' job platform transform it to 'wnt'
- # available values are: 'wnt', 'unx', 'mac' or 'all'
- my $job_platform = $3;
- $job_platform = change_job_platform_name($job_platform);
-
- # get the first alias in each line
- my $restriction = $4;
- my %build_req = ( "$restriction" => "$job_platform") if ($restriction && $job_platform);
-
-
- # get all aliases (but not the first) in an array
- my $aliases_ref = get_aliases($line);
-
- # filter the list of aliases, which has a 'p' job platform
- # and transform a 'n' ending alias platform to a 'w' ending alias platform
- filter_aliases($aliases_ref);
-
- # resolve all aliases (alias[.job platform] => matching directory)
- $directories_ref = resolve_aliases($aliases_ref, $dir_of_alias_ref,
- $dir_of_job_platform_ref, $module_name, $line_number);
-
- # count the informative lines
- $info_line = 1;
-
- $XMLTree->addJob($job_dir, $job, $job_platform, $directories_ref, \%build_req);
-
- # show the infos, that we know about each line
- if ($debug == 1)
- {
- show_line_infos($line_number, $job_dir, $job, $job_platform, $restriction, $aliases_ref, $directories_ref);
- }
- }
- return $info_line;
-}
-
-########################################################################################
-# sub: change_job_platform_name
-# gets: $job_platform
-# returns: $job_platform
-########################################################################################
-sub change_job_platform_name
-{
- my $job_platform = shift;
-
- $job_platform = "wnt" if($job_platform eq "n" || $job_platform eq "w");
- $job_platform = "unx" if($job_platform eq "u");
- $job_platform = "mac" if($job_platform eq "m");
-
- return $job_platform;
-}
-
-########################################################################################
-# sub: get_aliases
-# gets: $_ (current line)
-# returns: \@aliases
-########################################################################################
-# get all aliases of the line in an array
-sub get_aliases
-{
- my $line = shift;
- my @aliases = ();
-
- # get all aliases in an array (but cut out the first alias)
- if ($line =~ /\-\s+[\w+\,]+\s+([\S\s]+)\s+NULL$/)
- {
- print"\nall job aliases : <$1>\n" if ($debug);
-
- @aliases = split /\s+/, $1;
-
- # we don't need the first alias (it stands for the current job directory)
- shift @aliases;
- }
- return \@aliases;
-}
-
-########################################################################################
-# sub: filter_aliases
-# gets: $aliases_ref
-# returns: -
-########################################################################################
-# filter all aliases, because we only need the 'w', 'u' and 'm' job platform based aliases
-sub filter_aliases
-{
- my $aliases_ref = shift;
-
- # get the highest index of the array (number of elements of the array - 1)
- # also works: my $index = scalar(@$aliases_ref)-1;
- my $index = $#{@{$aliases_ref}};
-
- for (; $index >= 0; $index--)
- {
- # filter the 'p' job platform based aliases from '@aliases'
- splice(@$aliases_ref, $index, 1) if ($$aliases_ref[$index] =~ /\.p$/);
-
- # transform a '.n' ending alias platform to '.w' ending alias platform
- if ($$aliases_ref[$index] =~ /\.n$/)
- {
- $$aliases_ref[$index] =~ s/\.n$/\.w/;
- splice(@$aliases_ref, $index, 1, $$aliases_ref[$index]);
- }
- }
-}
-
-########################################################################################
-# sub: resolve_aliases
-# gets: $aliases_ref, $dir_of_alias_ref, $dir_of_job_platform_ref,
-# $module_name, $line_number
-# returns: \@directories
-########################################################################################
-# here we get each alias with the matching job directory
-sub resolve_aliases
-{
- my ($aliases_ref, $dir_of_alias_ref, $dir_of_job_platform_ref, $module_name, $line_number) = @_;
-
- my @directories = ();
- my ($alias_platform, $alias, $temp_alias) = "";
-
- # resolving all directory aliases
- foreach $temp_alias (@$aliases_ref)
- {
- ($alias, $alias_platform) = compare_job_platform_with_alias_platform
- ($temp_alias, $dir_of_job_platform_ref, $module_name, $line_number);
-
- # does the alias exist?
- if (exists $$dir_of_alias_ref{$alias})
- {
- # then get the matching directory in the array
- push (@directories, $$dir_of_alias_ref{$alias});
- }
- else
- {
- add_errorlog_no_directory_of_alias_statement($module_name, $alias, $line_number);
- }
- }
- return \@directories;
-}
-
-########################################################################################
-# sub: compare_job_platform_with_alias_platform
-# gets: $alias, $dir_of_job_platform_ref, $module_name, $line_number
-# returns: $alias
-########################################################################################
-sub compare_job_platform_with_alias_platform
-{
- my ($alias, $dir_of_job_platform_ref, $module_name, $line_number) = @_;
-
- my $alias_platform = "";
-
- # compare the alias platform (with a dot and an ending letter, like "al_alib.u")
- # with the job platform of the line in which this alias was resolved
- if ($alias =~ /\.([wum])$/)
- {
- $alias_platform = $1;
-
- # don't memorize the ending dot and letter
- $alias =~ s/\.\w$//;
-
- # if the value(= job platform) of the hash or the alias platform has no value
- # set it to "no valid value"
- if (!(exists $$dir_of_job_platform_ref{$alias_platform.$alias}))
- {
- $$dir_of_job_platform_ref{$alias_platform.$alias} = "no valid value";
- }
- $alias_platform = "no valid value" if (!($alias_platform));
-
- # are the job platform and the alias platform equal?
- if ($$dir_of_job_platform_ref{$alias_platform.$alias} ne $alias_platform)
- {
- add_errorlog_not_equal_platforms_statement
- ($module_name, $alias, $alias_platform, $dir_of_job_platform_ref, $line_number);
- }
- }
- return ($alias, $alias_platform);
-}
-
-########################################################################################
-# sub: show_line_infos
-# gets: $line_number, $job_dir, $job, $job_platform, $restriction,
-# $aliases_ref, $directories_ref
-# returns: -
-########################################################################################
-# print the infos about each line
-sub show_line_infos
-{
- my ($line_number, $job_dir, $job, $job_platform, $restriction, $aliases_ref, $directories_ref) = @_;
-
- print"line number : <$line_number>\n";
- print"job directory : <$job_dir>\n";
- print"job : <$job>\n";
- print"job platform : <$job_platform>\n" if ($job_platform =~ /(w|u|m|all)/);
- print"restriction : <$restriction>\n" if ($restriction);
- print"alias dependencies : <@$aliases_ref>\n";
- print"directory dependencies : <@$directories_ref>\n\n";
-}
-
-########################################################################################
-# sub: lines_sums_output
-# gets: $module_name, $line_number, $info_line_sum, $no_info_line_sum
-# returns: -
-########################################################################################
-sub lines_sums_output
-{
- # this line variables are for checking that all lines will be read:
- my ($module_name, $line_number, $info_line_sum, $no_info_line_sum) = @_;
- my $lines_sum = 0;
-
- add_errorlog_no_module_name_statement() if (!($module_name));
-
- # were all lines read? and is the checksum okay?
- $lines_sum = $info_line_sum + $no_info_line_sum;
- if ($lines_sum == $line_number)
- {
- print"All $line_number line(s) of module <$module_name> were read and checked!\n\n";
- }
- else
- {
- add_errorlog_different_lines_sums_statement($module_name);
- }
-
- print"module: <$module_name>\n".
- "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n".
- " info line(s) sum = $info_line_sum\n".
- "no-info line(s) sum = $no_info_line_sum\n".
- "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n".
- " total line(s) sum = $line_number\n\n\n";
-}
-
-
-############################ ERROR_LOG subroutines #####################################
-
-
-########################################################################################
-# sub: add_errorlog_invalid_job_platform_statement
-# gets: $module_name, $platform, $line_number
-# returns: -
-########################################################################################
-sub add_errorlog_invalid_job_platform_statement
-{
- my ($module_name, $job_platform, $line_number) = @_;
-
- print ERROR_LOG "Error in module <$module_name> of dir/file <$parse_file> line <$line_number>.\n".
- "The job platform <$job_platform> is not valid.\n\n";
-}
-
-########################################################################################
-# sub: add_errorlog_not_equal_platforms_statement
-# gets: $module_name, $alias, $alias_platform, $dir_of_job_platform_ref, $line_number
-# returns: -
-########################################################################################
-sub add_errorlog_not_equal_platforms_statement
-{
- my ($module_name, $alias, $alias_platform, $dir_of_job_platform_ref, $line_number) = @_;
-
- print ERROR_LOG "Error in module <$module_name> of dir/file <$parse_file> line <$line_number>.\n".
- "The alias platform <$alias.$alias_platform> is not equal ".
- "with the job platform <$$dir_of_job_platform_ref{$alias_platform.$alias}>.\n\n";
-}
-
-########################################################################################
-# sub: add_errorlog_no_directory_of_alias_statement
-# gets: $module_name, $alias, $line_number
-# returns: -
-########################################################################################
-sub add_errorlog_no_directory_of_alias_statement
-{
- my ($module_name, $alias, $line_number) = @_;
-
- print ERROR_LOG "Error in module <$module_name> of dir/file <$parse_file> line <$line_number>.\n".
- "The directory of the alias <$alias> doesn't exist!\n\n";
-}
-
-########################################################################################
-# sub: add_errorlog_no_module_name_statement
-# gets: -
-# returns: -
-########################################################################################
-sub add_errorlog_no_module_name_statement
-{
- print ERROR_LOG "Error. No module name found in dir/file <$parse_file>.\n\n";
-}
-
-########################################################################################
-# sub: add_errorlog_alias_redundancy_statement
-# gets: $module_name, $alias, $job_platform, $line_number
-# returns: -
-########################################################################################
-sub add_errorlog_alias_redundancy_statement
-{
- my ($module_name, $alias, $job_platform, $line_number)= @_;
-
- print ERROR_LOG "Error in module <$module_name> of dir/file <$parse_file> line <$line_number>.\n".
- "The alias <$alias> with the job platform <$job_platform> is redundant.\n\n";
-}
-
-########################################################################################
-# sub: add_errorlog_unknown_format_statement
-# gets: $module_name, $line_number
-# returns: -
-########################################################################################
-sub add_errorlog_unknown_format_statement
-{
- my ($line, $module_name, $line_number) = @_;
-
- print ERROR_LOG "Error in module <$module_name> of dir/file <$parse_file> line <$line_number>.".
- "\nUnknown format:\n\"$line\"\n\n";
-}
-
-########################################################################################
-# sub: add_errorlog_different_lines_sums_statement
-# gets: $module_name
-# returns: -
-########################################################################################
-sub add_errorlog_different_lines_sums_statement
-{
- my $module_name = shift;
-
- print ERROR_LOG "Error in module <$module_name> of dir/file <$parse_file>.\n".
- "The sums of all info and no-info lines are not correct!\n\n";
-}
-
-########################################################################################
-# sub: add_errorlog_no_buildlst_file_found_statement
-# gets: $parse_file
-# returns: -
-########################################################################################
-sub add_errorlog_no_buildlst_file_found_statement
-{
- my $parse_file = shift;
-
- print ERROR_LOG "Error in command line argument <$parse_file>.\n".
- "File 'build.lst' not found!\n";
-}
-
-############################# end of the subroutines ###################################
diff --git a/soldep/bootstrp/command.cxx b/soldep/bootstrp/command.cxx
deleted file mode 100644
index f4a4a2a..0000000
--- a/soldep/bootstrp/command.cxx
+++ /dev/null
@@ -1,679 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-
-
-#ifdef SCO
-#define _IOSTREAM_H
-#endif
-
-#include <tools/fsys.hxx>
-#include <tools/stream.hxx>
-#include "soldep/command.hxx"
-#include <tools/debug.hxx>
-#include <soldep/appdef.hxx>
-
-#ifdef _MSC_VER
-#pragma warning (push,1)
-#endif
-
-#include <iostream>
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-
-#ifdef _MSC_VER
-#pragma warning (pop)
-#endif
-
-//#define MH_TEST2 1 // fuers direkte Testen
-
-#if defined(WNT) || defined(OS2)
-#ifdef _MSC_VER
-#pragma warning (push,1)
-#endif
-#include <process.h> // for _SPAWN
-#ifdef _MSC_VER
-#pragma warning (pop)
-#endif
-#endif
-#ifdef UNX
-#include <sys/types.h>
-#include <unistd.h>
-#if ( defined NETBSD ) || defined (FREEBSD) || defined (AIX) \
- || defined (HPUX) || defined (MACOSX)
-#include <sys/wait.h>
-#else
-#include <wait.h>
-#endif
-#define P_WAIT 1 // erstmal einen dummz
-#endif
-
-#if defined WNT
-#include <tools/svwin.h>
-#endif
-
-#if defined(WNT) || defined(OS2)
-#define cPathSeperator ';'
-#endif
-#ifdef UNX
-#define cPathSeperator ':'
-#endif
-
-/*****************************************************************************/
-CommandLine::CommandLine(sal_Bool bWrite)
-/*****************************************************************************/
- : bTmpWrite(bWrite)
-{
- CommandBuffer = new char [1];
- if (CommandBuffer == NULL) {
- //cout << "Error: nospace" << endl;
- exit(0);
- }
- CommandBuffer[0] = '\0';
- nArgc = 0;
- ppArgv = new char * [1];
- ppArgv[0] = NULL;
-
- ComShell = new char [128];
- char* pTemp = getenv("COMMAND_SHELL");
- if(!pTemp)
- strcpy(ComShell,COMMAND_SHELL);
- else
- strcpy(ComShell,pTemp);
-
- strcpy(&ComShell[strlen(ComShell)]," -C ");
-}
-
-/*****************************************************************************/
-CommandLine::CommandLine(const char *CommandString, sal_Bool bWrite)
-/*****************************************************************************/
- : bTmpWrite(bWrite)
-{
- CommandBuffer = new char [1];
- if (CommandBuffer == NULL) {
- //cout << "Error: nospace" << endl;
- exit(0);
- }
- nArgc = 0;
- ppArgv = new char * [1];
- ppArgv[0] = NULL;
-
- ComShell = new char [128];
- char* pTemp = getenv("COMMAND_SHELL");
- if(!pTemp)
- strcpy(ComShell,COMMAND_SHELL);
- else
- strcpy(ComShell,pTemp);
-
- strcpy(&ComShell[strlen(ComShell)]," -C ");
-
- BuildCommand(CommandString);
-}
-
-/*****************************************************************************/
-CommandLine::CommandLine(const CommandLine& CCommandLine, sal_Bool bWrite)
-/*****************************************************************************/
- : bTmpWrite(bWrite)
-{
- CommandBuffer = new char [1];
- if (CommandBuffer == NULL) {
- //cout << "Error: nospace" << endl;
- exit(0);
- }
- nArgc = 0;
- ppArgv = new char * [1];
- ppArgv[0] = NULL;
-
- ComShell = new char [128];
- char* pTemp = getenv("COMMAND_SHELL");
- if(!pTemp)
- strcpy(ComShell,COMMAND_SHELL);
- else
- strcpy(ComShell,pTemp);
-
- strcpy(&ComShell[strlen(ComShell)]," -C ");
-
- BuildCommand(CCommandLine.CommandBuffer);
-}
-
-/*****************************************************************************/
-CommandLine::~CommandLine()
-/*****************************************************************************/
-{
- delete [] CommandBuffer;
- delete [] ComShell;
- //for (int i = 0; ppArgv[i] != '\0'; i++) {
- for (int i = 0; ppArgv[i] != 0; i++) {
- delete [] ppArgv[i];
- }
- delete [] ppArgv;
-
-}
-
-/*****************************************************************************/
-CommandLine& CommandLine::operator=(const CommandLine& CCommandLine)
-/*****************************************************************************/
-{
- strcpy (CommandBuffer, CCommandLine.CommandBuffer);
- for (int i = 0; i != nArgc; i++) {
- delete [] ppArgv[i];
- }
- delete [] ppArgv;
- ppArgv = new char * [1];
- ppArgv[0] = NULL;
- BuildCommand(CommandBuffer);
- return *this;
-}
-
-/*****************************************************************************/
-CommandLine& CommandLine::operator=(const char *CommandString)
-/*****************************************************************************/
-{
- strcpy (CommandBuffer, CommandString);
- for (int i = 0; i != nArgc; i++) {
- delete [] ppArgv[i];
- }
- delete [] ppArgv;
- ppArgv = new char * [1];
- ppArgv[0] = NULL;
- BuildCommand(CommandBuffer);
-
- return *this;
-}
-
-/*****************************************************************************/
-void CommandLine::Print()
-/*****************************************************************************/
-{
- //cout << "******* start print *******" << endl;
- //cout << "nArgc = " << nArgc << endl;
- //cout << "CommandBuffer = " << CommandBuffer << endl;
- for (int i = 0; ppArgv[i] != NULL; i++) {
- //cout << "ppArgv[" << i << "] = " << ppArgv[i] << endl;
- }
- //cout << "******** end print ********" << endl;
-}
-
-/*****************************************************************************/
-void CommandLine::BuildCommand(const char *CommandString)
-/*****************************************************************************/
-{
- int index = 0, pos=0;
- char buffer[1024];
- char WorkString[1024];
-
- strcpy(WorkString,CommandString);
-
- //falls LogWindow -> in tmpfile schreiben
- if(bTmpWrite)
- {
- strcpy(&WorkString[strlen(WorkString)]," >&");
- strcpy(&WorkString[strlen(WorkString)],getenv("TMP"));
- strcpy(&WorkString[strlen(WorkString)],TMPNAME);
- }
-
- // delete old memory and get some new memory for CommandBuffer
-
- delete [] CommandBuffer;
- CommandBuffer = new char [strlen(ComShell)+strlen(WorkString)+1];
- if (CommandBuffer == NULL) {
- //cout << "Error: nospace" << endl;
- exit(0);
- }
- strcpy (CommandBuffer, ComShell);
- strcpy (&CommandBuffer[strlen(ComShell)], WorkString);
-
- CommandString = CommandBuffer;
-
- // get the number of tokens
- Strtokens(CommandString);
-
- // delete the space for the old CommandLine
-
- for (int i = 0; ppArgv[i] != 0; i++) {
- delete [] ppArgv[i];
- }
- delete [] ppArgv;
-
- /* get space for the new command line */
-
- ppArgv = (char **) new char * [nArgc+1];
- if (ppArgv == NULL) {
- //cout << "Error: no space" << endl;
- exit(0);
- }
-
- // flush the white space
-
- while ( isspace(*CommandString) )
- CommandString++;
-
- index = 0;
-
- // start the loop to build all the individual tokens
-
- while (*CommandString != '\0') {
-
- pos = 0;
-
- // copy the token until white space is found
-
- while ( !isspace(*CommandString) && *CommandString != '\0') {
-
- buffer[pos++] = *CommandString++;
-
- }
-
- buffer[pos] = '\0';
-
- // get space for the individual tokens
-
- ppArgv[index] = (char *) new char [strlen(buffer)+1];
- if (ppArgv[index] == NULL) {
- //cout << "Error: nospace" << endl;
- exit(0);
- }
-
- // copy the token
-
- strcpy (ppArgv[index++], buffer);
-
- // flush while space
-
- while ( isspace(*CommandString) )
- CommandString++;
-
- }
-
- // finish by setting the las pointer to NULL
- ppArgv[nArgc]= NULL;
-
-}
-
-/*****************************************************************************/
-void CommandLine::Strtokens(const char *CommandString)
-/*****************************************************************************/
-{
- int count = 0;
- const char *temp;
-
- temp = CommandString;
-
- /* bypass white space */
-
- while (isspace(*temp)) temp++;
-
- for (count=0; *temp != '\0'; count++) {
-
- /* continue until white space of string terminator is found */
-
- while ((!isspace(*temp)) && (*temp != '\0')) temp++;
-
- /* bypass white space */
-
- while (isspace(*temp)) temp++;
-
- }
- nArgc = count;
-}
-
-/*****************************************************************************/
-CCommand::CCommand( ByteString &rString )
-/*****************************************************************************/
-{
- rString.SearchAndReplace( '\t', ' ' );
- aCommand = rString.GetToken( 0, ' ' );
- aCommandLine = Search( "PATH" );
-#ifndef UNX
- aCommandLine += " /c ";
-#else
- aCommandLine += " -c ";
-#endif
-
- ByteString sCmd( rString.GetToken( 0, ' ' ));
- ByteString sParam( rString.Copy( sCmd.Len()));
-
- aCommandLine += Search( "PATH", sCmd );
- aCommandLine += sParam;
-
- ImplInit();
-}
-
-/*****************************************************************************/
-CCommand::CCommand( const char *pChar )
-/*****************************************************************************/
-{
- ByteString aString = pChar;
- aString.SearchAndReplace( '\t', ' ' );
- aCommand = aString.GetToken( 0, ' ' );
-
- aCommandLine = Search( "PATH" );
-#ifndef UNX
- aCommandLine += " /c ";
-#else
- aCommandLine += " -c ";
-#endif
- ByteString rString( pChar );
-
- ByteString sCmd( rString.GetToken( 0, ' ' ));
- ByteString sParam( rString.Copy( sCmd.Len()));
-
- aCommandLine += Search( "PATH", sCmd );
- aCommandLine += sParam;
-
- ImplInit();
-}
-
-/*****************************************************************************/
-void CCommand::ImplInit()
-/*****************************************************************************/
-{
- char pTmpStr[255];
- size_t *pPtr;
- char *pChar;
- int nVoid = sizeof( size_t * );
- nArgc = aCommandLine.GetTokenCount(' ');
- sal_uIntPtr nLen = aCommandLine.Len();
-
- ppArgv = (char **) new char[ (sal_uIntPtr)(nLen + nVoid * (nArgc +2) + nArgc ) ];
- pChar = (char *) ppArgv + ( (1+nArgc) * nVoid );
- pPtr = (size_t *) ppArgv;
- for ( xub_StrLen i=0; i<nArgc; i++ )
- {
- (void) strcpy( pTmpStr, aCommandLine.GetToken(i, ' ' ).GetBuffer() );
- size_t nStrLen = strlen( pTmpStr ) + 1;
- strcpy( pChar, pTmpStr );
- *pPtr = (sal_uIntPtr) pChar;
- pChar += nStrLen;
- pPtr += 1;
-#ifdef UNX
- if ( i == 1 )
- {
- sal_uInt16 nWo = aCommandLine.Search("csh -c ");
- if (nWo != STRING_NOTFOUND)
- aCommandLine.Erase(0, nWo + 7);
- else
- aCommandLine.Erase(0, 16);
- i = nArgc;
- strcpy( pChar, aCommandLine.GetBuffer() );
- *pPtr = (sal_uIntPtr) pChar;
- pPtr += 1;
- }
-#endif
- }
- *pPtr = 0;
-}
-
-/*****************************************************************************/
-CCommand::operator int()
-/*****************************************************************************/
-{
- int nRet;
-#if defined WNT
- nRet = _spawnv( P_WAIT, ppArgv[0], (const char **) ppArgv );
-#elif defined OS2
- nRet = _spawnv( P_WAIT, ppArgv[0], ppArgv );
-#elif defined UNX
- //fprintf( stderr, "CComand : operator (int) not implemented\n");
- // **** Unix Implementierung ***************
- pid_t pid;
-
- if (( pid = fork()) < 0 )
- {
- DBG_ASSERT( sal_False, "fork error" );
- }
- else if ( pid == 0 )
- {
- if ( execv( ppArgv[0], (char * const *) ppArgv ) < 0 )
- {
- DBG_ASSERT( sal_False, "execv failed" );
- }
- }
- //fprintf( stderr, "parent: %s %s\n", ppArgv[0] , ppArgv[1] );
- if ( (nRet = waitpid( pid, NULL, 0 ) < 0) )
- {
- DBG_ASSERT( sal_False, "wait error" );
- }
-#endif
-
- switch ( errno )
- {
- case E2BIG :
- nError = COMMAND_TOOBIG;
- break;
- case EINVAL :
- nError = COMMAND_INVALID;
- break;
- case ENOENT:
- nError = COMMAND_NOTFOUND;
- break;
- case ENOEXEC :
- nError = COMMAND_NOEXEC;
- break;
- case ENOMEM :
- nError = COMMAND_NOMEM;
- break;
- default:
- nError = COMMAND_UNKNOWN;
- }
-
- if ( nRet )
- fprintf( stderr, "Program returned with errros\n");
- return nRet;
-}
-
-/*****************************************************************************/
-ByteString CCommand::Search(ByteString aEnv, ByteString sItem)
-/*****************************************************************************/
-{
- // default wird eine Shell im Path gesucht,
- // wenn aber compsec gestzt ist holen wir uns die
- // Shell von dort
- if ( sItem.Equals( COMMAND_SHELL ))
- {
- ByteString aComspec = GetEnv( "COMSPEC" );
- if ( !aComspec.Equals(""))
- return aComspec;
- }
-
- DirEntry aItem( String( sItem, RTL_TEXTENCODING_ASCII_US ));
- if ( aItem.Exists())
- return sItem;
-
- ByteString aEntry, sReturn;
- ByteString sEnv( aEnv );
- ByteString sEnvironment = GetEnv( sEnv.GetBuffer());
- xub_StrLen nCount = sEnvironment.GetTokenCount( cPathSeperator );
-
- sal_Bool bFound = sal_False;
-
- for ( xub_StrLen i=0; i<nCount && !bFound; i++ )
- {
- aEntry = sEnvironment.GetToken(i, cPathSeperator );
-#ifndef UNX
- aEntry += '\\';
-#else
- aEntry += '/';
-#endif
- aEntry += sItem;
-
- String sEntry( aEntry, RTL_TEXTENCODING_ASCII_US );
- DirEntry aDirEntry( sEntry );
- aDirEntry.ToAbs();
- if ( aDirEntry.Exists()) {
- sReturn = aEntry;
- bFound = sal_True;
- }
- }
- if ( !bFound )
- {
- sEnv = sEnv.ToUpperAscii();
- ByteString sEnvironment2 = GetEnv(sEnv.GetBuffer() );
- xub_StrLen nCount2 = sEnvironment2.GetTokenCount( cPathSeperator );
- for ( xub_StrLen i=0; i<nCount2 && !bFound; i++ )
- {
- aEntry = sEnvironment2.GetToken(i, cPathSeperator );
-#ifndef UNX
- aEntry += '\\';
-#else
- aEntry += '/';
-#endif
- aEntry += sItem;
-
- String sEntry( aEntry, RTL_TEXTENCODING_ASCII_US );
- DirEntry aDirEntry( sEntry );
- aDirEntry.ToAbs();
- if ( aDirEntry.Exists()) {
- sReturn = aEntry;
- bFound = sal_True;
- }
- }
- }
-
- if ( sReturn.Equals( "" ))
- sReturn = sItem;
-
- return sReturn;
-}
-
-/*****************************************************************************/
-CCommandd::CCommandd( ByteString &rString, CommandBits nBits )
-/*****************************************************************************/
- : CCommand( rString ),
- nFlag( nBits )
-{
-}
-
-
-/*****************************************************************************/
-CCommandd::CCommandd( const char *pChar, CommandBits nBits )
-/*****************************************************************************/
- : CCommand( pChar ),
- nFlag( nBits )
-{
-}
-
-/*****************************************************************************/
-CCommandd::operator int()
-/*****************************************************************************/
-{
- int nRet = 0;
-
-#ifdef WNT
- LPCTSTR lpApplicationName = NULL;
- LPTSTR lpCommandLine = (char *) GetCommandLine_().GetBuffer();
- LPSECURITY_ATTRIBUTES lpProcessAttributes = NULL;
- LPSECURITY_ATTRIBUTES lpThreadAttributes = NULL;
- sal_Bool bInheritHandles = sal_True;
-
- // wie wuenschen wir denn gestartet zu werden ??
- DWORD dwCreationFlags;
-
- if ( nFlag & COMMAND_EXECUTE_START )
- dwCreationFlags = DETACHED_PROCESS;
- else
- dwCreationFlags = CREATE_NEW_CONSOLE;
-
- // wir erben vom Vaterprozess
- LPVOID lpEnvironment = NULL;
-
- // das exe im Pfad suchen
- LPCTSTR lpCurrentDirectory = NULL;
-
- // in dieser Struktur bekommen wir die erzeugte Processinfo
- // zurueck
- PROCESS_INFORMATION aProcessInformation;
-
- // weiteres Startupinfo anlegen
- STARTUPINFO aStartupInfo;
-
- aStartupInfo.cb = sizeof( STARTUPINFO );
- aStartupInfo.lpReserved = NULL;
- aStartupInfo.lpDesktop = NULL;
-
- // das Fenster bekommt den Namen des Exes
- aStartupInfo.lpTitle = NULL;
- aStartupInfo.dwX = 100;
- aStartupInfo.dwY = 100;
- //aStartupInfo.dwXSize = 400;
- //aStartupInfo.dwYSize = 400;
- aStartupInfo.dwXCountChars = 40;
- aStartupInfo.dwYCountChars = 40;
-
- // Farben setzen
- aStartupInfo.dwFillAttribute = FOREGROUND_RED | BACKGROUND_RED |
- BACKGROUND_BLUE | BACKGROUND_GREEN;
-
-// aStartupInfo.dwFlags = STARTF_USESTDHANDLES;
- //aStartupInfo.wShowWindow = SW_NORMAL; //SW_SHOWDEFAULT;
- //aStartupInfo.wShowWindow = SW_HIDE; //SW_SHOWNOACTIVATE;
- aStartupInfo.wShowWindow = SW_SHOWNOACTIVATE;
- aStartupInfo.cbReserved2 = NULL;
- aStartupInfo.lpReserved2 = NULL;
- //aStartupInfo.hStdInput = stdin;
- //aStartupInfo.hStdOutput = stdout;
- //aStartupInfo.hStdError = stderr;
-
- if ( nFlag & COMMAND_EXECUTE_HIDDEN )
- {
- aStartupInfo.wShowWindow = SW_HIDE;
- aStartupInfo.dwFlags = aStartupInfo.dwFlags | STARTF_USESHOWWINDOW;
- }
-
- bool bProcess = CreateProcess( lpApplicationName,
- lpCommandLine, lpProcessAttributes,
- lpThreadAttributes, bInheritHandles,
- dwCreationFlags, lpEnvironment, lpCurrentDirectory,
- &aStartupInfo, &aProcessInformation );
-
- LPVOID lpMsgBuf;
-
- if ( bProcess )
- {
- FormatMessage(
- FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
- NULL,
- GetLastError(),
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
- (LPTSTR) &lpMsgBuf,
- 0,
- NULL );
-
- ByteString aErrorString = (char *) lpMsgBuf;
-
- if ( nFlag & COMMAND_EXECUTE_WAIT )
- {
- DWORD aProcessState = STILL_ACTIVE;
- while(aProcessState == STILL_ACTIVE)
- {
- GetExitCodeProcess(aProcessInformation.hProcess,&aProcessState);
- }
- }
- }
- else
- fprintf( stderr, "Can not start Process !" );
-
-#endif
- return nRet;
-}
diff --git a/soldep/bootstrp/dep.cxx b/soldep/bootstrp/dep.cxx
deleted file mode 100644
index a6d10e0..0000000
--- a/soldep/bootstrp/dep.cxx
+++ /dev/null
@@ -1,112 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-
-
-#include "dep.hxx"
-
-// class SByteExtStringList
-
-/*****************************************************************************/
-SByteExtStringList::~SByteExtStringList()
-/*****************************************************************************/
-{
- if (bDeleteStrings)
- while( Count()) {
- delete GetObject((sal_uIntPtr)0);
- Remove((sal_uIntPtr)0);
- }
-}
-
-// class VersionDepInfo
-
-/*****************************************************************************/
-VersionDepInfo::~VersionDepInfo()
-/*****************************************************************************/
-{
- if (pVersion)
- delete pVersion;
-}
-
-/*****************************************************************************/
-void VersionDepInfo::Clear()
-/*****************************************************************************/
-{
- while( Count()) {
- delete GetObject((sal_uIntPtr)0);
- Remove((sal_uIntPtr)0);
- }
-}
-
-// class VersionDepInfoList
-
-/*****************************************************************************/
-VersionDepInfo* VersionDepInfoList::GetVersion (ByteString& rVersion)
-/*****************************************************************************/
-{
- VersionDepInfo* pInfo = First();
- while (pInfo)
- {
- const ByteString* pStr = pInfo->GetVersion();
- if (*pStr == rVersion)
- return pInfo;
- pInfo = Next();
- }
- return NULL;
-}
-
-/*****************************************************************************/
-void VersionDepInfoList::RemoveVersion (ByteString& rVersion)
-/*****************************************************************************/
-{
- VersionDepInfo* pInfo = First();
- while (pInfo)
- {
- const ByteString* pStr = pInfo->GetVersion();
- if (*pStr == rVersion)
- {
- Remove (pInfo);
- delete pInfo;
- return;
- }
- pInfo = Next();
- }
-}
-
-/*****************************************************************************/
-VersionDepInfo* VersionDepInfoList::InsertVersion (ByteString& rVersion)
-/*****************************************************************************/
-{
- VersionDepInfo* pInfo = First();
- while (pInfo)
- {
- const ByteString* pStr = pInfo->GetVersion();
- if (*pStr == rVersion)
- {
- pInfo->Clear();
- return pInfo;
- }
- pInfo = Next();
- }
- pInfo = new VersionDepInfo (rVersion);
- Insert (pInfo, LIST_APPEND);
- return pInfo;
-}
diff --git a/soldep/bootstrp/hashtbl.cxx b/soldep/bootstrp/hashtbl.cxx
deleted file mode 100644
index 97f8540..0000000
--- a/soldep/bootstrp/hashtbl.cxx
+++ /dev/null
@@ -1,507 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-
-
-#include <tools/gen.hxx>
-#include <tools/debug.hxx>
-#include <soldep/hashtbl.hxx>
-
-// -------------------------------------------------------------
-// class HashItem
-//
-class HashItem
-{
- enum ETag { TAG_EMPTY, TAG_USED, TAG_DELETED };
-
- void* m_pObject;
- ETag m_Tag;
- ByteString m_Key;
-
-public:
- HashItem() { m_Tag = TAG_EMPTY; m_pObject = NULL; }
-
- sal_Bool IsDeleted() const
- { return m_Tag == TAG_DELETED; }
-
- sal_Bool IsEmpty() const
- { return m_Tag == TAG_DELETED || m_Tag == TAG_EMPTY; }
-
- sal_Bool IsFree() const
- { return m_Tag == TAG_EMPTY; }
-
- sal_Bool IsUsed() const
- { return m_Tag == TAG_USED; }
-
- void Delete()
- { m_Tag = TAG_DELETED; m_Key = ""; m_pObject = NULL; }
-
- ByteString const& GetKey() const
- { return m_Key; }
-
- void* GetObject() const
- { return m_pObject; }
-
- void SetObject(ByteString const Key, void *pObject)
- { m_Tag = TAG_USED; m_Key = Key; m_pObject = pObject; }
-};
-
-#define MIN(a,b) (a)<(b)?(a):(b)
-#define MAX(a,b) (a)>(b)?(a):(b)
-
-// -------------------------------------------------------------
-// class HashTable
-//
-
-/*static*/ double HashTable::m_defMaxLoadFactor = 0.8;
-/*static*/ double HashTable::m_defDefGrowFactor = 2.0;
-
-HashTable::HashTable(sal_uIntPtr lSize, sal_Bool bOwner, double dMaxLoadFactor, double dGrowFactor)
-{
- m_lSize = lSize;
- m_bOwner = bOwner;
- m_lElem = 0;
- m_dMaxLoadFactor = MAX(0.5,MIN(1.0,dMaxLoadFactor)); // 0.5 ... 1.0
- m_dGrowFactor = MAX(1.3,MIN(5.0,dGrowFactor)); // 1.3 ... 5.0
- m_pData = new HashItem [lSize];
-
-// Statistik
-#ifdef DBG_UTIL
- m_aStatistic.m_lSingleHash = 0;
- m_aStatistic.m_lDoubleHash = 0;
- m_aStatistic.m_lProbe = 0;
-#endif
-}
-
-HashTable::~HashTable()
-{
- // Wenn die HashTable der Owner der Objecte ist,
- // müssen die Destruktoren separat gerufen werden.
- // Dies geschieht über die virtuelle Methode OnDeleteObject()
- //
- // Problem: Virtuelle Funktionen sind im Destructor nicht virtuell!!
- // Der Code muß deshalb ins Macro
-
- /*
- if (m_bOwner)
- {
- for (sal_uIntPtr i=0; i<GetSize(); i++)
- {
- void *pObject = GetObjectAt(i);
-
- if (pObject != NULL)
- OnDeleteObject(pObject());
- }
- }
- */
-
- // Speicher für HashItems freigeben
- delete [] m_pData;
-}
-
-void* HashTable::GetObjectAt(sal_uIntPtr lPos) const
-// Gibt Objekt zurück, wenn es eines gibt, sonst NULL;
-{
- DBG_ASSERT(lPos<m_lSize, "HashTable::GetObjectAt()");
-
- HashItem *pItem = &m_pData[lPos];
-
- return pItem->IsUsed() ? pItem->GetObject() : NULL;
-}
-
-void HashTable::OnDeleteObject(void*)
-{
- DBG_ERROR("HashTable::OnDeleteObject(void*) nicht überladen");
-}
-
-sal_uIntPtr HashTable::Hash(ByteString const& Key) const
-{
- /*
- sal_uIntPtr lHash = 0;
- sal_uIntPtr i,n;
-
- for (i=0,n=Key.Len(); i<n; i++)
- {
- lHash *= 256L;
- lHash += (sal_uIntPtr)(sal_uInt16)Key.GetStr()[i];
- lHash %= m_lSize;
- }
- return lHash;
- */
-
- // Hashfunktion von P.J. Weinberger
- // aus dem "Drachenbuch" von Aho/Sethi/Ullman
- sal_uIntPtr i,n;
- sal_uIntPtr h = 0;
- sal_uIntPtr g = 0;
-
- for (i=0,n=Key.Len(); i<n; i++)
- {
- h = (h<<4) + (sal_uIntPtr)(sal_uInt16)Key.GetBuffer()[i];
- g = h & 0xf0000000;
-
- if (g != 0)
- {
- h = h ^ (g >> 24);
- h = h ^ g;
- }
- }
-
- return h % m_lSize;
-}
-
-sal_uIntPtr HashTable::DHash(ByteString const& Key, sal_uIntPtr lOldHash) const
-{
- sal_uIntPtr lHash = lOldHash;
- sal_uIntPtr i,n;
-
- for (i=0,n=Key.Len(); i<n; i++)
- {
- lHash *= 256L;
- lHash += (sal_uIntPtr)(sal_uInt16)Key.GetBuffer()[i];
- lHash %= m_lSize;
- }
- return lHash;
-
-/* return
- (
- lHash
- + (char)Key.GetStr()[0] * 256
- + (char)Key.GetStr()[Key.Len()-1]
- + 1
- )
- % m_lSize;
-*/
-}
-
-sal_uIntPtr HashTable::Probe(sal_uIntPtr lPos) const
-// gibt den Folgewert von lPos zurück
-{
- lPos++; if (lPos==m_lSize) lPos=0;
- return lPos;
-}
-
-sal_Bool HashTable::IsFull() const
-{
- return m_lElem>=m_lSize;
-}
-
-sal_Bool HashTable::Insert(ByteString const& Key, void* pObject)
-// pre: Key ist nicht im Dictionary enthalten, sonst return FALSE
-// Dictionary ist nicht voll, sonst return FALSE
-// post: pObject ist unter Key im Dictionary; m_nElem wurde erhöht
-{
- SmartGrow();
-
- if (IsFull())
- {
- DBG_ERROR("HashTable::Insert() is full");
- return sal_False;
- }
-
- if (FindPos(Key) != NULL )
- return sal_False;
-
- sal_uIntPtr lPos = Hash(Key);
- HashItem *pItem = &m_pData[lPos];
-
- // first hashing
- //
- if (pItem->IsEmpty())
- {
- pItem->SetObject(Key, pObject);
- m_lElem++;
-
- #ifdef DBG_UTIL
- m_aStatistic.m_lSingleHash++;
- #endif
-
- return sal_True;
- }
-
- // double hashing
- //
- lPos = DHash(Key,lPos);
- pItem = &m_pData[lPos];
-
- if (pItem->IsEmpty())
- {
- pItem->SetObject(Key, pObject);
- m_lElem++;
-
- #ifdef DBG_UTIL
- m_aStatistic.m_lDoubleHash++;
- #endif
-
- return sal_True;
- }
-
- // linear probing
- //
- do
- {
- #ifdef DBG_UTIL
- m_aStatistic.m_lProbe++;
- #endif
-
- lPos = Probe(lPos);
- pItem = &m_pData[lPos];
- }
- while(!pItem->IsEmpty());
-
- pItem->SetObject(Key, pObject);
- m_lElem++;
- return sal_True;
-}
-
-HashItem* HashTable::FindPos(ByteString const& Key) const
-// sucht den Key; gibt Refrenz auf den Eintrag (gefunden)
-// oder NULL (nicht gefunden) zurück
-//
-// pre: -
-// post: -
-{
- // first hashing
- //
- sal_uIntPtr lPos = Hash(Key);
- HashItem *pItem = &m_pData[lPos];
-
- if (pItem->IsUsed()
- && pItem->GetKey() == Key)
- {
- return pItem;
- }
-
- // double hashing
- //
- if (pItem->IsDeleted() || pItem->IsUsed())
- {
- lPos = DHash(Key,lPos);
- pItem = &m_pData[lPos];
-
- if (pItem->IsUsed()
- && pItem->GetKey() == Key)
- {
- return pItem;
- }
-
- // linear probing
- //
- if (pItem->IsDeleted() || pItem->IsUsed())
- {
- sal_uIntPtr n = 0;
- sal_Bool bFound = sal_False;
- sal_Bool bEnd = sal_False;
-
- do
- {
- n++;
- lPos = Probe(lPos);
- pItem = &m_pData[lPos];
-
- bFound = pItem->IsUsed()
- && pItem->GetKey() == Key;
-
- bEnd = !(n<m_lSize || pItem->IsFree());
- }
- while(!bFound && !bEnd);
-
- return bFound ? pItem : NULL;
- }
- }
-
- // nicht gefunden
- //
- return NULL;
-}
-
-void* HashTable::Find(ByteString const& Key) const
-// Gibt Verweis des Objektes zurück, das unter Key abgespeichert ist,
-// oder NULL wenn nicht vorhanden.
-//
-// pre: -
-// post: -
-{
- HashItem *pItem = FindPos(Key);
-
- if (pItem != NULL
- && pItem->GetKey() == Key)
- return pItem->GetObject();
- else
- return NULL;
-}
-
-void* HashTable::Delete(ByteString const& Key)
-// Löscht Objekt, das unter Key abgespeichert ist und gibt Verweis
-// darauf zurück.
-// Gibt NULL zurück, wenn Key nicht vorhanden ist.
-//
-// pre: -
-// post: Objekt ist nicht mehr enthalten; m_lElem dekrementiert
-// Wenn die HashTable der Owner ist, wurde das Object gelöscht
-{
- HashItem *pItem = FindPos(Key);
-
- if (pItem != NULL
- && pItem->GetKey() == Key)
- {
- void* pObject = pItem->GetObject();
-
- if (m_bOwner)
- OnDeleteObject(pObject);
-
- pItem->Delete();
- m_lElem--;
- return pObject;
- }
- else
- {
- return NULL;
- }
-}
-
-double HashTable::CalcLoadFactor() const
-// prozentuale Belegung der Hashtabelle berechnen
-{
- return double(m_lElem) / double(m_lSize);
-}
-
-void HashTable::SmartGrow()
-// Achtung: da die Objekte umkopiert werden, darf die OnDeleteObject-Methode
-// nicht gerufen werden
-{
- double dLoadFactor = CalcLoadFactor();
-
- if (dLoadFactor <= m_dMaxLoadFactor)
- return; // nothing to grow
-
- sal_uIntPtr lOldSize = m_lSize; // alte Daten sichern
- HashItem* pOldData = m_pData;
-
- m_lSize = sal_uIntPtr (m_dGrowFactor * m_lSize); // neue Größe
- m_pData = new HashItem[m_lSize]; // neue Daten holen
-
- // kein Speicher:
- // Zustand "Tabelle voll" wird in Insert abgefangen
- //
- if (m_pData == NULL)
- {
- m_lSize = lOldSize;
- m_pData = pOldData;
- return;
- }
-
- m_lElem = 0; // noch keine neuen Daten
-
- // Umkopieren der Daten
- //
- for (sal_uIntPtr i=0; i<lOldSize; i++)
- {
- HashItem *pItem = &pOldData[i];
-
- if (pItem->IsUsed())
- Insert(pItem->GetKey(),pItem->GetObject());
- }
-
- delete [] pOldData;
-}
-
-// Iterator ---------------------------------------------------------
-//
-
-HashTableIterator::HashTableIterator(HashTable const& aTable)
-: m_aTable(aTable)
-{
- m_lAt = 0;
-}
-
-void* HashTableIterator::GetFirst()
-{
- m_lAt = 0;
- return FindValidObject(sal_True /* forward */);
-}
-
-void* HashTableIterator::GetLast()
-{
- m_lAt = m_aTable.GetSize() -1;
- return FindValidObject(sal_False /* backward */);
-}
-
-void* HashTableIterator::GetNext()
-{
- if (m_lAt+1 >= m_aTable.GetSize())
- return NULL;
-
- m_lAt++;
- return FindValidObject(sal_True /* forward */);
-}
-
-void* HashTableIterator::GetPrev()
-{
- if (m_lAt <= 0)
- return NULL;
-
- m_lAt--;
- return FindValidObject(sal_False /* backward */);
-}
-
-void* HashTableIterator::FindValidObject(sal_Bool bForward)
-// Sucht nach einem vorhandenen Objekt ab der aktuellen
-// Position.
-//
-// pre: ab inkl. m_lAt soll die Suche beginnen
-// post: if not found then
-// if bForward == sal_True then
-// m_lAt == m_aTable.GetSize() -1
-// else
-// m_lAt == 0
-// else
-// m_lAt ist die gefundene Position
-{
- void *pObject = m_aTable.GetObjectAt(m_lAt);
-
- if (pObject != NULL)
- return pObject;
-
- while (pObject == NULL
- && (bForward ? ((m_lAt+1) < m_aTable.GetSize())
- : m_lAt > 0))
- {
- if (bForward)
- m_lAt++;
- else
- m_lAt--;
-
- pObject = m_aTable.GetObjectAt(m_lAt);
- }
-
-#ifdef DBG_UTIL
-
- if (pObject == NULL)
- {
- DBG_ASSERT(bForward ? m_lAt == m_aTable.GetSize() -1 : m_lAt == 0,
- "HashTableIterator::FindValidObject()");
- }
-
-#endif
-
- return pObject;
-}
diff --git a/soldep/bootstrp/makefile.mk b/soldep/bootstrp/makefile.mk
deleted file mode 100644
index b1684a6..0000000
--- a/soldep/bootstrp/makefile.mk
+++ /dev/null
@@ -1,80 +0,0 @@
-#**************************************************************
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#**************************************************************
-
-
-
-PRJ=..
-
-PRJNAME=soldep
-TARGET=bootstrpdt
-ENABLE_EXCEPTIONS=true
-
-# --- Settings -----------------------------------------------------
-
-.INCLUDE : settings.mk
-
-# fixme, code is not yet 64 bit clean
-.IF "$(OS)$(CPU)"=="LINUXX" || ("$(COM)"=="C52" && "$(CPU)"=="U")
-all:
- @echo nothing to do
-.ENDIF
-
-# --- Files --------------------------------------------------------
-
-EXCEPTIONSFILES= \
- $(SLO)$/prj.obj
-
-SLOFILES=\
- $(SLO)$/command.obj \
- $(SLO)$/dep.obj \
- $(SLO)$/minormk.obj \
- $(SLO)$/prodmap.obj \
- $(SLO)$/appdef.obj \
- $(SLO)$/hashtbl.obj \
- $(SLO)$/sstring.obj \
- $(SLO)$/prj.obj
-
-
-SHL1TARGET =$(TARGET)$(DLLPOSTFIX)
-SHL1IMPLIB =$(TARGET)
-SHL1LIBS =$(SLB)$/$(TARGET).lib
-SHL1DEF =$(MISC)$/$(SHL1TARGET).def
-SHL1DEPN =$(SHL1LIBS)
-SHL1STDLIBS=\
- $(TOOLSLIB) \
- $(VOSLIB) \
- $(SALLIB)
-
-DEF1NAME =$(SHL1TARGET)
-DEF1DEPN =$(MISC)$/$(SHL1TARGET).flt
-DEFLIB1NAME =$(TARGET)
-
-# --- Targets ------------------------------------------------------
-
-.INCLUDE : target.mk
-
-$(MISC)$/$(SHL1TARGET).flt: makefile.mk
- @echo ------------------------------
- @echo Making: $@
- @echo WEP > $@
- @echo LIBMAIN >> $@
- @echo LibMain >> $@
- @echo __CT >> $@
diff --git a/soldep/bootstrp/minormk.cxx b/soldep/bootstrp/minormk.cxx
deleted file mode 100644
index dae6958..0000000
--- a/soldep/bootstrp/minormk.cxx
+++ /dev/null
@@ -1,183 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-
-
-#include "minormk.hxx"
-#include "prodmap.hxx"
-#include <soldep/appdef.hxx>
-#include <tools/fsys.hxx>
-#include <tools/geninfo.hxx>
-
-//
-// class MinorMk
-//
-
-/*****************************************************************************/
-MinorMk::MinorMk(
- GenericInformationList *pList,
- const ByteString &rVersion,
- const ByteString &rWorkStamp,
- const ByteString &rEnvironment,
- const ByteString &rMinor
-)
-/*****************************************************************************/
-{
- String sRoot( ProductMapper::GetVersionRoot( pList, rVersion ));
- if ( sRoot.Len()) {
- ByteString sPath( sRoot, RTL_TEXTENCODING_ASCII_US );
- sPath += "/";
- sPath += rEnvironment;
- sPath += "/";
- sPath += "inc";
- if ( rMinor.Len()) {
- sPath += ".";
- sPath += rMinor;
- }
-#ifdef UNX
- sPath.SearchAndReplaceAll( "\\", "/" );
- while( sPath.SearchAndReplace( "//", "/" ) != STRING_NOTFOUND ) {};
-#else
- sPath.SearchAndReplaceAll( "/", "\\" );
- while( sPath.SearchAndReplace( "\\\\", "\\" ) != STRING_NOTFOUND ) {};
-#endif
- DirEntry aPath( String( sPath, RTL_TEXTENCODING_ASCII_US ));
-
- ByteString sFile( rWorkStamp );
- sFile += "minor.mk";
-
- DirEntry aFile( aPath );
- aFile += DirEntry( String( sFile, RTL_TEXTENCODING_ASCII_US ));
- if ( !aFile.Exists()) {
- sFile = sFile.Copy( 3 );
- aFile = aPath;
- aFile += DirEntry( String( sFile, RTL_TEXTENCODING_ASCII_US ));
- }
- ReadMinorMk( aFile.GetFull());
- }
-}
-
-/*****************************************************************************/
-MinorMk::MinorMk( GenericInformationList *pList, const ByteString rVersion )
-/*****************************************************************************/
-{
- String sRoot( ProductMapper::GetVersionRoot( pList, rVersion ));
- if ( sRoot.Len()) {
- ByteString sPath( sRoot, RTL_TEXTENCODING_ASCII_US );
- sPath += "/src/solenv/inc";
-#ifdef UNX
- sPath.SearchAndReplaceAll( "\\", "/" );
- while( sPath.SearchAndReplace( "//", "/" ) != STRING_NOTFOUND ) {};
-#else
- sPath.SearchAndReplaceAll( "/", "\\" );
- while( sPath.SearchAndReplace( "\\\\", "\\" ) != STRING_NOTFOUND ) {};
-#endif
- DirEntry aPath( String( sPath, RTL_TEXTENCODING_ASCII_US ));
-
- ByteString sFile( "minor.mk" );
-
- DirEntry aFile( aPath );
- aFile += DirEntry( String( sFile, RTL_TEXTENCODING_ASCII_US ));
-
- ReadMinorMk( aFile.GetFull());
- }
-}
-
-/*****************************************************************************/
-MinorMk::MinorMk( const ByteString &rMinor, const ByteString &rEnvironment )
-/*****************************************************************************/
- : bExists( sal_False )
-{
- ByteString sDelimiter( DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US );
-
-
- ByteString sSolver( GetEnv( "SOLARVERSION" ));
- sal_Bool bNewEnv = sal_True;
- if ( !sSolver.Len()) {
- sSolver = GetEnv( "SOLARVER" );
- bNewEnv = sal_False;
- }
- ByteString sUPD( GetEnv( "UPD" ));
-
- ByteString sMinorMk( sSolver );
- sMinorMk += sDelimiter;
- if ( !bNewEnv ) {
- sMinorMk += sUPD;
- sMinorMk += sDelimiter;
- }
-
- if ( rEnvironment.Len()) {
- sMinorMk += rEnvironment;
- sMinorMk += sDelimiter;
- sMinorMk += "inc";
- if( rMinor.Len()) {
- sMinorMk += ".";
- sMinorMk += rMinor;
- }
- sMinorMk += sDelimiter;
- }
-
- sMinorMk += sUPD;
- sMinorMk += "minor.mk";
-
- String sFile( sMinorMk, RTL_TEXTENCODING_ASCII_US );
-
- ReadMinorMk( sFile );
-}
-
-/*****************************************************************************/
-void MinorMk::ReadMinorMk( const String &rFileName )
-/*****************************************************************************/
-{
- if ( DirEntry( rFileName ).Exists()) {
- bExists = sal_True;
- SvFileStream aStream( rFileName, STREAM_STD_READ );
- while ( !aStream.IsOpen())
- aStream.Open( rFileName, STREAM_STD_READ );
-
- ByteString sLine;
- while ( !aStream.IsEof()) {
- aStream.ReadLine( sLine );
-
- if ( sLine.GetToken( 0, '=' ) == "RSCVERSION" )
- sRSCVERSION = sLine.GetToken( 1, '=' );
- else if ( sLine.GetToken( 0, '=' ) == "RSCREVISION" )
- sRSCREVISION = sLine.GetToken( 1, '=' );
- else if ( sLine.GetToken( 0, '=' ) == "BUILD" )
- sBUILD = sLine.GetToken( 1, '=' );
- else if ( sLine.GetToken( 0, '=' ) == "LAST_MINOR" )
- sLAST_MINOR = sLine.GetToken( 1, '=' );
- }
- aStream.Close();
-
- sRSCVERSION.EraseTrailingChars();
- sRSCREVISION.EraseTrailingChars();
- sBUILD.EraseTrailingChars();
- sLAST_MINOR.EraseTrailingChars();
- }
-}
-
-/*****************************************************************************/
-MinorMk::~MinorMk()
-/*****************************************************************************/
-{
-}
-
diff --git a/soldep/bootstrp/prj.cxx b/soldep/bootstrp/prj.cxx
deleted file mode 100644
index 22896fe..0000000
--- a/soldep/bootstrp/prj.cxx
+++ /dev/null
@@ -1,2858 +0,0 @@
-/**************************************************************
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- *************************************************************/
-
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <soldep/sstring.hxx>
-#include <vos/mutex.hxx>
-
-#define ENABLE_BYTESTRING_STREAM_OPERATORS
-#include <tools/stream.hxx>
-#include <tools/geninfo.hxx>
-#include <soldep/prj.hxx>
-//#include <bootstrp/inimgr.hxx>
-
-#ifndef MACOSX
-#pragma hdrstop
-#endif
-
-//#define TEST 1
-
-#if defined(WNT) || defined(OS2)
-#define LIST_DELIMETER ';'
-#else
-#ifdef UNX
-#define LIST_DELIMETER ':'
-#else
-#endif
-#endif
-
-#if defined(WNT) || defined(OS2)
-#define PATH_DELIMETER '\\'
-#else
-#ifdef UNX
-#define PATH_DELIMETER '/'
-#else
-#endif
-#endif
-
-//static const char * XML_ALL = "all";
-
-//
-// class SimpleConfig
-//
-
-/*****************************************************************************/
-SimpleConfig::SimpleConfig( String aSimpleConfigFileName )
-/*****************************************************************************/
-{
- nLine = 0;
- aFileName = aSimpleConfigFileName;
- aFileStream.Open ( aFileName, STREAM_READ );
-}
-
-/*****************************************************************************/
-SimpleConfig::SimpleConfig( DirEntry& rDirEntry )
-/*****************************************************************************/
-{
- nLine = 0;
- aFileName = rDirEntry.GetFull();
- aFileStream.Open ( aFileName, STREAM_READ );
-}
-
-/*****************************************************************************/
-SimpleConfig::~SimpleConfig()
-/*****************************************************************************/
-{
- aFileStream.Close ();
-}
-
-/*****************************************************************************/
-ByteString SimpleConfig::GetNext()
-/*****************************************************************************/
-{
- ByteString aString;
-
- if ( aStringBuffer =="" )
- while ((aStringBuffer = GetNextLine()) == "\t"); //solange bis != "\t"
- if ( aStringBuffer =="" )
- return ByteString();
-
- aString = aStringBuffer.GetToken(0,'\t');
- aStringBuffer.Erase(0, aString.Len()+1);
-
- aStringBuffer.EraseLeadingChars( '\t' );
-
- return aString;
-}
-
-/*****************************************************************************/
-ByteString SimpleConfig::GetNextLine()
-/*****************************************************************************/
-{
- ByteString aSecStr;
- sal_Bool bStreamOk;
-// sal_uInt16 iret = 0;
- nLine++;
-
- bStreamOk = aFileStream.ReadLine ( aTmpStr );
- if ( (aTmpStr.Search( "#" ) == 0) )
- return "\t";
- aTmpStr = aTmpStr.EraseLeadingChars();
- aTmpStr = aTmpStr.EraseTrailingChars();
- while ( aTmpStr.SearchAndReplace(ByteString(' '),ByteString('\t') ) != STRING_NOTFOUND );
- int nLength = aTmpStr.Len();
- if ( bStreamOk && (nLength == 0) )
- return "\t";
-// sal_uInt16 nPos = 0;
- sal_Bool bFound = sal_False;
- ByteString aEraseString;
- for ( sal_uInt16 i = 0; i<= nLength; i++)
- {
- if ( aTmpStr.GetChar( i ) == 0x20 && !bFound )
- aTmpStr.SetChar( i, 0x09 );
- }
- return aTmpStr;
-}
-
-/*****************************************************************************/
-ByteString SimpleConfig::GetCleanedNextLine( sal_Bool bReadComments )
-/*****************************************************************************/
-{
- sal_Bool bStreamOk;
- sal_Bool bReadNextLine = sal_True;
- while (bReadNextLine)
- {
- bStreamOk = aFileStream.ReadLine ( aTmpStr );
- if (!bStreamOk)
- return ByteString();
-
- ByteString sTab = "\t";
- ByteString sDoubleTab = "\t\t";
- ByteString sSpace = " ";
- xub_StrLen nIndex = 0;
-
- aTmpStr.SearchAndReplaceAll(sSpace, sTab);
- while ( (nIndex = aTmpStr.SearchAndReplace(sDoubleTab, sTab, nIndex )) != STRING_NOTFOUND );
-
- aTmpStr = aTmpStr.EraseLeadingAndTrailingChars('\t'); // remove tabs
-
- if ( aTmpStr.Search( "#" ) == 0 )
- {
- if (bReadComments )
- return aTmpStr;
- }
- else if (aTmpStr != ByteString::EmptyString())
- bReadNextLine = sal_False;
- }
-
- return aTmpStr;
-}
-
-
-//
-// class CommandData
-//
-
-/*****************************************************************************/
-CommandData::CommandData()
-/*****************************************************************************/
-{
- nOSType = 0;
- nCommand = 0;
- pDepList = 0;
- pCommandList = 0;
-}
-
-/*****************************************************************************/
-CommandData::~CommandData()
-/*****************************************************************************/
-{
- if ( pDepList )
- {
- ByteString *pString = pDepList->First();
- while ( pString )
- {
- delete pString;
- pString = pDepList->Next();
- }
- delete pDepList;
-
- pDepList = NULL;
- }
- if ( pCommandList )
- {
- ByteString *pString = pCommandList->First();
- while ( pString )
- {
- delete pString;
- pString = pCommandList->Next();
- }
- delete pCommandList;
-
- pCommandList = NULL;
- }
-}
-
-/*****************************************************************************/
-ByteString CommandData::GetOSTypeString()
-/*****************************************************************************/
-{
- ByteString aRetStr;
-
- switch (nOSType)
- {
- case OS_WIN16 | OS_WIN32 | OS_OS2 | OS_UNX | OS_MAC :
- aRetStr = "all";
- break;
- case OS_WIN32 | OS_WIN16 :
- aRetStr = "w";
- break;
- case OS_OS2 :
- aRetStr = "p";
- break;
- case OS_UNX :
- aRetStr = "u";
- break;
- case OS_WIN16 :
- aRetStr = "d";
- break;
- case OS_WIN32 :
- aRetStr = "n";
- break;
- case OS_MAC :
- aRetStr = "m";
- break;
- default :
- aRetStr = "none";
- }
-
- return aRetStr;
-}
-
-/*****************************************************************************/
-ByteString CommandData::GetCommandTypeString()
-/*****************************************************************************/
-{
- ByteString aRetStr;
-
- switch (nCommand)
- {
- case COMMAND_NMAKE :
- aRetStr = "nmake";
- break;
- case COMMAND_GET :
- aRetStr = "get";
- break;
- default :
- aRetStr = "usr";
- aRetStr += ByteString::CreateFromInt64( nCommand + 1 - COMMAND_USER_START );
-
- }
-
- return aRetStr;
-}
-
-/*****************************************************************************/
-void CommandData::AddCommand(ByteString* pCommand)
-/*****************************************************************************/
-{
- if (!pCommandList)
- pCommandList = new SByteStringList();
- pCommandList->Insert(pCommand, LIST_APPEND);
-}
-
-/*****************************************************************************/
-CommandData& CommandData::operator>> ( SvStream& rStream )
-/*****************************************************************************/
-{
- rStream << aPrj;
- rStream << aLogFileName;
- rStream << aInpath;
- rStream << aUpd;
- rStream << aUpdMinor;
- rStream << aProduct;
- rStream << aCommand;
- rStream << aPath;
- rStream << aPrePath;
- rStream << aPreFix;
- rStream << aCommandPara;
- rStream << aComment;
- rStream << sClientRestriction;
-
- rStream << nOSType;
- rStream << nCommand;
- rStream << nDepth;
-
- if (pDepList)
- {
- rStream << sal_True;
- *pDepList >> rStream;
- }
- else
- rStream << sal_False;
-
- if (pCommandList)
- {
- rStream << sal_True;
- *pCommandList >> rStream;
- }
- else
- rStream << sal_False;
-
- return *this;
-}
-
-/*****************************************************************************/
-CommandData& CommandData::operator<< ( SvStream& rStream )
-/*****************************************************************************/
-{
- rStream >> aPrj;
- rStream >> aLogFileName;
- rStream >> aInpath;
- rStream >> aUpd;
- rStream >> aUpdMinor;
- rStream >> aProduct;
- rStream >> aCommand;
- rStream >> aPath;
- rStream >> aPrePath;
- rStream >> aPreFix;
- rStream >> aCommandPara;
- rStream >> aComment;
- rStream >> sClientRestriction;
-
- rStream >> nOSType;
- rStream >> nCommand;
- rStream >> nDepth;
-
- sal_Bool bDepList;
- rStream >> bDepList;
- if (pDepList)
- pDepList->CleanUp();
- if (bDepList)
- {
- if (!pDepList)
- pDepList = new SByteStringList();
- *pDepList << rStream;
- }
- else
- {
- if (pDepList)
- DELETEZ (pDepList);
- }
-
- sal_Bool bCommandList;
- rStream >> bCommandList;
- if (pCommandList)
- pCommandList->CleanUp();
- if (bCommandList)
- {
- if (!pCommandList)
- pCommandList = new SByteStringList();
- *pCommandList << rStream;
- }
- else
- {
- if (pCommandList)
- DELETEZ (pCommandList);
- }
-
- return *this;
-}
-
-
-
-//
-// class DepInfo
-//
-
-/*****************************************************************************/
-DepInfo::~DepInfo()
-/*****************************************************************************/
-{
- RemoveProject();
-
- if ( pModeList )
- {
- ByteString *pString = pModeList->First();
- while ( pString )
- {
- delete pString;
- pString = pModeList->Next();
- }
- delete pModeList;
-
- pModeList = NULL;
- }
-}
-
-/*****************************************************************************/
-void DepInfo::SetProject (ByteString* pStr)
-/*****************************************************************************/
-{
- RemoveProject();
- pProject = pStr;
-}
-
-/*****************************************************************************/
-void DepInfo::RemoveProject ()
-/*****************************************************************************/
-{
- if (pProject)
- {
- delete pProject;
- pProject = NULL;
- }
-}
-
-/*****************************************************************************/
-DepInfo& DepInfo::operator<< ( SvStream& rStream )
-/*****************************************************************************/
-{
- RemoveProject();
- pProject = new ByteString();
- rStream >> *pProject;
-
- sal_Bool bModeList;
- rStream >> bModeList;
- if (pModeList)
- pModeList->CleanUp();
- if (bModeList)
- {
- if (!pModeList)
- pModeList = new SByteStringList();
- *pModeList << rStream;
- }
- else
- DELETEZ (pModeList);
-
- rStream >> bAllModes;
- return *this;
-}
-
-/*****************************************************************************/
-DepInfo& DepInfo::operator>> ( SvStream& rStream )
-/*****************************************************************************/
-{
- rStream << *pProject;
- if (pModeList)
- {
- rStream << sal_True;
- *pModeList >> rStream;
- }
- else
- rStream << sal_False;
- rStream << bAllModes;
-
- return *this;
-}
-
-//
-// class SDepInfoList
-//
-
-/*****************************************************************************/
-SDepInfoList::SDepInfoList()
-/*****************************************************************************/
- : pAllModeList(0)
-{
-}
-
-/*****************************************************************************/
-SDepInfoList::~SDepInfoList()
-/*****************************************************************************/
-{
- if (pAllModeList)
- delete pAllModeList;
-}
-
-/*****************************************************************************/
-sal_uIntPtr SDepInfoList::IsString( ByteString* pStr )
-/*****************************************************************************/
-{
- sal_uIntPtr nRet = NOT_THERE;
- if ( (nRet = GetPrevString( pStr )) != 0 )
- {
- ByteString* pString = GetObject( nRet )->GetProject();
- if ( *pString == *pStr )
- return nRet;
- else
- return NOT_THERE;
- }
- else
- {
- ByteString* pString = GetObject( 0 )->GetProject();
- if ( pString && (*pString == *pStr) )
- return 0;
- else
- return NOT_THERE;
- }
- return nRet;
-}
-
-/*****************************************************************************/
-sal_uIntPtr SDepInfoList::GetPrevString( ByteString* pStr )
-/*****************************************************************************/
-{
- sal_uIntPtr nRet = 0;
- sal_Bool bFound = sal_False;
- sal_uIntPtr nCount_l = Count();
- sal_uIntPtr nUpper = nCount_l;
- sal_uIntPtr nLower = 0;
- sal_uIntPtr nCurrent = nUpper / 2;
- sal_uIntPtr nRem = 0;
- ByteString* pString;
-
- do
- {
- if ( (nCurrent == nLower) || (nCurrent == nUpper) )
- return nLower;
- pString = GetObject( nCurrent )->GetProject();
- int nResult = pStr->CompareTo( *pString );
- if ( nResult == COMPARE_LESS )
- {
- nUpper = nCurrent;
- nCurrent = (nCurrent + nLower) /2;
- }
- else if ( nResult == COMPARE_GREATER )
- {
- nLower = nCurrent;
- nCurrent = (nUpper + nCurrent) /2;
- }
- else if ( nResult == COMPARE_EQUAL )
- return nCurrent;
- if ( nRem == nCurrent )
- return nCurrent;
- nRem = nCurrent;
- }
- while ( !bFound );
- return nRet;
-}
-
-/*****************************************************************************/
-void SDepInfoList::PutModeString( DepInfo* pInfoList, ByteString* pStr )
-/*****************************************************************************/
-{
- SByteStringList* pList = pInfoList->GetModeList();
- if (!pList)
- {
- pList = new SByteStringList;
- pInfoList->SetModeList(pList);
-
- }
-
- if (pList)
- {
- // check if string exists
- ByteString *pString = pList->First();
- while ( pString )
- {
- if (*pString == *pStr)
- {
- delete pStr;
- return;
- }
- pString = pList->Next();
- }
- pList->PutString( pStr );
- }
- else
- delete pStr;
-}
-
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list