LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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)(ptr) + (DWORD_PTR)(addValue))
 

Typedefs

typedef MEMORY_MAPPED_FILEPMEMORY_MAPPED_FILE
 

Enumerations

enum  errMMF { 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 45 of file genwindef.cc.

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

Definition at line 105 of file genwindef.cc.

Referenced by CLibSymbolInfo::Dump().

Typedef Documentation

Definition at line 99 of file genwindef.cc.

Enumeration Type Documentation

enum errMMF
Enumerator
errMMF_NoError 
errMMF_FileOpen 
errMMF_FileMapping 
errMMF_MapView 

Definition at line 76 of file genwindef.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 358 of file genwindef.cc.

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

360 {
361  string outfile("exports.def");
362  string library("UnknownLib");
363  string objfiles;
364  bool debug(false);
365 
366  int arg;
367  if (argc < 3) windef::usage();
368  arg = 1;
369  while (argv[arg][0] == '-') {
370  if (strcmp(argv[arg], "--") == 0) {
371  windef::usage();
372  }
373  else if (strcmp(argv[arg], "-l") == 0) {
374  arg++;
375  if (arg == argc) windef::usage();
376  library = argv[arg];
377  }
378  else if (strcmp(argv[arg], "-o") == 0) {
379  arg++;
380  if (arg == argc) windef::usage();
381  outfile = argv[arg];
382  }
383  arg++;
384  }
385  if (arg == argc) windef::usage();
386  for (arg; arg < argc; arg++) {
387  objfiles += argv[arg];
388  if( arg+1 < argc) objfiles += " ";
389  }
390 
391  CLibSymbolInfo libsymbols;
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)
Definition: genwindef.cc:130
DebugStuff debug
Definition: DebugStruct.cxx:4
void usage()
Definition: genwindef.cc:350