File: msg-list-filter.sh

package info (click to toggle)
nessus-libraries 1.0.10-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 9,536 kB
  • ctags: 12,585
  • sloc: ansic: 72,626; asm: 25,921; sh: 19,570; makefile: 1,974; cpp: 560; pascal: 536; yacc: 234; lex: 203; lisp: 186; perl: 76; fortran: 24
file content (78 lines) | stat: -rw-r--r-- 2,204 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
77
78
#!/bin/sh
#
#   $Id: msg-list-filter.sh,v 1.3 1999/11/18 22:26:06 jordan Exp $
#
#   generate message list macros from messages.h
#

echo "\
/*
 *          Copyright (c) mjh-EDV Beratung, 1996-1999
 *     mjh-EDV Beratung - 63263 Neu-Isenburg - Rosenstrasse 12
 *          Tel +49 6102 328279 - Fax +49 6102 328278
 *                Email info@mjh.teddy-net.com
 *
 *   This library is free software; you can redistribute it and/or
 *   modify it under the terms of the GNU Library General Public
 *   License as published by the Free Software Foundation; either
 *   version 2 of the License, or (at your option) any later version.
 *
 *   This library 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
 *   Library General Public License for more details.
 *
 *   You should have received a copy of the GNU Library General Public
 *   License along with this library; if not, write to the Free
 *   Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#ifndef __MSG_FILTER_OUTPUT__
#define __MSG_FILTER_OUTPUT__

/* -----------------------------------------------------------------------
 * NOTICE: this file has been generated automagically, so its contents
 * will be rewritten every time the cipher lib is recompiled. This means
 * ALL CHANGES to that file WILL BE LOST.
 * --------------------------------------------------------------------- */
"

cat "$@" |

# the follwing sed script recognizes defines looking like
#
#       ^# define Some_SYMBOL(f) (<number> ...)
#
# which is then transformed to
#
#	f(Some_SYMBOL)
#

sed '	s/	/ /g
	/^# *define  *[^(]*(f[^)]*) *[a-zA-Z0-9_][a-zA-Z0-9_]*(/!d
	/define USE_CRIPPLED_ELGKEY(/d
        s/^# *define */f(/
        s/(f)  */) /
        s/ f *( *[0-9].*//
' | 

# the awk skript collects the items ejected from sed and
# puts them together ...

awk 'BEGIN {
		ORS=""
		n = 0
		m = 99
	}
	{	if (m > 7) {
			++ a
			print "\n\n#define PEKS_ERRLIST" a "(f) \\\n"
			m = 0
		}
		print $0 " "
		if (n ++ > 2) {	print "\\\n"; n = 0; m ++}
	}'

echo
echo
echo "#endif /* __MSG_FILTER_OUTPUT__ */"