File: src2doxy.sh

package info (click to toggle)
vice 3.7.1%2Bdfsg1-2
  • links: PTS
  • area: contrib
  • in suites: bookworm
  • size: 49,876 kB
  • sloc: ansic: 431,530; cpp: 35,357; sh: 9,747; makefile: 7,010; perl: 1,822; yacc: 1,197; lex: 589; sed: 184; objc: 115; xml: 36
file content (55 lines) | stat: -rwxr-xr-x 2,191 bytes parent folder | download | duplicates (3)
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
#! /bin/bash

#
# src2doxy.sh - fixup some phrases
#
# Written by
#  groepaz <groepaz@gmx.net>
#
# This file is part of VICE, the Versatile Commodore Emulator.
# See README for copyright notice.
#
#  This program 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; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
#  02111-1307  USA.
#

# this little script tries to fixup some phrases found in the source so they
# will (or will not) show up in the doxygen documentation
#
# /* BUG: ... -> /*! \bug ...
# /* FIXME: ... -> /*! \todo FIXME: ...
# /* TODO: ... -> /*! \todo ...
# /* #... */ (remove, commented out preprocessor stuff)
# /* ---... */ (remove)
# #define ... /* ... */ -> ... /*!< ... */ (autobrief)
# /* ... */ -> /*! ... */ (autobrief, convert comments to qt style if they begin 
#                          at start of line and the line ends right after them)
#

#cat $1 | \
#    sed -s 's/\* BUG:/\*! \\bug /g' |
#    sed -s 's/\* FIXME:/\*! \\todo FIXME:/g' |
#    sed -s 's/\* TODO:/\*! \\todo /g' |
#    sed -s 's:^/\* #.*\*/$::' |
#    sed -s 's:^/\*.---.*\*/$::' |
#    sed -s 's:\(^#define .* \)\(/\* \)\(.*\*/$\):\1/\*!< \3:' |
#    sed -s 's:^/\* \(.*\) \*/$:/\*! \1 \*/:'

# Join regexes together into a single call, reduces execution time from ~21
# minutes to ~19 minutes. Also remove '/g', which on Linux doesn't seem to have
# much of an impact, but might on Windows.
cat $1 | \
    sed -s 's/\* BUG:/\*! \\bug /;s/\* FIXME:/\*! \\todo FIXME:/;s/\* TODO:/\*! \\todo /;s:^/\* #.*\*/$::;s:^/\*.---.*\*/$::;s:\(^#define .* \)\(/\* \)\(.*\*/$\):\1/\*!< \3:;s:^/\* \(.*\) \*/$:/\*! \1 \*/:'