07.06.2013 Views

Design and Implementation of a Documentation Tool for ... - MADOC

Design and Implementation of a Documentation Tool for ... - MADOC

Design and Implementation of a Documentation Tool for ... - MADOC

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

After <strong>for</strong>king, the child launches (or, to be exact, becomes) the process that<br />

should be logged within doshell, while the parent does the actual input/output<br />

logging within doio.<br />

9 〈<strong>for</strong>k subprocesses 8c〉+≡ (7b) ⊳ 8c<br />

if (CHILD == 0)<br />

doshell();<br />

else<br />

doio();<br />

Uses CHILD 8d, doio 33c, <strong>and</strong> doshell 31c.<br />

Further code can be found in the appendix.<br />

5 Evaluation<br />

In order to show you what the code you have just seen actually does, this section<br />

contains instructions on how to compile it, <strong>and</strong> it features an example transcript<br />

file analyzed in detail.<br />

5.1 Compiling <strong>for</strong>script<br />

<strong>for</strong>script is written con<strong>for</strong>ming to the C99 <strong>and</strong> POSIX-1.2001 st<strong>and</strong>ards,<br />

with portability in mind. It has been developed on a machine running Linux<br />

2.6.32 [6], using glibc 2.10 <strong>and</strong> GCC 4.4.3 [2]. The following comm<strong>and</strong> line is<br />

an example <strong>of</strong> how to compile <strong>for</strong>script:<br />

gcc -std=c99 -Wl,-lrt -g -o <strong>for</strong>script -Wall \<br />

-Wextra -pedantic -fstack-protector-all -pipe <strong>for</strong>script.c<br />

To generate <strong>for</strong>script.c out <strong>of</strong> the noweb source code, the following comm<strong>and</strong><br />

line can be used:<br />

notangle -R<strong>for</strong>script.c <strong>for</strong>script.nw > <strong>for</strong>script.c<br />

On the authors machine, <strong>for</strong>script can be compiled without any compiler<br />

warnings. It has also been successfully compiled on NetBSD.<br />

Since Apple Mac OS X in its current version 10.6.2 lacks support <strong>for</strong> the realtime<br />

extension <strong>of</strong> POSIX, the clock gettime() function required by <strong>for</strong>script<br />

is not natively available. There<strong>for</strong>e the code described in this document can in<br />

its current state not be compiled on OS X. However, it should be possible<br />

to create a function emulating clock gettime() <strong>and</strong> then port <strong>for</strong>script to<br />

OS X.<br />

5.2 Example Transcript File<br />

To demonstrate <strong>for</strong>scripts output, the following pages contain a commented<br />

hex dump <strong>of</strong> a transcript file created on the authors machine. The dump has<br />

been created using hexdump -C transcript. Since metadata chunks do not<br />

9

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!