Made UAE buildable again.
[AROS-Contrib.git] / regina / common / fixrc.rexx
blob42ce4e6a58e978dd1086d87272e7b38aedee59a8
1 /*
2 * This program converts a generic Win32 resource file into a version-specific
3 * one.
4 * Parameters:
5 * Input: input rc file
6 * Output: output rc file with version numbers
7 * Version: in x.x format
8 * Assumptions: input file exists and in correct format
9 * output file is writeable
11 Parse Arg input output version verdate
12 verdate = Strip( verdate, 'B', '"' )
13 verdot = version
14 num_dots = Countstr( '.', verdot )
15 Select
16 When num_dots = 1 Then
18 qm_ver = '?.?'
19 qm_vercomma = '?,?'
20 End
21 When num_dots = 2 Then
23 qm_ver = '?.?.?'
24 qm_vercomma = '?,?,?'
25 End
26 Otherwise Say 'Invalid verdot format:' verdot'. Must be x.x or x.x.x'
27 End
28 vercomma = Changestr( '.', version, ',' )
29 veryear = Left( Date( 'S' ), 4 )
30 Call Stream input, 'C', 'OPEN READ'
31 Call Stream output, 'C', 'OPEN WRITE REPLACE'
32 Do While Lines( input) > 0
33 line = Linein( input )
34 line = Changestr( qm_ver, line, verdot )
35 line = Changestr( qm_vercomma, line, vercomma )
36 line = Changestr( '????????', line, verdate )
37 line = Changestr( '????', line, veryear )
38 Call Lineout output, line
39 End
40 Call Stream input, 'C', 'CLOSE'
41 Call Stream output, 'C', 'CLOSE'
42 Return 0