[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. 517727ebdcd9d6dbc7eacdc843f886ed2e0f38f6

Lennart Poettering gitmailer-noreply at 0pointer.de
Tue Jun 24 17:39:36 PDT 2008


This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.

The master branch has been updated
      from  ac032549cd7eba9459f1fcd8983f1d513913f14f (commit)

- Log -----------------------------------------------------------------
517727e... Add xmltoman to the distribution. This saves pulling in an external dependancy
5099ab7... Export the cleanup_name() function and rename it to pa_namereg_make_valid_name(). This will allow it to be used by modules to create valid sink names.
-----------------------------------------------------------------------

Summary of changes:
 configure.ac            |   26 ------
 man/Makefile.am         |   31 +++----
 man/xmltoman            |  217 +++++++++++++++++++++++++++++++++++++++++++++++
 src/pulsecore/namereg.c |    4 +-
 src/pulsecore/namereg.h |    1 +
 5 files changed, 234 insertions(+), 45 deletions(-)
 create mode 100755 man/xmltoman

-----------------------------------------------------------------------

commit 5099ab7b8b758cb5d1fd3438eb83d8d0c96b3e97
Author: Colin Guthrie <pulse at colin.guthr.ie>
Date:   Tue Jun 24 23:50:12 2008 +0100

    Export the cleanup_name() function and rename it to pa_namereg_make_valid_name().
    This will allow it to be used by modules to create valid sink names.

diff --git a/src/pulsecore/namereg.c b/src/pulsecore/namereg.c
index cc18ada..38d308c 100644
--- a/src/pulsecore/namereg.c
+++ b/src/pulsecore/namereg.c
@@ -70,7 +70,7 @@ pa_bool_t pa_namereg_is_valid_name(const char *name) {
     return TRUE;
 }
 
-static char* cleanup_name(const char *name) {
+const char* pa_namereg_make_valid_name(const char *name) {
     const char *a;
     char *b, *n;
 
@@ -114,7 +114,7 @@ const char *pa_namereg_register(pa_core *c, const char *name, pa_namereg_type_t
         if (fail)
             return NULL;
 
-        if (!(name = n = cleanup_name(name)))
+        if (!(name = n = pa_namereg_make_valid_name(name)))
             return NULL;
     }
 
diff --git a/src/pulsecore/namereg.h b/src/pulsecore/namereg.h
index af0153e..b460382 100644
--- a/src/pulsecore/namereg.h
+++ b/src/pulsecore/namereg.h
@@ -44,5 +44,6 @@ const char *pa_namereg_get_default_sink_name(pa_core *c);
 const char *pa_namereg_get_default_source_name(pa_core *c);
 
 pa_bool_t pa_namereg_is_valid_name(const char *name);
+const char* pa_namereg_make_valid_name(const char *name);
 
 #endif

commit 517727ebdcd9d6dbc7eacdc843f886ed2e0f38f6
Author: Colin Guthrie <pulse at colin.guthr.ie>
Date:   Wed Jun 25 00:28:23 2008 +0100

    Add xmltoman to the distribution. This saves pulling in an external dependancy

diff --git a/configure.ac b/configure.ac
index 296dc17..029875c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1009,32 +1009,6 @@ AC_ARG_ENABLE(manpages,
   *) AC_MSG_ERROR([bad value ${enableval} for --disable-manpages]) ;;
 esac],[manpages=yes])
 
-if test x$manpages = xyes ; then
-    #
-    # XMLTOMAN manpage generation
-    #
-    AC_ARG_ENABLE(xmltoman,
-    AS_HELP_STRING([--disable-xmltoman],[Enable rebuilding of man pages with xmltoman]),
-    [case "${enableval}" in
-      yes) xmltoman=yes ;;
-      no)  xmltoman=no ;;
-      *) AC_MSG_ERROR([bad value ${enableval} for --disable-xmltoman]) ;;
-    esac],[xmltoman=yes])
-
-    if test x$xmltoman = xyes ; then
-        AC_CHECK_PROG(have_xmltoman, xmltoman, yes, no)
-    fi
-
-    if test x$have_xmltoman = xno -o x$xmltoman = xno; then
-        if ! test -e man/pulseaudio.1 ; then
-            AC_MSG_ERROR([*** xmltoman was not found or was disabled, it is required to build the manpages as they have not been pre-built, install xmltoman, pass --disable-manpages or dont pass --disable-xmltoman])
-            exit 1
-        fi
-        AC_MSG_WARN([*** Not rebuilding man pages as xmltoman is not found ***])
-        xmltoman=no
-    fi
-fi
-AM_CONDITIONAL([USE_XMLTOMAN], [test "x$xmltoman" = xyes])
 AM_CONDITIONAL([BUILD_MANPAGES], [test "x$manpages" = xyes])
 
 #### PulseAudio system group & user  #####
