$! $! DECW$DXM_PORT.COM - Run XUI to Motif porting tools $! $! (c) Copyright 2010 Hewlett-Packard Development Company, L.P. $! $! Proprietary computer software. Valid license from HP required for $! possession, use or copying. Consistent with FAR 12.211 and 12.212, $! Commercial Computer Software, Computer Software Documentation, and $! Technical Data for Commercial Items are licensed to the U.S. Government $! under vendor's standard commercial license. $! $! p1 - input file or directory $! p2 - output file or directory $! p3 - switches $! $ SAY = "write sys$output" $ TRUE = 1 $ FALSE = 0 $ $ $ if p1 .eqs. "" then inquire/nopunc p1 "Source file or directory: " $ if p2 .eqs. "" then inquire/nopunc p2 "Output file or directory: " $! $! $ log = FALSE $ case_insensitive = "SENSITIVE" $ cstext = FALSE $ num = 0 $ $ PARSE_SWITCH: $ $ switch = f$element(num, ",", p3) $ if switch .eqs. "," then goto END_PARSE_SWITCH $ $ if switch .eqs. "LOG" then log = TRUE $ if switch .eqs. "INSENSITIVE" then case_insensitive = "INSENSITIVE" $ if switch .eqs. "DXMCSTEXT" then CSTEXT = TRUE $ $ num = num + 1 $ goto PARSE_SWITCH $ $ END_PARSE_SWITCH: $ $ filename = f$parse(p1,"SYS$DISK:[]",,"NAME") $ if filename .eqs. "" $ then $ do_whole_directory = TRUE $ p1 = p1 + "*.*" $ if f$parse(p2) .eqs. "" $ then $ create/directory/log 'p2 $ endif $ else $ do_whole_directory = FALSE $ endif $ $ LOOP: $ if do_whole_directory $ then $ nextfile = f$search(p1) $ if nextfile .nes. "" $ then $ more = TRUE $ filetype = f$parse(nextfile,"SYS$DISK:[]",,"TYPE") $ if ( filetype .eqs. ".C" .or. - filetype .eqs. ".H" .or. - filetype .eqs. ".UIL") $ then $ outfile = f$parse(p2,,nextfile) $ if log then SAY "Converting ",nextfile, " to ", outfile $ call PORT_ONE_FILE 'nextfile 'outfile 'log 'case_insensitive $ else $ if log then SAY "Skipping ",nextfile $ endif $ else $ more = FALSE $ endif $ else $ call PORT_ONE_FILE 'p1 'p2 'log 'case_insensitive $ more = FALSE $ endif $ if more then goto LOOP $ exit $ $! $! Subroutine PORT_ONE_FILE - converts one file $! $ PORT_ONE_FILE: SUBROUTINE $ $ log = p3 $ $ filetype = f$parse(p1,"SYS$DISK:[]",,"TYPE") $ if filetype .eqs. ".UIL" $ then $ uil = TRUE $ else $ uil = FALSE $ endif $! $ if CSTEXT $ then $ if log then SAY " Convert Text to CStext" $ define/user sys$input 'p1 $ define/user sys$output 'p2 $ command := "$ DECW$EXAMPLES:DXM_PORT_CSTEXT.EXE" $ command 'case_insensitive $ endif $ $ if log then SAY " 1st pass - convert resources" $ command = "$ DECW$EXAMPLES:DECW$DXM_PORT_RESOURCES.EXE" $ if CSTEXT $ then $ define/user sys$input 'p2 $ else $ define/user sys$input 'p1 $ endif $ define/user sys$output 'p2 $ command 'case_insensitive $ $ if log then SAY " 2nd pass - convert calls" $ define/user sys$input 'p2 $ define/user sys$output 'p2 $ command = "$ DECW$EXAMPLES:DECW$DXM_PORT_CALL.EXE" $ command 'case_insensitive $ $ if log then SAY " 3rd pass - convert high levels" $ define/user sys$input 'p2 $ define/user sys$output 'p2 $ command = "$ DECW$EXAMPLES:DECW$DXM_PORT_HILEVELS.EXE" $ command 'case_insensitive $ $ if log then SAY " 4th pass - convert low levels" $ define/user sys$input 'p2 $ define/user sys$output 'p2 $ command = "$ DECW$EXAMPLES:DECW$DXM_PORT_LOLEVELS.EXE" $ command 'case_insensitive $ $ if log then SAY " 5th pass - convert class" $ define/user sys$input 'p2 $ define/user sys$output 'p2 $ command = "$ DECW$EXAMPLES:DECW$DXM_PORT_CLASS.EXE" $ command 'case_insensitive $ $ if log then SAY " 6th pass - convert data" $ define/user sys$input 'p2 $ define/user sys$output 'p2 $ command = "$ DECW$EXAMPLES:DECW$DXM_PORT_DATA.EXE" $ command 'case_insensitive $ $ if log then SAY " 7th pass - convert DRM" $ define/user sys$input 'p2 $ define/user sys$output 'p2 $ command = "$ DECW$EXAMPLES:DECW$DXM_PORT_DRM.EXE" $ command 'case_insensitive $ $ if log then SAY " 8th pass - convert includes" $ define/user sys$input 'p2 $ define/user sys$output 'p2 $ command = "$ DECW$EXAMPLES:DECW$DXM_PORT_INCLUDES.EXE" $ command 'case_insensitive $ $! ONLY DO THIS PASS IF IT'S A UIL FILE $ if uil $ then $ if log then SAY " Last pass - convert UIL" $ define/user sys$input 'p2 $ define/user sys$output 'p2 $ command = "$ DECW$EXAMPLES:DECW$DXM_PORT_UIL.EXE" $ command 'case_insensitive $ endif $ $ if log then SAY " Conversion passes completed" $ $ ENDSUBROUTINE