LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
genwindef.cc File Reference
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <assert.h>
#include <windows.h>

Go to the source code of this file.

Classes

class  CLibSymbolInfo
 
class  MEMORY_MAPPED_FILE
 

Namespaces

 windef
 

Macros

#define AFX_LIBSYMBOLINFO_H__1A7003B4_BA53_11D1_AE46_1CFB51000000__INCLUDED_
 
#define MakePtr(cast, ptr, addValue)   (cast)( (DWORD)(ptr) + (DWORD)(addValue))
 

Typedefs

typedef MEMORY_MAPPED_FILEPMEMORY_MAPPED_FILE
 

Enumerations

enum  errMMF {
  errMMF_NoError, errMMF_FileOpen, errMMF_FileMapping, errMMF_MapView,
  errMMF_NoError, errMMF_FileOpen, errMMF_FileMapping, errMMF_MapView
}
 

Functions

void windef::usage ()
 
int main (int argc, char **argv)
 

Macro Definition Documentation

#define AFX_LIBSYMBOLINFO_H__1A7003B4_BA53_11D1_AE46_1CFB51000000__INCLUDED_

Definition at line 46 of file genwindef.cc.

#define MakePtr (   cast,
  ptr,
  addValue 
)    (cast)( (DWORD)(ptr) + (DWORD)(addValue))

Definition at line 106 of file genwindef.cc.

Typedef Documentation

Definition at line 100 of file genwindef.cc.

Enumeration Type Documentation

enum errMMF
Enumerator
errMMF_NoError 
errMMF_FileOpen 
errMMF_FileMapping 
errMMF_MapView 
errMMF_NoError 
errMMF_FileOpen 
errMMF_FileMapping 
errMMF_MapView 

Definition at line 77 of file genwindef.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 359 of file genwindef.cc.

References tca::debug, CLibSymbolInfo::DumpSymbols(), and windef::usage().

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