diff --git a/man/Makefile.am b/man/Makefile.am
index 31ac69c..b0536d8 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -117,49 +117,47 @@ default.pa.5.xml: default.pa.5.xml.in Makefile
 	    -e 's, at PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
             -e 's, at PACKAGE_URL\@,$(PACKAGE_URL),g' $< > $@
 
-if USE_XMLTOMAN
-
 CLEANFILES += \
 	$(man_MANS)
 
 pulseaudio.1: pulseaudio.1.xml Makefile
-	xmltoman $< > $@ || rm -f $@
+	perl xmltoman $< > $@ || rm -f $@
 
 esdcompat.1: esdcompat.1.xml Makefile
-	xmltoman $< > $@ || rm -f $@
+	perl xmltoman $< > $@ || rm -f $@
 
 pax11publish.1: pax11publish.1.xml Makefile
-	xmltoman $< > $@ || rm -f $@
+	perl xmltoman $< > $@ || rm -f $@
 
 paplay.1: paplay.1.xml Makefile
-	xmltoman $< > $@ || rm -f $@
+	perl xmltoman $< > $@ || rm -f $@
 
 pacat.1: pacat.1.xml Makefile
-	xmltoman $< > $@ || rm -f $@
+	perl xmltoman $< > $@ || rm -f $@
 
 pacmd.1: pacmd.1.xml Makefile
-	xmltoman $< > $@ || rm -f $@
+	perl xmltoman $< > $@ || rm -f $@
 
 pactl.1: pactl.1.xml Makefile
-	xmltoman $< > $@ || rm -f $@
+	perl xmltoman $< > $@ || rm -f $@
 
 pasuspender.1: pasuspender.1.xml Makefile
-	xmltoman $< > $@ || rm -f $@
+	perl xmltoman $< > $@ || rm -f $@
 
 padsp.1: padsp.1.xml Makefile
-	xmltoman $< > $@ || rm -f $@
+	perl xmltoman $< > $@ || rm -f $@
 
 pabrowse.1: pabrowse.1.xml Makefile
-	xmltoman $< > $@ || rm -f $@
+	perl xmltoman $< > $@ || rm -f $@
 
 pulse-daemon.conf.5: pulse-daemon.conf.5.xml Makefile
-	xmltoman $< > $@ || rm -f $@
+	perl xmltoman $< > $@ || rm -f $@
 
 pulse-client.conf.5: pulse-client.conf.5.xml Makefile
-	xmltoman $< > $@ || rm -f $@
+	perl xmltoman $< > $@ || rm -f $@
 
 default.pa.5: default.pa.5.xml Makefile
-	xmltoman $< > $@ || rm -f $@
+	perl xmltoman $< > $@ || rm -f $@
 
 xmllint: $(noinst_DATA)
 	for f in $(noinst_DATA) ; do \
@@ -168,8 +166,6 @@ xmllint: $(noinst_DATA)
 
 endif
 
-endif
-
 EXTRA_DIST = \
 	$(man_MANS) \
 	pulseaudio.1.xml.in \
@@ -185,6 +181,7 @@ EXTRA_DIST = \
 	pulse-daemon.conf.5.xml.in \
 	pulse-client.conf.5.xml.in \
 	default.pa.5.xml.in \
+	xmltoman \
 	xmltoman.css \
 	xmltoman.xsl \
 	xmltoman.dtd
