.\" direvent - directory content watcher daemon -*- nroff -*- .\" Copyright (C) 2012-2016 Sergey Poznyakoff .\" .\" Direvent is free software; you can redistribute it and/or modify it .\" under the terms of the GNU General Public License as published by the .\" Free Software Foundation; either version 3 of the License, or (at your .\" option) any later version. .\" .\" Direvent is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License along .\" with direvent. If not, see . .TH DIREVENT.CONF 5 "June 20, 2016" "DIREVENT" "Direvent User Reference" .SH NAME direvent.conf \- configuration file for .BR direvent (8). .SH DESCRIPTION The configuration file consists of statements and comments. .PP There are three classes of lexical tokens: keywords, values, and separators. Blanks, tabs, newlines and comments, collectively called \fIwhite space\fR are ignored except as they serve to separate tokens. Some white space is required to separate otherwise adjacent keywords and values. .SH COMMENTS Comments may appear anywhere where white space may appear in the configuration file. There are two kinds of comments: single-line and multi-line comments. Single-line comments start with .B # or .B // and continue to the end of the line: .sp .RS 4 .nf # This is a comment // This too is a comment .fi .RE .PP \fIMulti-line\fB or \fIC-style\fR comments start with the two characters .B /* (slash, star) and continue until the first occurrence of .B */ (star, slash). .PP Multi-line comments cannot be nested. However, single-line comments may well appear within multi-line ones. .SS "Pragmatic Comments" Pragmatic comments are similar to the usual single-line comments, except that they cause some changes in the way the configuration is parsed. Pragmatic comments begin with a .B # sign and end with the next physical newline character. .TP .BI "#include <" "FILE" > .PD 0 .TP .BI "#include " "FILE" .PD Include the contents of the file \fIFILE\fR. If \fIFILE\fR is an absolute file name, the named file is included. An error message will be issued if it does not exist. If \fIFILE\fR contains wildcard characters (\fB*\fR, \fB[\fR, \fB]\fR, or \fB?\fR), it is interpreted as a shell globbing pattern and all files matching that pattern are included, in lexicographical order. If no matching files are found, the directive is replaced with an empty line. Otherwise, the form with angle brackets searches for file in the include search path, while the second one looks for it in the current working directory first, and, if not found there, in the include search path. If the file is not found, an error message will be issued. The order of directories is as follows. First, \fBdirevent\fR scans any directories given with \fB\-I\fR options, in the same order as given on the command line, and then the directories in the standard include search path. The latter is defined at compile time and can be inspected in the output of the \fB\-\-help\fR option. .TP .BI "#include_once <" "FILE" > .PD 0 .TP .BR "#include_once " "FILE" .PD Same as \fB#include\fR, except that, if the \fIFILE\fR (or any of the files it expands to) has already been included, it will not be included again. .TP .BI "#line " "num" .PD 0 .TP .BI "#line " "num" " \(dq" "FILE" "\(dq" .PD This line causes the parser to believe, for purposes of error diagnostics, that the line number of the next source line is given by \fInum\fR and the current input file is named by \fIFILE\fR. If the latter is absent, the remembered file name does not change. .TP .BI "# " "num" " \(dq" "FILE" "\(dq" This is a special form of the \fB#line\fR statement, understood for compatibility with the C preprocessor. .SH STATEMENTS .SS "Simple statement" A \fIsimple statement\fR consists of a keyword and value separated by any amount of whitespace. Simple statement is terminated with a semicolon (\fB;\fR). .PP The following is a simple statement: .sp .RS 4 .nf pidfile /var/run/direvent.pid; .RE .fi .PP See below for a list of valid simple statements. .PP A \fIvalue\fR can be one of the following: .TP .I number A number is a sequence of decimal digits. .TP .I boolean A boolean value is one of the following: \fByes\fR, \fBtrue\fR, \fBt\fR or \fB1\fR, meaning \fItrue\fR, and \fBno\fR, \fBfalse\fR, \fBnil\fR, \fB0\fR meaning \fIfalse\fR. .TP .I unquoted string An unquoted string may contain letters, digits, and any of the following characters: \fB_\fR, \fB\-\fR, \fB.\fR, \fB/\fR, \fB@\fR, \fB*\fR, \fB:\fR. .TP .I quoted string A quoted string is any sequence of characters enclosed in double-quotes (\fB\(dq\fR). A backslash appearing within a quoted string introduces an \fIescape sequence\fR, which is replaced with a single character according to the following rules: .sp .nf .ta 8n 18n 42n .ul Sequence Expansion ASCII \fB\\\\\fR \fB\\\fR 134 \fB\\"\fR \fB"\fR 042 \fB\\a\fR audible bell 007 \fB\\b\fR backspace 010 \fB\\f\fR form-feed 014 \fB\\n\fR new line 012 \fB\\r\fR charriage return 015 \fB\\t\fR horizontal tabulation 011 \fB\\v\fR vertical tabulation 013 .fi In addition, the sequence \fB\\\fInewline\fR is removed from the string. This allows one to split long strings over several physical lines, e.g.: .sp .nf .in +4 "a long string may be\\ split over several lines" .in .fi .sp If the character following a backslash is not one of those specified above, the backslash is ignored and a warning is issued. Two or more adjacent quoted strings are concatenated, which gives another way to split long strings over several lines to improve readability. The following fragment produces the same result as the example above: .sp .nf .in +4 "a long string may be" " split over several lines" .in .fi .TP .I Here-document A \fIhere-document\fR is a special construct that allows one to introduce strings of text containing embedded newlines. The .BI "<<" "word" construct instructs the parser to read all the following lines up to the line containing only \fIword\fR, with possible trailing blanks. Any lines thus read are concatenated together into a single string. For example: .sp .nf .in +4 < .br .ad This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .\" Local variables: .\" eval: (add-hook 'write-file-hooks 'time-stamp) .\" time-stamp-start: ".TH [A-Z_][A-Z0-9_.\\-]* [0-9] \"" .\" time-stamp-format: "%:B %:d, %:y" .\" time-stamp-end: "\"" .\" time-stamp-line-limit: 20 .\" end: