home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 13.ddi / INDEPSRC.ZIP / NOTIMP.CPP next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.4 KB  |  68 lines

  1. //  NOTIMP.CPP
  2. //
  3. //  Generates .ASM files for functions not implemented in windows,
  4. //  along with linker response file (NOTIMP.RSP) which will pull
  5. //  all the .OBJ files into a lib.
  6. //
  7. //  Usage:
  8. //
  9. //  NOTIMP < NOTIMP.LST
  10. //
  11. //  tasm *.asm
  12. //
  13. //  TLIB cwins @NOTIMP.RSP
  14.  
  15. #include <string.h>
  16. #include <fstream.h>
  17.  
  18. int started = 0;
  19. ofstream rsp( "notimp.rsp" );
  20.  
  21. char fileName[] = "notimpaa";
  22. void nextName()
  23. {
  24.     if( ++fileName[7] > 'z' )
  25.         {
  26.         fileName[7] = 'a';
  27.         fileName[6]++;
  28.         }
  29. }
  30.  
  31. void genProg( const char *func )
  32. {
  33.     char name[ 20 ];
  34.     strcpy( name, fileName );
  35.     strcat( name, ".asm" );
  36.     cerr << func << endl;
  37.     ofstream out( name );
  38.     out << "_TEXT   segment" << endl;
  39.     out << "        assume CS:_TEXT" << endl << endl;
  40.     out << "extrn   " << func << "_Not_Windows" << endl << endl;
  41.     out << "public  _" << func << endl;
  42.     out << "_" << func << ":" << endl;
  43.     out << "        call " << func << "_Not_Windows" << endl;
  44.     out << "        ends" << endl;
  45.     out << "        end" << endl;
  46.     strcpy( name, fileName );
  47.     if( started != 0 )
  48.         rsp << " &" << endl;
  49.     else
  50.         started = 1;
  51.     rsp << "+" << name;
  52.     nextName();
  53. }
  54.  
  55. int main()
  56. {
  57.     char name[ 128 ];
  58.     cin >> name;
  59.     while( !cin.eof() )
  60.         {
  61.         genProg( name );
  62.         cin >> name;
  63.         }
  64.     return 0;
  65. }
  66.  
  67.  
  68.