From: Tim R. <ti...@us...> - 2004-08-05 15:50:57
|
Update of /cvsroot/csdopenglnet/csdOpenGL/generator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27231 Modified Files: config.cs function.cs generator.cs typedef.cs Log Message: a list of function names can be specified which will not be wrapped Index: config.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/generator/config.cs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** config.cs 5 Aug 2004 15:05:28 -0000 1.1 --- config.cs 5 Aug 2004 15:50:48 -0000 1.2 *************** *** 50,53 **** --- 50,57 ---- public ArrayList typedefFiles; + [System.Xml.Serialization.XmlArray("IgnoreFunctions")] + [System.Xml.Serialization.XmlArrayItem("Function",typeof(string))] + public ArrayList ignoreFunctions; + public Configuration() { xmlInput = "XML"; *************** *** 60,63 **** --- 64,69 ---- typedefFiles = new ArrayList(); typedefFiles.Add( "File" ); + ignoreFunctions = new ArrayList(); + ignoreFunctions.Add( "Function" ); } } Index: typedef.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/generator/typedef.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** typedef.cs 5 Aug 2004 13:09:15 -0000 1.3 --- typedef.cs 5 Aug 2004 15:50:48 -0000 1.4 *************** *** 55,62 **** } ! public TypeDef( StreamWriter w, string addTypes ) : this ( w ) { ! tList.Add( "CGcontext", "CGcontext" ); ! tList.Add( "CGprogram", "CGprogram" ); ! tList.Add( "CGparameter", "CGparameter" ); } --- 55,63 ---- } ! public TypeDef( StreamWriter w, ArrayList typedefs ) : this ( w ) { ! IEnumerator e = typedefs.GetEnumerator(); ! while (e.MoveNext()) { ! tList.Add( (string)e.Current, (string)e.Current ); ! } } Index: function.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/generator/function.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** function.cs 5 Aug 2004 13:09:15 -0000 1.2 --- function.cs 5 Aug 2004 15:50:48 -0000 1.3 *************** *** 39,42 **** --- 39,44 ---- protected ArrayList baseTypes; + protected ArrayList ignoreFunctions; + /** \brief Constructor *************** *** 47,51 **** * @param l the name of the library to be wrapped */ ! public Function( StreamWriter w, TypeDef t, string l ) { Debug.Indent(); Debug.WriteLine( "Entering Function.Function(StreamWriter)" ); --- 49,53 ---- * @param l the name of the library to be wrapped */ ! public Function( StreamWriter w, TypeDef t, string l, ArrayList _ignoreFunctions ) { Debug.Indent(); Debug.WriteLine( "Entering Function.Function(StreamWriter)" ); *************** *** 54,57 **** --- 56,60 ---- typedef = t; lib = l; + ignoreFunctions = _ignoreFunctions; list = new ArrayList(); *************** *** 69,73 **** baseTypes.Add( "uint" ); baseTypes.Add( "ulong" ); - baseTypes.Add( "string" ); Debug.WriteLine( "Exiting Function.Function(StreamWriter)" ); --- 72,75 ---- *************** *** 169,181 **** p.Add( ap.Trim() ); ! list.Add( new FunctionSet( t, n, p ) ); // add function declaration ! ! Console.Write( "Function: " ); Console.WriteLine( n ); ! Debug.WriteLine( "Exiting Function.add(string)" ); Debug.Unindent(); } /** \build process scanned function declarations * --- 171,197 ---- p.Add( ap.Trim() ); ! if (valid(n)) { ! list.Add( new FunctionSet( t, n, p ) ); // add function declaration ! Console.Write( "Function: " ); ! } else { ! Console.Write( "Ignored function: " ); ! } Console.WriteLine( n ); ! Debug.WriteLine( "Exiting Function.add(string)" ); Debug.Unindent(); } + protected bool valid( string function ) { + IEnumerator e = ignoreFunctions.GetEnumerator(); + bool res = true; + + while ( res && (e.MoveNext()) ) { + res = !(function==((string)e.Current)); + } + + return res; + } + /** \build process scanned function declarations * Index: generator.cs =================================================================== RCS file: /cvsroot/csdopenglnet/csdOpenGL/generator/generator.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** generator.cs 5 Aug 2004 15:05:28 -0000 1.3 --- generator.cs 5 Aug 2004 15:50:48 -0000 1.4 *************** *** 81,86 **** writer = new StreamWriter( fs ); // bind stream to file define = new Define( writer ); // initialize define compiler ! typedef = new TypeDef( writer ); // initialize typedef compiler ! function = new Function( writer, typedef, config.linkLibrary ); // initiaize function compiler writeHeader(); // write file header --- 81,86 ---- writer = new StreamWriter( fs ); // bind stream to file define = new Define( writer ); // initialize define compiler ! typedef = new TypeDef( writer, config.baseTypes ); // initialize typedef compiler ! function = new Function( writer, typedef, config.linkLibrary, config.ignoreFunctions ); // initiaize function compiler writeHeader(); // write file header |