~ubuntu-branches/ubuntu/vivid/wpasupplicant/vivid

« back to all changes in this revision

Viewing changes to doc/kerneldoc2doxygen.pl

  • Committer: Bazaar Package Importer
  • Author(s): Kel Modderman
  • Date: 2008-03-12 20:03:04 UTC
  • mfrom: (1.1.10 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20080312200304-4331y9wj46pdd34z
Tags: 0.6.3-1
* New upstream release.
* Drop patches applied upstream:
  - debian/patches/30_wpa_gui_qt4_eventhistoryui_rework.patch
  - debian/patches/31_wpa_gui_qt4_eventhistory_always_scrollbar.patch
  - debian/patches/32_wpa_gui_qt4_eventhistory_scroll_with_events.patch
  - debian/patches/40_dbus_ssid_data.patch
* Tidy up the clean target of debian/rules. Now that the madwifi headers are
  handled differently we no longer need to do any cleanup.
* Fix formatting error in debian/ifupdown/wpa_action.8 to make lintian
  quieter.
* Add patch to fix formatting errors in manpages build from sgml source. Use
  <emphasis> tags to hightlight keywords instead of surrounding them in
  strong quotes.
  - debian/patches/41_manpage_format_fixes.patch
* wpasupplicant binary package no longer suggests pcscd, guessnet, iproute
  or wireless-tools, nor does it recommend dhcp3-client. These are not
  needed.
* Add debian/patches/10_silence_siocsiwauth_icotl_failure.patch to disable
  ioctl failure messages that occur under normal conditions.
* Cherry pick two upstream git commits concerning the dbus interface:
  - debian/patches/11_avoid_dbus_version_namespace.patch
  - debian/patches/12_fix_potential_use_after_free.patch
* Add debian/patches/42_manpage_explain_available_drivers.patch to explain
  that not all of the driver backends are available in the provided
  wpa_supplicant binary, and that the canonical list of supported driver
  backends can be retrieved from the wpa_supplicant -h (help) output.
  (Closes: #466910)
* Add debian/patches/20_wpa_gui_qt4_disable_link_prl.patch to remove
  link_prl CONFIG compile flag added by qmake-qt4 >= 4.3.4-2 to avoid excess
  linking.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/perl -w
2
 
#
3
 
##########################################################################
4
 
# Convert kernel-doc style comments to Doxygen comments.
5
 
##########################################################################
6
 
#
7
 
# This script reads a C source file from stdin, and writes
8
 
# to stdout.  Normal usage:
9
 
#
10
 
# $ mv file.c file.c.gtkdoc
11
 
# $ kerneldoc2doxygen.pl <file.c.gtkdoc >file.c
12
 
#
13
 
# Or to do the same thing with multiple files:
14
 
# $ perl -i.gtkdoc kerneldoc2doxygen.pl *.c *.h
15
 
#
16
 
# This script may also be suitable for use as a Doxygen input filter,
17
 
# but that has not been tested.
18
 
#
19
 
# Back up your source files before using this script!!
20
 
#
21
 
##########################################################################
22
 
# Copyright (C) 2003 Jonathan Foster <jon@jon-foster.co.uk>
23
 
# Copyright (C) 2005 Jouni Malinen <j@w1.fi>
24
 
# (modified for kerneldoc format used in wpa_supplicant)
25
 
#
26
 
# This program is free software; you can redistribute it and/or modify
27
 
# it under the terms of the GNU General Public License version 2 as
28
 
# published by the Free Software Foundation.
29
 
#
30
 
# This program is distributed in the hope that it will be useful,
31
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
32
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
33
 
# GNU General Public License for more details.
34
 
#
35
 
# You should have received a copy of the GNU General Public License
36
 
# along with this program; if not, write to the Free Software
37
 
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
38
 
# or look at http://www.gnu.org/licenses/gpl.html
39
 
##########################################################################
40
 
 
41
 
 
42
 
##########################################################################
43
 
#
44
 
# This function converts a single comment from gtk-doc to Doxygen format.
45
 
# The parameter does not include the opening or closing lines
46
 
# (i.e. given a comment like this:
47
 
#    "/**\n"
48
 
#    " * FunctionName:\n"
49
 
#    " * @foo: This describes the foo parameter\n"
50
 
#    " * @bar: This describes the bar parameter\n"
51
 
#    " * @Returns: This describes the return value\n"
52
 
#    " *\n"
53
 
#    " * This describes the function.\n"
54
 
#    " */\n"
55
 
# This function gets:
56
 
#    " * FunctionName:\n"
57
 
#    " * @foo: This describes the foo parameter\n"
58
 
#    " * @bar: This describes the bar parameter\n"
59
 
#    " * @Returns: This describes the return value\n"
60
 
#    " *\n"
61
 
#    " * This describes the function.\n"
62
 
# And it returns:
63
 
#    " * This describes the function.\n"
64
 
#    " *\n"
65
 
#    " * @param foo This describes the foo parameter\n"
66
 
#    " * @param bar This describes the bar parameter\n"
67
 
#    " * @return This describes the return value\n"
68
 
# )
69
 
#
70
 
sub fixcomment {
71
 
    $t = $_[0];
72
 
 
73
 
    # " * func: foo" --> "\brief foo\n"
74
 
    # " * struct bar: foo" --> "\brief foo\n"
75
 
    # If this fails, not a kernel-doc comment ==> return unmodified.
76
 
    ($t =~ s/^[\t ]*\*[\t ]*(struct )?([^ \t\n]*) - ([^\n]*)/\\brief $3\n/s)
77
 
      or return $t;
78
 
 
79
 
    # " * Returns: foo" --> "\return foo"
80
 
    $t =~ s/\n[\t ]*\*[\t ]*Returns:/\n\\return/sig;
81
 
 
82
 
    # " * @foo: bar" --> "\param foo bar"
83
 
    # Handle two common typos: No ":", or "," instead of ":".
84
 
    $t =~ s/\n[\t ]*\*[\t ]*\@([^ :,]*)[:,]?[\t ]*/\n\\param $1 /sg;
85
 
 
86
 
    return $t;
87
 
}
88
 
 
89
 
##########################################################################
90
 
# Start of main code
91
 
 
92
 
# Read entire stdin into memory - one multi-line string.
93
 
$_ = do { local $/; <> };
94
 
 
95
 
s{^/\*\n \*}{/\*\* \\file\n\\brief};
96
 
s{ \* Copyright}{\\par Copyright\nCopyright};
97
 
 
98
 
# Fix any comments like "/*************" so they don't match.
99
 
# "/***" ===> "/* *"
100
 
s{/\*\*\*}{/\* \*}gs;
101
 
 
102
 
# The main comment-detection code.
103
 
s{
104
 
    (               # $1 = Open comment
105
 
        /\*\*       # Open comment
106
 
        (?!\*)      # Do not match /*** (redundant due to fixup above).
107
 
        [\t ]*\n?   # If 1st line is whitespace, match the lot (including the newline).
108
 
    )
109
 
    (.*?)           # $2 = Body of comment (multi-line)
110
 
    (               # $3 = Close comment
111
 
        (           # If possible, match the whitespace before the close-comment
112
 
            (?<=\n) # This part only matches after a newline
113
 
            [\t ]*  # Eat whitespace
114
 
        )?
115
 
        \*/         # Close comment
116
 
    )
117
 
 }
118
 
 {
119
 
    $1 . fixcomment($2) . $3
120
 
 }gesx;
121
 
# ^^^^ Modes: g - Global, match all occurances.
122
 
#             e - Evaluate the replacement as an expression.
123
 
#             s - Single-line - allows the pattern to match across newlines.
124
 
#             x - eXtended pattern, ignore embedded whitespace
125
 
#                 and allow comments.
126
 
 
127
 
# Write results to stdout
128
 
print $_;
129