source: trunk/Distribution/Scripts/FO2MIF.CMD@ 2

Last change on this file since 2 was 2, checked in by jkacer, 18 years ago

Added all DocBook Framework stuff:

  • DocBook DTD
  • Transformation software FOP 0.20.5 and Saxon 6
  • XSL styles
  • Rexx scripts

Also added some WarpIN-related stuff for creation of WarpIN installation packages.
This state corresponds to version 1.0.0 from November 2005, just slightly modified to carry versioning information (Rexx scripts).

  • Property svn:keywords set to Author Revision Date HeadURL Id
File size: 3.1 KB
Line 
1/*
2 *************************************************************************************
3 *
4 * DocBook Framework for OS/2 and eComStation
5 * Convert Formatting Objects to Maker Interchange Format
6 *
7 * More info on the web:
8 * http://www.kacer.biz/os2/docbook-framework/
9 *
10 * Author:
11 * Jarda Kacer <mailto:jarda@kacer.biz>
12 *
13 *************************************************************************************
14 *
15 * This script converts a FO file to a MIF file.
16 *
17 *************************************************************************************
18 *
19 * $Author: jkacer $
20 * $Revision: 2 $
21 * $Date: 2007-09-05 20:07:46 +0000 (Wed, 05 Sep 2007) $
22 * $HeadURL: trunk/Distribution/Scripts/FO2MIF.CMD $
23 *
24 *************************************************************************************
25 */
26
27OuterEnv = SetLocal()
28
29CALL RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
30CALL SysLoadFuncs
31
32SAY "Sorry, this feature is not available yet."
33
34/*
35Arguments = ARG(1)
36
37IF WORDS(Arguments) = 1
38 THEN DO
39 InputFile = WORD(Arguments, 1)
40 OutputFile = SUBSTR(InputFile, 1, LASTPOS(".", InputFile)-1) || ".MIF"
41 CALL FOP "-fo " || InputFile || " -mif " || OutputFile
42 END
43 ELSE DO
44 CALL PrintUsage
45 END
46*/
47
48CALL EndLocal
49EXIT
50
51
52/***********************************************************************************************/
53/* Procedures and functions */
54/***********************************************************************************************/
55
56
57/*
58 * Sets an environment variable or appends a value to it.
59 */
60AddEnvironment: PROCEDURE
61PARSE ARG VarName, VarValue
62IF (Value(VarName, , "OS2ENVIRONMENT")="")
63 THEN CALL SetEnvironment VarName, VarValue
64 ELSE CALL Value VarName, GetEnvironment(VarName) || ";" || VarValue, "OS2ENVIRONMENT"
65RETURN
66
67
68/*
69 * Sets an environment variable, overwriting its previous value.
70 */
71SetEnvironment: PROCEDURE
72PARSE ARG VarName, VarValue
73CALL Value VarName, VarValue, "OS2ENVIRONMENT"
74RETURN
75
76
77/*
78 * Returns the value of an environment variable.
79 */
80GetEnvironment: PROCEDURE
81PARSE ARG VarName
82RETURN Value(VarName, , "OS2ENVIRONMENT")
83
84
85/*
86 * Returns the current script name.
87 */
88GetScriptName: PROCEDURE
89PARSE SOURCE Result
90RETURN WORD(Result, 3)
91
92
93/*
94 * Returns the current script path, without "\" at the end.
95 */
96GetScriptPath: PROCEDURE
97ScriptName = GetScriptName()
98RETURN SUBSTR(ScriptName, 1, LASTPOS("\", ScriptName)-1)
99
100
101/*
102 * Returns True if the given file exists.
103 */
104FileExists: PROCEDURE
105PARSE ARG FileName
106CALL SysFileTree FileName, Result
107RETURN Result.0 > 0
108
109
110/*
111 * Returns the current directory, without "\" at the end.
112 */
113GetCurrentDir: PROCEDURE
114RETURN DIRECTORY()
115
116
117/*
118 * Returns the parent directory of the directory passed as argument, without "\" at the end.
119 */
120GetParentDirectory: PROCEDURE
121PARSE ARG DirName
122RETURN SUBSTR(DirName, 1, LASTPOS("\", DirName)-1)
123
124
125/*
126 * Prints out a short help on how to call this script.
127 */
128PrintUsage: PROCEDURE
129SAY "DocBook Framework for OS/2, Formatting Objects --> Maker Interchange Format"
130SAY "Usage: FO2MIF <Formatting Objects>"
131RETURN
132
Note: See TracBrowser for help on using the repository browser.