// -------------------------------------------------------------------------
int main( int argc, char* argv[] )
{
- if( argc < 3 )
+ if( argc < 4 )
{
std::cerr
<< "Usage: " << argv[ 0 ]
- << " output_file header_file_0.h header_file_0.h ..."
+ << " plugins_name output_file header_file_0.h header_file_0.h ..."
<< std::endl;
return( 1 );
} // fi
+ std::string plugins_name = argv[ 1 ];
// Parse all header files
TInfo info;
- for( int i = 2; i < argc; ++i )
+ for( int i = 3; i < argc; ++i )
process_header( info, argv[ i ] );
if( info.size( ) == 0 )
{
} // fi
// Write data
- std::ofstream out_stream( argv[ 1 ] );
+ std::ofstream out_stream( argv[ 2 ] );
// Write include section
- for( int i = 2; i < argc; ++i )
+ for( int i = 3; i < argc; ++i )
out_stream << "#include \"" << argv[ i ] << "\"" <<std::endl;
// Write init/finish section
std::string export_prefix = "__attribute__((visibility(\"default\")))";
#endif // defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ )
+ // Write plugins name function
+ out_stream
+ << std::endl
+ << "extern \"C\" " << export_prefix << " const char* "
+ << "cpPlugins_Name( )" << std::endl << "{" << std::endl
+ << " return( \"" << plugins_name << "\" );" << std::endl
+ << "}" << std::endl << std::endl;
+
// Write access function
out_stream
<< std::endl