Content-type: text/html
Manpage of FILEPP
FILEPP
Section: User Commands (1)
Updated: Dec 06 2000
Index
Return to Main Contents
NAME
filepp - A generic file preprocessor
SYNOPSIS
filepp
[options]
filename(s)
DESCRIPTION
filepp is a generic file preprocessor designed to allow some of
the functionality provided by the C preprocessor cpp(1) to be
used with any file type.
OPTIONS
filepp accepts the following command line options:
- -o name
-
Write output to name instead of STDOUT. If there is only one
input file and it has the same name as the output file, the original
input file will be backed-up as name~.
- -c
-
Read input from STDIN instead of a file.
- -h
-
Show summary of options.
- -v
-
Show version of program.
- -d
-
Output debugging information.
- -Idir
-
Append directory dir to the list of directories searched for include files.
- -Dmacro
-
Define macro macro with the string `1' as its
definition.
- -Dmacro=defn
-
Define macro macro as defn.
- -k
-
Turn off parsing of all keywords. This is useful if you just want to
use the macro expansion facilities of filepp. With this option
all keywords found will be ignored, filepp will just replace any
macros specified with the -Dmacro=defn option.
KEYWORDS
filepp supports the following keywords:
- #include <FILE>
-
Include a file in the file being processed. This variant is used for
"system" include files. It searches for a file named FILE in a
list of directories specified by you. You specify directories to
search for include files with the command option `-I'. filepp
does not predefine any system directories in which to search for
files.
- #include FILE
-
Include a file in the file being processed. This variant is used for
include files of your own project. It searches for a file named
FILE first in the current directory, then in the list of
directories specified with the command option `-I'. The current
directory is the directory filepp is running in.
- #define macro
-
Define the word macro to have a value of `1'. macro can
then be used with the keywords #ifdef and #ifndef.
- #define macro defn
-
Define the macro macro to have the value defn.
macro can then be used with the keywords #ifdef and
#ifndef. Also, all instances of macro following the
#define statement will be replaced with the string defn.
The string defn is taken to be all the charcters on the line
following macro. filepp does not support macros with
arguments.
- #ifdef macro
-
A conditional statement, if macro has been defined the text
between the #ifdef and the next #else or #endif will
be included. If macro has not been defined the text between the
#ifdef and the next #else or #endif will be ignored.
- #ifndef macro
-
The reverse case of the #ifdef conditional.
- #else
-
The #else directive can be added to a conditional to provide
alternative text to be used if the condition is false.
- #endif
-
Used to terminate a conditional statement. Normal processing resumes
following the #endif.
- #undef macro
-
Undefine a previously defined macro.
- #error mesg
-
Causes filepp to exit with the error message mesg.
- #warning mesg
-
Causes filepp to issue the warning message mesg.
- #comment mesg
-
As filepp is supposed to be a generic file preprocessor, it
cannot support any known comment styles, therefore it defines its own
with this keyword. All lines starting with #comment are treated
as comments and removed by filepp.
PREDEFINED MACROS
filepp supports a set of predefined macros. All the predefined
macros are of the form __MACRO__, where MACRO is:
- FILE
-
This macro expands to the name of the current input file.
- LINE
-
This macro expands to the current input line number.
- DATE
-
This macro expands to a string that describes the date on which the
preprocessor is being run. The string contains eleven characters and
looks like "Dec 06 2000".
- TIME
-
This macro expands to a string that describes the time at which the
preprocessor is being run. The string contains eight characters and
looks like "21:55:43".
- BASE_FILE
-
This macro expands to the name of the main input file.
- INCLUDE_LEVEL
-
This macro expands to a decimal integer constant that represents the
depth of nesting in include files. The value of this macro is
incremented on every #include directive and decremented at every
end of file.
- NULL
-
This macro expands to nothing. It is useful if you want to define
something to be nothing.
- VERSION
-
This macro expands to a string constant which describes the version
number of filepp. The string is a sequence of decimal numbers
separated by periods and looks like "1.0.0".
- FILEPP_INPUT
-
This macro expands to a string constant which says the file was
generated automatically from the current BASE_FILE and looks
like "Generated automatically from filepp.1.in by filepp".
BUGS
filepp does not support the keyword #if. It may fail to
parse a file which includes an #if keyword if it is followed by
#else or #endif keywords.
COPYING
Copyright (C) 2000 Darren Miller
filepp 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 2 of the License, or
(at your option) any later version.
This program 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 this program; see the file COPYING. If not, write to
the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
SEE ALSO
cpp(1),
perl(1)
AUTHOR
Darren Miller <darren@cabaret.demon.co.uk>.
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- OPTIONS
-
- KEYWORDS
-
- PREDEFINED MACROS
-
- BUGS
-
- COPYING
-
- SEE ALSO
-
- AUTHOR
-
This document was created by
man2html,
using the manual pages.
Time: 21:55:43 GMT, December 06, 2000