home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 26 / AACD 26.iso / AACD / Magazine / ActiveShareware / SecondSpin / docs / HowToCreateEncoder.lha / SecondSpin_Encoder / create_amigaversion.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1999-12-02  |  1.3 KB  |  56 lines

  1. /*
  2.  
  3. SecondSpin Encoder $version creator - (c) lauri.ahonen@pp.inet.fi -zuulikuuli 1999
  4.  
  5.  Purpose: Simply creates a C-Sourcefile called amigaversion.c which contains
  6.           const char - variable to be included in the executable.
  7.  
  8.  Usage..: rx create_amigaversion.rexx PROCESSOR/K
  9.  
  10.  Example: rx create_amigaversion.rexx 68060FPU
  11.  
  12. This file must be modified to comply with new versions of lame engine in
  13. order to make a SecondSpin compatible executable.
  14.  
  15. Very basic, but it works.
  16.  
  17. */
  18.  
  19. options results
  20.  
  21. parse arg processor
  22.  
  23. call open file, ('version.h'), 'R'
  24.  
  25.    do loop=1 until eof(file)
  26.  
  27.     line=readln(file)
  28.  
  29.         if index(line,'LAME_MAJOR_VERSION')>0 then do
  30.  
  31.         LAMEVERSION1=substr(line,index(line,'LAME_MAJOR_VERSION')+length(LAME_MAJOR_VERSION)+1,2)
  32.  
  33.         end
  34.  
  35.         if index(line,'LAME_MINOR_VERSION')>0 then do
  36.  
  37.         LAMEVERSION2=substr(line,index(line,'LAME_MINOR_VERSION')+length(LAME_MINOR_VERSION)+1,2)
  38.  
  39.         end
  40.  
  41.    end
  42.  
  43. call close file
  44.  
  45. lameversion1=strip(lameversion1,'B','    ')
  46. lameversion2=strip(lameversion2,'B','    ')
  47.  
  48. call open file, ('amigaversion.c'), 'W'
  49.  
  50. call writeln file, '/* Secondspin encoder amiga version stuff */'
  51. call writeln file, ''
  52. call writeln file, 'const char version[] = "$VER: SecondSpin encoder 'processor' lame core v'lameversion1'.'lameversion2' " __AMIGADATE__ ;'
  53.  
  54. call close file
  55.  
  56.