File: example-texi.tpl

package info (click to toggle)
complexity 1.13-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 3,200 kB
  • sloc: ansic: 16,003; sh: 5,127; makefile: 76
file content (76 lines) | stat: -rw-r--r-- 2,125 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
[= AutoGen5 template  -*- Mode: text -*-

texi=example.texi

##  Documentation template
##
## Author:            Bruce Korb <bkorb@gnu.org>
##
##  This file is part of Complexity.
##  Complexity Copyright (c) 2011, 2020 by Bruce Korb - all rights reserved
##
##  Complexity 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.
##
##  Complexity 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.  If not, see <http://www.gnu.org/licenses/>.

=][= (out-push-new "set-flags.texi") \=]
@ignore
[=(dne "")=]
@end ignore

@set CRIGHT     2011-[= (shell "date '+%Y'") =]
@set PKG-TITLE  [= package =] - [= prog-title =]
@set PROGRAM    [=prog-name=]
@set TITLE      [=prog-title=]
@set EMAIL      [=

(define texi-escape-encode (lambda (in-str)
   (string-substitute in-str
      '("@"   "{"   "}")
      '("@@"  "@{"  "@}")
)  ))

(texi-escape-encode "bkorb@gnu.org") =]
[= (out-pop) \=]
@page
@node    Example Output
@chapter Example Output
@cindex  Example Output

This is a self-referential example. This output was obtained by
going into the complexity source directory and running the command:
@example
[=`
src=\`cd ${top_srcdir}/src && pwd\`
bld=\`cd ${top_builddir}/src && pwd\`
cmd='complexity --histogram --score --thresh=3'
echo "$cmd *.c"
`=]
@end example

The @code{--threshold} is set to three because all of the functions
score below the default threshold of 30.  It is not zero because
there are too many trivial (0, 1 or 2) functions for a short example.

@noindent
This results in:

@example
[=`
cd ${src}
if test -f opts.c
then optsc=
else optsc=${bld}/opts.c
fi
eval ${bld}/${cmd} *.c $optsc | sed 's/\\(.\\{66\\}\\).*/\\1/'
`=]
@end example