02.03.2014 Views

Tornado

Tornado

Tornado

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.

D<br />

Utilities Reference<br />

USAGE<br />

EXAMPLE<br />

The generated C file also contains two function which can be called to register or<br />

unregister all of the packed files and directories; they are mounted as a filesystem using<br />

memDevCreateDir(), and unmounted using memDevDelete( ). An include file is also<br />

generated, containing a declaration of this function.<br />

This utility is invoked as:<br />

memdrvbuild [ -o filebase ] [ -m mount ] directory<br />

where:<br />

-o filebase<br />

The base name for the generated .c and .h files. Defaults to the name of the source<br />

directory.<br />

-m mount<br />

The name (“mount point”) under which directory will be mounted on the target.<br />

Defaults to the name of the source directory.<br />

directory<br />

The source directory containing the files to be packed into a memDrv filesystem.<br />

The output .c file contains two function, called memDrvAddFilesmount( ) and<br />

memDrvDeleteFilesmount(), where mount is the argument to the -d option, with nonalpha<br />

characters converted to _. This first function mounts the packed files using<br />

memDevCreate(). The second function unmounts the packed files using memDevDelete( ).<br />

The .h file contains a declaration of those functions.<br />

Each file will be mounted with the name mount/file, where file is the pathname of the file<br />

below the indicated source directory.<br />

Given a directory docs, containing a number of files:<br />

memdrvbuild -m /mem -o memFiles docs<br />

will produce two files, memFiles.c and memFiles.h. memFiles.c will contain the data for<br />

the packed files, plus two functions:<br />

STATUS memDrvAddFiles_mem (void);<br />

STATUS memDrvDeleteFiles_mem (void);<br />

When called, the first function will mount all of the contained files in the filesystem under<br />

/mem. For example, the file docs/fred.html would be mounted as /mem/fred.html. The<br />

second function will unmount all of the contained files in the filesystem under /mem.<br />

D<br />

455

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

Saved successfully!

Ooh no, something went wrong!