3 # Copyright (c) 2012 Todd T. Fries <todd@fries.net>
5 # Permission to use, copy, modify, and distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 # read in 'ascii2txt.pl' formatted man pages, spit out #defines for tooltips
26 my @states = ("prekewords", "keywords", "postkeywords");
35 if ($line =~ /following keywords:$/) {
44 if ($line =~ /^[A-Z]/) {
45 showtip
($tipname,@tipinfo);
49 if ($line =~ /^ {11,11}([a-z_]+)[ ]*(.*)$/) {
50 showtip
($tipname,@tipinfo);
56 if ($line =~ /^ {39,39}(.*)$/) {
68 if (!defined($tip) || length($tip) < 1) {
73 for my $line (@info) {
77 $line =~ s/"/"/g;
78 $line =~ s/^ {6,6}/\\t/g;
79 $line =~ s/\\t {6,6}/\\t\\t/g;
80 $line =~ s/\\t {6,6}/\\t\\t/g;
81 if ($count > $#info) {
84 $fmt = " \"%s\\n\" \\\n";
86 $text .= sprintf $fmt,$line;
91 printf "#define TT_%s%s",$tip,$text;