Author: fireball
Date: Sat Jan 20 18:29:52 2007
New Revision: 25547
URL:
http://svn.reactos.org/svn/reactos?rev=25547&view=rev
Log:
Merge 25454, 25455, 25457, 25458.
Modified:
branches/ros-branch-0_3_1/reactos/lib/rtl/unicode.c
branches/ros-branch-0_3_1/reactos/tools/rbuild/backend/dependencymap/dependencymap.cpp
branches/ros-branch-0_3_1/reactos/tools/rbuild/backend/dependencymap/dependencymap.h
Modified: branches/ros-branch-0_3_1/reactos/lib/rtl/unicode.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_1/reactos/lib/rt…
==============================================================================
--- branches/ros-branch-0_3_1/reactos/lib/rtl/unicode.c (original)
+++ branches/ros-branch-0_3_1/reactos/lib/rtl/unicode.c Sat Jan 20 18:29:52 2007
@@ -2105,7 +2105,7 @@
if (SourceString == NULL || DestinationString == NULL ||
SourceString->Length > SourceString->MaximumLength ||
(SourceString->Length == 0 && SourceString->MaximumLength > 0
&& SourceString->Buffer == NULL) ||
- Flags == RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING || Flags >= 4 ||
Flags < 0) {
+ Flags == RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING || Flags >= 4) {
return STATUS_INVALID_PARAMETER;
}
Modified:
branches/ros-branch-0_3_1/reactos/tools/rbuild/backend/dependencymap/dependencymap.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_1/reactos/tools/…
==============================================================================
--- branches/ros-branch-0_3_1/reactos/tools/rbuild/backend/dependencymap/dependencymap.cpp
(original)
+++ branches/ros-branch-0_3_1/reactos/tools/rbuild/backend/dependencymap/dependencymap.cpp
Sat Jan 20 18:29:52 2007
@@ -23,6 +23,7 @@
#include <fstream>
#include <string>
#include <vector>
+#include <map>
#include <stdio.h>
@@ -31,6 +32,7 @@
using std::string;
using std::vector;
+using std::map;
using std::ifstream;
#ifdef OUT
@@ -83,15 +85,18 @@
remove ( "dependencymap.xml" );
}
+
void
DepMapBackend::_generate_depmap ( FILE* OUT )
{
-
/* add dependencies */
+
+ typedef map<string, module_data*> ModuleMap;
+ ModuleMap module_map;
+
for ( size_t i = 0; i < ProjectNode.modules.size(); i++ )
{
Module& module = *ProjectNode.modules[i];
-
if ((module.type != Iso) &&
(module.type != LiveIso) &&
(module.type != IsoRegTest) &&
@@ -100,6 +105,21 @@
vector<const IfableData*> ifs_list;
ifs_list.push_back ( &module.project.non_if_data );
ifs_list.push_back ( &module.non_if_data );
+
+ module_data * current_data;
+ ModuleMap::iterator mod_it = module_map.find ( module.name );
+ if (mod_it != module_map.end ())
+ {
+ current_data = mod_it->second;
+ }
+ else
+ {
+ current_data = new module_data();
+ if (current_data)
+ {
+ module_map.insert (std::make_pair<string, module_data*>(module.name,
current_data));
+ }
+ }
while ( ifs_list.size() )
{
const IfableData& data = *ifs_list.back();
@@ -107,15 +127,68 @@
const vector<Library*>& libs = data.libraries;
for ( size_t j = 0; j < libs.size(); j++ )
{
- //add module.name and libs[j]->name
+ ModuleMap::iterator it = module_map.find ( libs[j]->name );
+
+ if ( it != module_map.end ())
+ {
+ module_data * data = it->second;
+ data->references.push_back ( module.name );
+ }
+ else
+ {
+ module_data * data = new module_data();
+ if ( data )
+ {
+ data->references.push_back ( module.name );
+ }
+ module_map.insert ( std::make_pair<string, module_data*>( libs[j]->name,
data ) );
+ }
+ current_data->libraries.push_back ( libs[j]->name );
}
}
}
}
-
-/* save data to file
- fprintf ( OUT, "\r\n" );
-*/
+
+ fprintf ( m_DepMapFile, "<?xml version=\"1.0\"
encoding=\"iso-8859-1\" ?>\r\n" );
+ fprintf ( m_DepMapFile, "<?xml-stylesheet type=\"text/xsl\"
href=\"depmap.xsl\"?>\r\n" );
+ fprintf ( m_DepMapFile, "<components>" );
+
+ for ( size_t i = 0; i < ProjectNode.modules.size(); i++ )
+ {
+ Module& module = *ProjectNode.modules[i];
+
+ ModuleMap::iterator it = module_map.find ( module.name );
+ if ( it != module_map.end () )
+ {
+ module_data * data = it->second;
+
+ fprintf ( m_DepMapFile, "<component name=\"%s\"
base=\"%s\" ref_count=\"%u\"
library_count=\"%u\">\r\n", module.name.c_str(), module.GetBasePath
().c_str (), data->references.size (), data->libraries.size () );
+
+ if ( data->references.size () )
+ {
+ fprintf ( m_DepMapFile, "\t<references>\r\n" );
+ for ( size_t j = 0; j < data->references.size (); j++ )
+ {
+ fprintf ( m_DepMapFile, "\t\t<reference name =\"%s\"
/>\r\n", data->references[j].c_str () );
+ }
+ fprintf ( m_DepMapFile, "\t</references>\r\n" );
+ }
+
+ if ( data->libraries.size () )
+ {
+ fprintf ( m_DepMapFile, "\t<libraries>\r\n" );
+ for ( size_t j = 0; j < data->libraries.size (); j++ )
+ {
+ fprintf ( m_DepMapFile, "\t\t<library name =\"%s\"
/>\r\n", data->libraries[j].c_str () );
+ }
+ fprintf ( m_DepMapFile, "\t</libraries>\r\n" );
+ }
+
+ fprintf ( m_DepMapFile, "</component>\r\n" );
+ }
+ }
+
+ fprintf ( m_DepMapFile, "</components>" );
}
Modified:
branches/ros-branch-0_3_1/reactos/tools/rbuild/backend/dependencymap/dependencymap.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_3_1/reactos/tools/…
==============================================================================
--- branches/ros-branch-0_3_1/reactos/tools/rbuild/backend/dependencymap/dependencymap.h
(original)
+++ branches/ros-branch-0_3_1/reactos/tools/rbuild/backend/dependencymap/dependencymap.h
Sat Jan 20 18:29:52 2007
@@ -50,6 +50,17 @@
void _generate_depmap ( FILE* OUT );
void _clean_project_files ( void );
+ struct module_data
+ {
+ std::vector <std::string> libraries;
+ std::vector <std::string> references;
+
+ module_data()
+ {}
+ ~module_data()
+ {}
+ };
+
};