| The Gaudi Framework v28r2p1 (f1a77ff4)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

genwindef.cpp
Go to the documentation of this file.
1 #ifdef _WIN32
2 // Disable a warning in Boost program_options headers:
3 // inconsistent linkage in program_options/variables_map.hpp
4 #pragma warning ( disable : 4273 )
5 #define popen _popen
6 #define pclose _pclose
7 #define fileno _fileno
8 #include <stdlib.h>
9 #endif
10
11 // Include files----------------------------------------------------------------
12 #include <vector>
13 #include <string>
14 #include <iostream>
15 #include <fstream>
16 #include "LibSymbolInfo.h"
17
18 using namespace std;
19
20 namespace windef {
21 void usage(){
22 cerr << "Usage: genwindef [-l <dllname>] [-o <output-file> | exports.def] <obj or lib filenames>" << endl;
23 exit(1);
24 }
25 }
26
27 //--- Command main program-----------------------------------------------------
28 int main ( int argc, char** argv )
29 //-----------------------------------------------------------------------------
30 {
31 string outfile("exports.def");
32 string library("UnknownLib");
33 string objfiles;
34 bool debug(false);
35
36 int arg;
37 if (argc < 3) windef::usage();
38 arg = 1;
39 while (argv[arg][0] == '-') {
40 if (strcmp(argv[arg], "--") == 0) {
41 windef::usage();
42 }
43 else if (strcmp(argv[arg], "-l") == 0) {
44 arg++;
45 if (arg == argc) windef::usage();
46 library = argv[arg];
47 }
48 else if (strcmp(argv[arg], "-o") == 0) {
49 arg++;
50 if (arg == argc) windef::usage();
51 outfile = argv[arg];
52 }
53 arg++;
54 }
55 if (arg == argc) windef::usage();
56 for (arg; arg < argc; arg++) {
57 objfiles += argv[arg];
58 if( arg+1 < argc) objfiles += " ";
59 }
60
61 CLibSymbolInfo libsymbols;
62 ofstream out(outfile);
63 if(out.fail()) {
64 cerr << "windef: Error opening file " << outfile << endl;
65 return 1;
66 }
67 out << "LIBRARY " << library << endl;
68 out << "EXPORTS" << endl;
69
70 libsymbols.DumpSymbols(const_cast<char*>(objfiles.c_str()), out);
71
72 out.close();
73
74
75 return 0;
76 }
gaudirun.argv
list argv
Definition: gaudirun.py:227
std::ofstream::fail
T fail(T...args)
std::endl
T endl(T...args)
usage
void usage(std::string argv0)
Definition: listcomponents.cpp:38
std
STL namespace.
main
int main(int argc, char **argv)
Definition: genwindef.cpp:28
LibSymbolInfo.h
std::ofstream
STL class.
std::exit
T exit(T...args)
std::strcmp
T strcmp(T...args)
std::ofstream::close
T close(T...args)
CLibSymbolInfo
Definition: LibSymbolInfo.h:15
plotBacklogPyRoot.argc
argc
Definition: plotBacklogPyRoot.py:128
windef
Definition: genwindef.cpp:20
std::string::c_str
T c_str(T...args)
windef::usage
void usage()
Definition: genwindef.cpp:21
std::cerr
CLibSymbolInfo::DumpSymbols
BOOL DumpSymbols(LPTSTR lpszLibPathName, std::ostream &pFile)
Definition: LibSymbolInfo.cpp:43