360{
361 string outfile("exports.def");
362 string library("UnknownLib");
363 string objfiles;
365
366 int arg;
368 arg = 1;
369 while (argv[arg][0] == '-') {
370 if (strcmp(argv[arg], "--") == 0) {
372 }
373 else if (strcmp(argv[arg], "-l") == 0) {
374 arg++;
376 library = argv[arg];
377 }
378 else if (strcmp(argv[arg], "-o") == 0) {
379 arg++;
381 outfile = argv[arg];
382 }
383 arg++;
384 }
386 for (arg; arg < argc; arg++) {
387 objfiles += argv[arg];
388 if( arg+1 < argc) objfiles += " ";
389 }
390
392 ofstream out(outfile.c_str());
393 if(out.fail()) {
394 cerr << "windef: Error opening file " << outfile << endl;
395 return 1;
396 }
397 out << "LIBRARY " << library << endl;
398 out << "EXPORTS" << endl;
399
400 libsymbols.
DumpSymbols(
const_cast<char*
>(objfiles.c_str()), out);
401
402 out.close();
403
404
405 return 0;
406}
BOOL DumpSymbols(LPTSTR lpszLibPathName, std::ostream &pFile)