*** empty log message ***
[h316.git] / pc-tools / ldc2 / doc / req_spec.tex
CommitLineData
ad324d29 1\section{Functional Specification}
290011d2 2
3%*******************************************************************************
4\subsection{Data input processing}
5
6\rd{inp001}{Data source select}{
7 The tape data in Honeywell silent 4/6/6 code
8 \cite{ser16:progref:bformats} shall be read in from standard input or
9 from an input file.
10}
11
12%*******************************************************************************
13\subsection{Data integrity checks}
14
15The tape data shall be checked against the Honeywell tape block specification
16found in \cite{ser16:progref:bformats}.
17
ad324d29 18\rd{chk001}{Block integrity check}{
19 Every data block's integrity shall be checked by the means of
290011d2 20 detecting unexpected end of file while reading in the block.
21}
22
23\rd{chk002}{Block checksum check}{
24 Every data block's checksum shall be calculated and checked according
25 to \cite{ser16:progref:bformats}.
26}
27
28\rd{chk003}{Block type check}{
29 Every data block contains its blocktype encoded in a specified location.
30 It shall be checked that each data block's type field contains one of
31 the type codes described in \cite{ser16:progref:bformats}.
32}
33
34\rd{chk004}{Object integrity check}{
35 Every object on the tape (i.e. the output of one DAP-16 or FORTRAN IV
36 compiler run) consists of multiple data blocks.
37 According to \cite{ser16:progref:bformats}, the last block of each
38 object must be of one of the end block types.\\
39 It shall be checked if the last data block read before end of input or
40 an end of tape mark is an appropriate end block.
41}
42
43\rd{chk005}{Interactive checksum error handling}{
44 The program shall be configurable to pause block processing on
45 detection of a checksum error (\req{chk002}) and resume processing after
46 user intervention.\\
47 This feature is incompatible with data input from standard input.
48}
49
50%*******************************************************************************
ad324d29 51\subsection{Additional features}
52
53\rd{h001}{Print help message}{
54 A help message is output to standard error.
55}
56
57%*******************************************************************************
58\newpage
290011d2 59\subsection{Data analysis}
60
61\rd{da001}{List tape contents}{
62 Output a list containing a human-readable fixed-format description
63 of all blocks contained in the input data.\\
64 The output line format shall be unified for all block types.
65}
66
67\rd{da002}{List exported symbols}{
68 Output a list of all exported symbols.
69}
70
71\rd{da003}{List called symbols}{
72 Output a list of all called symbols.
73}
74
75\rd{da004}{List unsatisfied dependencies}{
76 Output a list of all unsatisfied dependencies i.e.
77 all called symbols that appear in the output of \req{dp003} but
78 not in the output of \req{dp002}.
79}
80
81\rd{da005}{Tape information output}{
82 It shall be possible to output a line containing at least
83 the following information about a tape image:
84 \begin{itemize}
85 \item Number of bytes read from data source
86 \item Number of blocks read in
87 \end{itemize}
88}
89
90\rd{da006}{Text output}{
91 Text from \req{da001},\req{da002},\req{da003}, \req{da004},
92 and \req{da005} is output to standard output or to a file.
93}
94
95%*******************************************************************************
ad324d29 96\newpage
290011d2 97\subsection{Data processing}
98
99\rd{dp001}{Split into object files}{
100 The tape data shall be divided into self-contained object files.\\
101 The generated file names are derived from the first symbol name
102 defined in the current object.\\
103 Example: If an object exports the symbols SONNE, MOND
104 and STERNE, the resulting file name will be SONNE.\\
105 EOT (end of tape) blocks shall not be output in this mode of operation.
106}
107
108\rd{dp002}{Split into numbered object files}{
109 Similar to \req{dp006}, but the object file names are prepended with
110 a zero-padded three digit number and EOT blocks are not suppressed.
111}
112
290011d2 113%*******************************************************************************
ad324d29 114\newpage
290011d2 115\subsection{Program configuration}
116
117\rd{cfg001}{Configuration process}{
ad324d29 118 The following sequence shall be used to acquire the working
119 configuration:
290011d2 120 \begin{enumerate}
121 \item Configuration file according to environment variable:\\
122 If the environment variable LDC\_CONFIG is set, that
123 file shall be parsed.
124 \item Configuration file according to command line parameter:\\
125 If the command line parameter specifying a configuration
126 file is found,
127 the specified configuration file is parsed.\\
128 Any values in this configuration file
ad324d29 129 override values found in the previously read
130 configuration file.
290011d2 131 \item Configuration parameters passed via the command line:\\
132 Parameters passed on the command line will override
133 values from previously read configuration files.
134 \end{enumerate}
135}
136
137\rd{cfg002}{Parameter types}{
138 The program shall accept two types of parameters:
139 \begin{itemize}
140 \item Switches:\\
ad324d29 141 A switch is a binary value which can have the value true or
142 false.
290011d2 143 \item Strings:\\
144 A string parameter is a parameter requiring a string value.\\
145 A typical use would be a file name for input or output.
146 \end{itemize}
147}
148
ad324d29 149\newpage
290011d2 150\rd{cfg003}{Switch parameters}{
151 The following switch parameters shall be accepted:
152 \begin{table}[H]\begin{center}
ad324d29 153 \begin{tabular}{|r|p{2.5em}|p{23em}|}
290011d2 154 \hline
155 \bf Long Form & \bf Short form & \bf Description\\
156 \hline
157 help & h & Show help message (\req{h001})\\
ad324d29 158 output\_info & a & Output data info (\req{da005}) .\\
159 output\_called & c & Output a list of called symbols
160 (\req{da003}).\\
161 output\_exported & e & Output a list of exported symbols
162 (\req{da002}).\\
163 output\_unsatisfied & u & Output a list of unsatisfied
164 dependencies (\req{da004}).\\
165 split\_objects & s & Split into object files
166 (\req{dp001}).\\
167 split\_objects\_numbered & S & Split into numbered object files
168 (\req{dp002}).\\
169 ignore\_block\_errors & b & Ignore block integrity errors
170 (\req{err001},\req{chk001}).\\
171 ignore\_checksum\_errors & k & Ignore Checksum errors
172 (\req{err001}\req{chk002}).\\
173 pause\_on\_checksum\_error & p & Wait for user input on checksum error
174 (\req{chk005}).\\
175 ignore\_unknown\_block\_errors & n & Ignore errors causes by
176 datablocks of unknown type
177 (\req{err001}\req{chk003}).\\
178 ignore\_object\_integrity\_errors & g & Ignore errors caused by objects
179 without proper end block
180 (\req{err001}\req{chk004}).\\
290011d2 181 \hline
182 \end{tabular}\end{center}
183 \caption{Configuration switches}
184 \end{table}
185}
186
187\rd{cfg004}{String parameters}{
188 The following string parameters shall be accepted:
189 \begin{table}[H]\begin{center}
190 \begin{tabular}{|r|p{2.5em}|l|}
191 \hline
192 \bf Long Form & \bf Short form & \bf Description\\
193 \hline
ad324d29 194 in\_file & i & Set input file (\req{inp001}). \\
195 out\_file & o & Set output file for text output(\req{dp008}).\\
290011d2 196 \hline
197 \end{tabular}\end{center}
198 \caption{Configuration strings}
199 \end{table}
200
201}
ad324d29 202\newpage
290011d2 203\rd{cfg005}{Configuration file syntax}{
204 The configuration file must comply two the following grammar, given in EBNF:
205}
206 \begin{verbatim}
207ConfigurationFile = { ConfigurationLine "<EOL>" } ;
208ConfigurationLine = SwitchLine | StringLine | CommentLine ;
209 SwitchLine = WSpace SwLong WSpace "=" BoolValue ;
210 StringLine = WSpace StrLong WSpace "=" String ;
211 CommentLine = WSpace [ "#" String ] ;
212 WSpace = { " " } ;
213 SwLong = "output_info" | "ouput_called" | "output_exported"
214 | "output_unsatisfied" | "split_objects" [ _"numbered" ]
215 | "ignore_block_errors" | "ignore_checksum_errors
216 | "pause_on_checksum_error"
217 | "ignore_unknown_block_errors"
218 | "ignore_object_integrity" ;
219 StrLong = "out_file" | "in_file" ;
220 BoolValue = TrueStr | FalseStr ;
221 String = { ? Every character except newline ?} ;
222 TrueStr = "yes" | "1" | "true" ;
223 FalseStr = | "no" | "0" | "false" ;
ad324d29 224 \end{verbatim}
290011d2 225
ad324d29 226\rd{cfg006}{Command Line syntax}{
290011d2 227 The command line must comply to the following grammar, given in EBNF:
228}
229\begin{verbatim}
230CommandLine = ProgramName Arguments ;
231ProgramName = String ;
232 Arguments = { " " } { " " Argument } [ " " InfileName ] ;
233 Argument = { Switch | Parameter }
234 InfileName = String ;
235 Switch = ShortSwitch | LongSwitch ;
236 Parameter = ShortParam | LongParam ;
237 String = { ? Every character except newline ? } ;
238ShortSwitch = "-" SwShort ;
239 LongSwitch = "--" SwLong [ "=" BoolValue ] ;
240 ShortParam = "-" StrShort String ;
241 LongParam = "--" StrLong "=" String ;
ad324d29 242 SwShort = "h" | "a" | "c" | "e" | "u" | "s" | "S"
290011d2 243 | "b" | "k" | "p" | "n" | "g" ;
ad324d29 244 SwLong = "help"
245 | "output_info" | "ouput_called" | "output_exported"
290011d2 246 | "output_unsatisfied" | "split_objects" [ _"numbered" ]
ad324d29 247 | "ignore_block_errors" | "ignore_checksum_errors"
290011d2 248 | "pause_on_checksum_error"
249 | "ignore_unknown_block_errors"
250 | "ignore_object_integrity" ;
ad324d29 251 StrShort = "o" ;
290011d2 252 StrLong = "out_file" ;
253\end{verbatim}
254
ad324d29 255\newpage
290011d2 256\rd{cfg007}{Configuration implications}{
257 \begin{itemize}
258 \item pause\_on\_checksum\_errors implies ignore\_checksum\_errors.
259 \item pause\_on\_checksum\_errors is completely ignored when input
260 is read from standard input.
261 \item output\_* inhibits tape information output (\req{da001}).
262 \item help inhibits all other actions.
263 \end{itemize}
264}
265
266\rd{cfg008}{Default behaviour}{
267 \begin{itemize}
268 \item Data is read from standard input.
269 \item All error conditions result in immediate program termination
270 and an error message.
271 \item Tape information according to \req{da001} is output.
272 \item Text is output to standard output.
273 \end{itemize}
274}
275
276%*******************************************************************************
ad324d29 277\newpage
290011d2 278\subsection{Error handling}
279
280
281\newcommand{\esup}{
282 This error shall lead to an error message and immediate program
283 termination or a warning message and program continuation.
284}
285
286\newcommand{\enosup}{
287 This error shall always lead to an error message and immediate
288 program termination.
289}
290
291\rd{err001}{Error types}{
292 The following distinguished error types shall exist:
293 \begin{itemize}
294 \item Input/output error:\\
295 Error occuring during reading from the input file descriptor
296 or during writing to an output file.\\
297 \enosup
298 \item Block integrity error:\\
299 Caused by failed check according to \req{chk001}.\\
300 \esup
301 \item Checksum error:\\
302 Caused by failed check according to \req{chk002}.\\
303 \esup
304 \item Unknown block type error:\\
305 Caused by failed check according to \req{chk003}.\\
306 \esup
307 \item Object integrity error:\\
308 Caused by failed check according to \req{chk004}.\\
309 \esup
310 \item Usage error:\\
ad324d29 311 Error caused by errors in the program configuration i.e. wrong
290011d2 312 parameters or impossible combinations of parameters.\\
313 \enosup \\
314 Additionally, the help (\req{h001}) message is output.
315 \item Internal program error:\\
316 Error caused by internal program problems.\\
317 This error should never occur.\\
318 \enosup
319 \end{itemize}
320}
321
322\rd{err002}{Program exit codes}{
323 \begin{table}[H]
324 \begin{center}
325 \begin{tabular}{|r|c|}
326 \hline
327 \multicolumn{1}{|c|}{\bf Exit condition} & \bf Return code\\
328 \hline
329 Successfull program completion & 0 \\
330 File open error & 1\\
331 Input/output error & 2\\
332 Block integrity error & 3\\
333 Checksum error & 4\\
334 Unknown block type error & 5\\
335 Object integrity error & 6\\
336 Usage error & 7\\
337 Internal program error & 100 \\
338 \hline
339 \end{tabular}
340 \caption[Program Exit codes]{Exit codes}
341 \end{center}
342 \end{table}
343}
344
345\rd{err003}{Error and warning messages}{
346 Error messages shall consinst of ''Error:'' and the error reason.\\
347 Warning messages shall consist of ''Warning:'' and a descriptive
348 text.\\
349 The following texts shall be used to form error and warning messages:
350 \begin{table}[H]
351 \begin{center}
352 \begin{tabular}{|l|l|}
353 \hline
354 \bf Error condition & \bf Descriptive text\\ \hline
355 File open error & Could not open $<$filename$>$ for reading/writing!\\
356 Input error & Could not read from $<$filename$>$!\\
357 Output error & Could not write to $<$filename$>$!\\
358 Block integrity error & Block integrity check failed!\\
359 Checksum error & Block checksum wrong!\\
360 Unknown block type & Unknown block type!\\
361 Object integrity & Object integrity check failed!\\
ad324d29 362 Usage error & $<$Specific message describing the problem$>$\\
290011d2 363 \hline
364 \end{tabular}
365 \end{center}
366 \caption[Program Exit codes]{Exit codes}
367 \end{table}
368}
369
370\rd{err004}{Error message output}{
371 Any error messages shall be output to standard error.\\
372 There shall be no way to suppress error messages.
373}
374
375\rd{err005}{Warning message output}{
376 Any warning messages shall be output to standard error.\\
377 There shall be a possibility to suppress warning messages.
378}
379