EnglishFrenchSpanish

OnWorks favicon

shtool-scpp - Online in the Cloud

Run shtool-scpp in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command shtool-scpp that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


shtool-scpp - GNU shtool C source file pre-processor

SYNOPSIS


shtool scpp [-v|--verbose] [-p|--preserve] [-f|--filter filter] [-o|--output ofile]
[-t|--template tfile] [-M|--mark mark] [-D|--define dname] [-C|--class cname] file [file
...]

DESCRIPTION


This command is an additional ANSI C source file pre-processor for sharing cpp(1) code
segments, internal variables and internal functions. The intention for this comes from
writing libraries in ANSI C. Here a common shared internal header file is usually used for
sharing information between the library source files.

The operation is to parse special constructs in files, generate a few things out of these
constructs and insert them at position mark in tfile by writing the output to ofile.
Additionally the files are never touched or modified. Instead the constructs are removed
later by the cpp(1) phase of the build process. The only prerequisite is that every file
has a ``"#include ""ofile"""'' at the top.

This command provides the following features: First it avoids namespace pollution and
reduces prototyping efforts for internal symbols by recognizing functions and variables
which are defined with the storage class identifier ``cname''. For instance if cname is
``intern'', a function ``"intern void *foobar(int quux)"'' in one of the files is
translated into both a ``"#define foobar __foobar"'' and a ``"extern void *foobar(int
quux);"'' in ofile. Additionally a global ``"#define" cname "/**/"'' is also created in
ofile to let the compiler silently ignore this additional storage class identifier.

Second, the library source files usually want to share "typedef"s, "#define"s, etc. over
the source file boundaries. To achieve this one can either place this stuff manually into
tfile or use the second feature of scpp: All code in files encapsulated with ``"#if "dname
... "#endif"'' is automatically copied to ofile. Additionally a global ``"#define" dname
0'' is also created in ofile to let the compiler silently skip this parts (because it was
already found in the header).

OPTIONS


The following command line options are available.

-v, --verbose
Display some processing information.

-p, --preserve
Preserves ofile independent of the generated ``#line'' lines. This is useful for
Makefiles if the real contents of ofile will not change, just line numbers. Default is
to overwrite.

-f, --filter filter
Apply one or more pre-processing sed(1) filter commands (usually of type
``"s/.../.../"'') to each input file before their input is parsed. This option can
occur multiple times.

-o, --output ofile
Output file name. Default is "lib.h".

-t, --template tfile
Template file name. Default is "lib.h.in".

-M, --mark mark
Mark to be replaced by generated constructs. Default is "%%MARK%%".

-D, --define dname
FIXME. Default is "cpp".

-C, --class cname
FIXME. Default is "intern".

EXAMPLE


# Makefile
SRCS=foo_bar.c foo_quux.c
foo_p.h: foo_p.h.in
shtool scpp -o foo_p.h -t foo_p.h.in \
-M %%MARK%% -D cpp -C intern $(SRCS)

/* foo_p.h.in */
#ifndef FOO_P_H
#define FOO_P_H
%%MARK%%
#endif /* FOO_P_H */

/* foo_bar.c */
#include "foo_p.h"
#if cpp
#define OURS_INIT 4711
#endif
intern int ours;
static int myone = 0815;
intern int bar(void)
{
ours += myone;
}

/* foo_quux.c */
#include "foo_p.h"
int main(int argc, char *argv[])
{
int i;
ours = OURS_INIT
for (i = 0; i < 10; i++) {
bar();
printf("ours now %d\n", ours);
}
return 0;
}

HISTORY


The GNU shtool scpp command was originally written by Ralf S. Engelschall
<[email protected]> in 1999 for GNU shtool. Its was prompted by the need to have a pre-
processing facility in the GNU pth project.

Use shtool-scpp online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    strace
    strace
    The strace project has been moved to
    https://strace.io. strace is a
    diagnostic, debugging and instructional
    userspace tracer for Linux. It is used
    to monitor a...
    Download strace
  • 2
    gMKVExtractGUI
    gMKVExtractGUI
    A GUI for mkvextract utility (part of
    MKVToolNix) which incorporates most (if
    not all) functionality of mkvextract and
    mkvinfo utilities. Written in C#NET 4.0,...
    Download gMKVExtractGUI
  • 3
    JasperReports Library
    JasperReports Library
    JasperReports Library is the
    world's most popular open source
    business intelligence and reporting
    engine. It is entirely written in Java
    and it is able to ...
    Download JasperReports Library
  • 4
    Frappe Books
    Frappe Books
    Frappe Books is a free and open source
    desktop book-keeping software that's
    simple and well-designed to be used by
    small businesses and freelancers. It'...
    Download Frappe Books
  • 5
    Numerical Python
    Numerical Python
    NEWS: NumPy 1.11.2 is the last release
    that will be made on sourceforge. Wheels
    for Windows, Mac, and Linux as well as
    archived source distributions can be fou...
    Download Numerical Python
  • 6
    CMU Sphinx
    CMU Sphinx
    CMUSphinx is a speaker-independent large
    vocabulary continuous speech recognizer
    released under BSD style license. It is
    also a collection of open source tools ...
    Download CMU Sphinx
  • More »

Linux commands

Ad