1[comment {-*- tcl -*- doctools manpage}]
2[manpage_begin fileutil::magic::cfront n 1.0]
3[moddesc   {file utilities}]
4[titledesc {Generator core for compiler of magic(5) files}]
5[category  {Programming tools}]
6[require Tcl 8.4]
7[require fileutil::magic::cfront [opt 1.0]]
8[require fileutil::magic::cgen [opt 1.0]]
9[require fileutil::magic::rt [opt 1.0]]
10[require struct::list]
11[require fileutil]
12[description]
13[para]
14
15This package provides the frontend of a compiler of magic(5) files
16into recognizers based on the [package fileutil::magic::rt] recognizer
17runtime package. For the generator backed used by this compiler see
18the package [package fileutil::magic::cgen].
19
20[section COMMANDS]
21
22[list_begin definitions]
23
24[call [cmd ::fileutil::magic::cfront::compile] [arg path]...]
25
26This command takes the paths of one or more files and directories and
27compiles all the files, and the files in all the directories into a
28single recognizer for all the file types specified in these files.
29
30[para]
31
32All the files have to be in the format specified by magic(5).
33
34[para]
35
36The result of the command is a Tcl script containing the generated
37recognizer.
38
39
40[call [cmd ::fileutil::magic::cfront::procdef] [arg procname] [arg path]...]
41
42This command behaves like [cmd ::fileutil::magic::cfront::compile]
43with regard to the specified path arguments, then wraps the resulting
44recognizer script into a procedure named [arg procname], puts code
45setting up the namespace of [arg procname] in front, and returns the
46resulting script.
47
48
49[call [cmd ::fileutil::magic::cfront::install] [arg path]...]
50
51This command uses [cmd ::fileutil::magic::cfront::procdef] to compile
52each of the paths into a recognizer procedure and installs the result
53in the current interpreter.
54
55[para]
56
57The name of each new procedure is derived from the name of the
58file/directory used in its creation, with file/directory [file FOO]
59causing the creation of procedure [const ::fileutil::magic::/FOO::run].
60
61[list_end]
62
63
64[section {BUGS, IDEAS, FEEDBACK}]
65
66This document, and the package it describes, will undoubtedly contain
67bugs and other problems.
68
69Please report such in the category [emph {fileutil :: magic}] of the
70[uri {http://sourceforge.net/tracker/?group_id=12883} {Tcllib SF Trackers}].
71
72Please also report any ideas for enhancements you may have for either
73package and/or documentation.
74
75
76[see_also fileutil file(1) magic(5)]
77[keywords type mime {file utilities} {file type} {file recognition}]
78[manpage_end]
79