diff --git a/man/xmltoman b/man/xmltoman
new file mode 100755
index 0000000..6a7489a
--- /dev/null
+++ b/man/xmltoman
@@ -0,0 +1,217 @@
+#!/usr/bin/perl -w
+
+#    xmltoman - simple xml to man converter
+#    Copyright (C) 2000-2002 Oliver Kurth <oku at masqmail.cx>
+#                       2003 Lennart Poettering <mzkzygbzna at 0pointer.de>
+#
+#    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
+
+use XML::Parser;
+
+my $buffer = "";
+my $break_req = 0;
+
+my @stack;
+my $stack_n = 0;
+
+my $para = 0; 
+
+sub out {
+    my $t = shift;
+
+    if ($t ne "") {
+        print $t;
+        $break_req=1;
+    }
+}
+
+sub out_buf {
+    local $_;
+
+    my $space = shift;
+
+    $_ = $buffer;
+    $buffer = "";
+
+    s/\n/\ /gm;
+    s/\s+/\ /gm;
+    s/^\s*//gm if (!$break_req);
+    s/^\s$//gm if (!$space);
+    
+    out($_);
+}
+
+sub stack_push {
+    my $a = shift;
+
+    if ($stack_n == 0 or $a ne $stack[$stack_n-1]) {
+        out("\\fB") if $a =~ /^bold$/;
+        out("\\fI") if $a =~ /^italic$/;
+    }
+
+    $stack[$stack_n++] = $a;
+}
+
+sub stack_pop {
+    local $_;
+    
+    if ($stack_n > 0) {
+        $stack_n--;
+
+        if ($stack_n > 0) {
+            $a = $stack[$stack_n-1];
+            out("\\fB") if $a =~ /^bold$/;
+            out("\\fI") if $a =~ /^italic$/;
+        } else {
+            out("\\f1");
+        }
+    }
+}
+
+sub handle_start {
+    local $_;
+    my $expat = shift;
+    my $element = shift;
+    my %attr = @_;
+    
+    $_ = $element;
+
+    if (/^manpage$/) {
+        out_buf(0);
+        print "\n" if ($break_req);
+        print ".TH " . $attr{name} . " " . $attr{section} . " User Manuals\n";
+        print ".SH NAME\n";
+        print $attr{name} . " \\- " . $attr{desc} . "\n";
+        $break_req = 0;
+    } elsif (/^synopsis$/) {
+        out_buf(0);
+        print "\n" if ($break_req);
+        print ".SH SYNOPSIS\n";
+        $section = $element;
+        $break_req = 0;
+        stack_push("bold");
+    } elsif (/^description$/) {
+        out_buf(0);
+        print "\n" if ($break_req);
+        print ".SH DESCRIPTION\n";
+        $section = $element;
+        $break_req = 0;
+    } elsif (/^options$/) {
+        out_buf(0);
+        print "\n" if ($break_req);
+        print ".SH OPTIONS\n";
+        $section = $element;
+        $break_req = 0;
+    } elsif (/^seealso$/) {
+        out_buf(0);
+        print "\n" if ($break_req);
+        print ".SH SEE ALSO\n";
+        $section = $element;
+        $break_req = 0;
+    } elsif (/^section$/) {
+        out_buf(0);
+        print "\n" if ($break_req);
+        print ".SH ".uc($attr{name})."\n";
+        $section = $attr{name};
+        $break_req = 0;
+    } elsif (/^option$/) {
+        out_buf(0);
+        print "\n" if ($break_req);
+        print ".TP\n";
+        $break_req = 0;
+    } elsif (/^p$/ or /^cmd$/) {
+        out_buf(0);
+        print "\n" if ($para);
+        $break_req = 0;
+    } elsif (/^optdesc$/) {
+        out_buf(0);
+        $break_req = 0;
+    } elsif (/^arg$/ or /^file$/) {
+        out_buf(1);
+        stack_push("italic");
+    } elsif (/^opt$/) {
+        out_buf(1);
+        stack_push("bold");
+    } elsif (/^manref$/) {
+        out_buf(1);
+        stack_push("bold");
+        out($attr{name} ."(" . $attr{section} . ")");
+        stack_pop();
+    } elsif (/^url$/) {
+        out_buf(1);
+        stack_push("bold");
+        out($attr{href});
+        stack_pop();
+    };
+
+    $para = 0;
+}
+
+sub handle_end {
+    local $_;
+    my $expat = shift;
+    my $element = shift;
+    
+    $_ = $element;
+
+    $para = 0;
+
+    if (/^description$/ or /^options$/ or /^section$/ or /^seealso$/) {
+        out_buf(0);
+    } elsif (/^p$/ or /^cmd$/) {
+        out_buf(0);
+        print "\n" if ($break_req);
+        $para = 1;
+        $break_req = 0;
+    } elsif (/^synopsis$/) {
+        out_buf(0);
+        stack_pop();
+    } elsif (/^opt$/ or /^arg$/ or /^file$/) {
+        out_buf(1);
+        stack_pop();
+    } elsif (/^manpage$/) {
+        out_buf(0);
+        print "\n" if $break_req;
+        $break_req = 0;
+    } elsif (/^optdesc$/ or /^cmd$/ or /^option$/) {
+        # Simply ignore
+    } else {
+        out_buf(1);
+    }
+};
+
+sub handle_char {
+    local $_;
+    my $expat = shift;
+    my $string = shift;
+    
+    $buffer .= $string;
+}
+
+MAIN:{
+    my $file = shift;
+
+    if (!$file) {
+        print STDERR "You need to specify a file to parse\n";
+        exit(1);
+    }
+    
+    my $parser = new XML::Parser(Handlers => {
+        Start => \&handle_start, 
+        End => \&handle_end,
+        Char => \&handle_char});
+
+    $parser->parsefile($file, ProtocolEncoding => 'ISO-8859-1');
+}

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list