[ros-diffs] [mpiulachs] 30081: Implement the autogenerated credits header file (autocontributors.h) in INTERMEDIATE/include/reactos/autocontributors.h together with Colin

mpiulachs at svn.reactos.org mpiulachs at svn.reactos.org
Sat Nov 3 00:19:18 CET 2007


Author: mpiulachs
Date: Sat Nov  3 02:19:18 2007
New Revision: 30081

URL: http://svn.reactos.org/svn/reactos?rev=30081&view=rev
Log:
Implement the autogenerated credits header file (autocontributors.h) in INTERMEDIATE/include/reactos/autocontributors.h together with Colin

Modified:
    branches/rbuild/reactos/tools/rbuild/creditsgeneratorenerator.cpp
    branches/rbuild/reactos/tools/rbuild/rbuild.h

Modified: branches/rbuild/reactos/tools/rbuild/creditsgeneratorenerator.cpp
URL: http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/creditsgeneratorenerator.cpp?rev=30081&r1=30080&r2=30081&view=diff
==============================================================================
--- branches/rbuild/reactos/tools/rbuild/creditsgeneratorenerator.cpp (original)
+++ branches/rbuild/reactos/tools/rbuild/creditsgeneratorenerator.cpp Sat Nov  3 02:19:18 2007
@@ -34,6 +34,13 @@
 void
 CreditsGenerator::Generate ()
 {
+    GenerateTxt ();
+    GenerateHeader ();
+}
+
+void
+CreditsGenerator::GenerateTxt ()
+{
 	char* buf;
 	char* s;
 
@@ -69,3 +76,35 @@
 
 	free ( buf );
 }
+
+void
+CreditsGenerator::GenerateHeader ()
+{
+	char* buf;
+	char* s;
+
+	buf = (char*) malloc ( 512*1024 );
+	if ( buf == NULL )
+		throw OutOfMemoryException ();
+	
+	s = buf;
+	s = s + sprintf ( s, "/* Auto generated */\n");
+	s = s + sprintf ( s, "\n" );
+    s = s + sprintf ( s, "const char* szAutoContributors[]= {\n" );
+
+    for ( size_t i = 0; i < project.contributors.size (); i++ )
+	{
+        Contributor& contributor = *project.contributors[i];
+
+	    s = s + sprintf ( s, "\t\"%s %s\",\n" , 
+            contributor.firstName.c_str() , 
+            contributor.lastName.c_str());
+	}
+
+    s = s + sprintf ( s, "\t0\n");
+    s = s + sprintf ( s, "                                   };" );
+
+	FileSupportCode::WriteIfChanged ( buf, NormalizeFilename ( Environment::GetIntermediatePath () + sSep + "include" + sSep + "reactos" + sSep + "autocontributors.h" ) );
+
+	free ( buf );
+}

Modified: branches/rbuild/reactos/tools/rbuild/rbuild.h
URL: http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/rbuild.h?rev=30081&r1=30080&r2=30081&view=diff
==============================================================================
--- branches/rbuild/reactos/tools/rbuild/rbuild.h (original)
+++ branches/rbuild/reactos/tools/rbuild/rbuild.h Sat Nov  3 02:19:18 2007
@@ -1182,7 +1182,9 @@
 	const Project& project;
 	CreditsGenerator ( const Project& project );
 	~CreditsGenerator ();
-	void Generate ();
+    void Generate();
+	void GenerateTxt();
+    void GenerateHeader ();
 private:
 };
 




More information about the Ros-diffs mailing list