chiark / gitweb /
Merge playlist branch against trunk to date.
authorRichard Kettlewell <rjk@greenend.org.uk>
Tue, 17 Feb 2009 20:29:50 +0000 (20:29 +0000)
committerRichard Kettlewell <rjk@greenend.org.uk>
Tue, 17 Feb 2009 20:29:50 +0000 (20:29 +0000)
383 files changed:
.bzrignore
CHANGES.html
Doxyfile
Makefile.am
README
README.developers
acinclude.m4
cgi/Makefile.am
cgi/actions.c
cgi/cgimain.c
cgi/disorder-cgi.h
cgi/login.c
cgi/lookup.c
cgi/macros-disorder.c
cgi/options.c
clients/Makefile.am
clients/authorize.c
clients/authorize.h
clients/disorder.c
clients/disorderfm.c
clients/filename-bytes.c
clients/playrtp-alsa.c
clients/playrtp-coreaudio.c
clients/playrtp-mem.c
clients/playrtp-oss.c
clients/playrtp.c
clients/playrtp.h
configure.ac
debian/Makefile.am
debian/changelog
debian/config.disorder-server
debian/control
debian/copyright
debian/postinst.disobedience
debian/postinst.disorder-server
debian/postrm.disobedience [new file with mode: 0755]
debian/postrm.disorder-server
debian/prerm.disorder-server
debian/rules
debian/templates.disorder-server
debian/usr.share.menu.disobedience
disobedience/Makefile.am
disobedience/added.c
disobedience/choose-menu.c
disobedience/choose-search.c
disobedience/choose.c
disobedience/choose.h
disobedience/client.c
disobedience/control.c
disobedience/disobedience.c
disobedience/disobedience.h
disobedience/help.c
disobedience/log.c
disobedience/login.c
disobedience/lookup.c
disobedience/menu.c
disobedience/misc.c
disobedience/popup.c
disobedience/popup.h
disobedience/progress.c
disobedience/properties.c
disobedience/queue-generic.c
disobedience/queue-generic.h
disobedience/queue-menu.c
disobedience/queue.c
disobedience/recent.c
disobedience/rtp.c
disobedience/settings.c
disobedience/users.c
doc/Makefile.am
doc/disobedience.1.in
doc/disorder-choose.8.in [new file with mode: 0644]
doc/disorder-dbupgrade.8.in
doc/disorder-deadlock.8.in
doc/disorder-decode.8.in
doc/disorder-dump.8.in
doc/disorder-normalize.8
doc/disorder-playrtp.1.in
doc/disorder-rescan.8.in
doc/disorder-speaker.8
doc/disorder-stats.8.in
doc/disorder.1.in
doc/disorder.3
doc/disorder.cgi.8.in
doc/disorder_actions.5.head
doc/disorder_actions.5.tail
doc/disorder_config.5.in
doc/disorder_options.5.in
doc/disorder_preferences.5.in
doc/disorder_protocol.5.in
doc/disorder_templates.5.head
doc/disorder_templates.5.tail
doc/disorderd.8.in
doc/disorderfm.1.in
doc/tkdisorder.1 [deleted file]
driver/Makefile.am
driver/disorder.c
examples/Makefile.am
examples/disorder-log
examples/disorder.init.in
examples/disorder.rc.in
images/Makefile.am
images/cross.svg [new file with mode: 0644]
images/cross32.png [new file with mode: 0644]
images/go.svg [new file with mode: 0644]
images/notes.svg [new file with mode: 0644]
images/noteson.svg [new file with mode: 0644]
images/pause.svg [new file with mode: 0644]
images/pause32.png [new file with mode: 0644]
images/play32.png [new file with mode: 0644]
images/playdisabled32.png [new file with mode: 0644]
images/playenabled32.png [new file with mode: 0644]
images/query.svg [new file with mode: 0644]
images/queryon.svg [new file with mode: 0644]
images/randomdisabled32.png [new file with mode: 0644]
images/randomenabled32.png [new file with mode: 0644]
images/rtpdisabled32.png [new file with mode: 0644]
images/rtpenabled32.png [new file with mode: 0644]
images/speaker.svg [new file with mode: 0644]
images/speakeron.svg [new file with mode: 0644]
lib/Makefile.am
lib/addr.c
lib/addr.h
lib/alsabg.c
lib/alsabg.h
lib/arcfour.c
lib/arcfour.h
lib/asprintf.c
lib/authhash.c
lib/authhash.h
lib/base64.c
lib/base64.h
lib/basen.c
lib/basen.h
lib/bits.c
lib/bits.h
lib/cache.c
lib/cache.h
lib/cgi.c
lib/cgi.h
lib/charset.c
lib/charset.h
lib/client-common.c
lib/client-common.h
lib/client.c
lib/client.h
lib/common.h
lib/configuration.c
lib/configuration.h
lib/cookies.c
lib/cookies.h
lib/dateparse.c
lib/dateparse.h
lib/defs.c
lib/defs.h
lib/disorder.h
lib/eclient.c
lib/eclient.h
lib/email.c
lib/event.c
lib/event.h
lib/eventdist.c
lib/eventdist.h
lib/eventlog.c
lib/eventlog.h
lib/filepart.c
lib/filepart.h
lib/fprintf.c
lib/hash.c
lib/hash.h
lib/heap.h
lib/hex.c
lib/hex.h
lib/hostname.c
lib/hostname.h
lib/ifreq.c
lib/ifreq.h
lib/inputline.c
lib/inputline.h
lib/kvp.c
lib/kvp.h
lib/log-impl.h
lib/log.c
lib/log.h
lib/logfd.c
lib/logfd.h
lib/macros-builtin.c
lib/macros.c
lib/macros.h
lib/mem-impl.h
lib/mem.c
lib/mem.h
lib/memgc.c
lib/mime.c
lib/mime.h
lib/mixer-alsa.c
lib/mixer-oss.c
lib/mixer.c
lib/mixer.h
lib/printf.c
lib/printf.h
lib/queue-rights.c
lib/queue.c
lib/queue.h
lib/random.c
lib/random.h
lib/regsub.c
lib/regsub.h
lib/rights.c
lib/rights.h
lib/rtp.h
lib/selection.c
lib/selection.h
lib/sendmail.c
lib/sendmail.h
lib/signame.c
lib/signame.h
lib/sink.c
lib/sink.h
lib/snprintf.c
lib/speaker-protocol.c
lib/speaker-protocol.h
lib/split.c
lib/split.h
lib/strptime.c [new file with mode: 0644]
lib/strptime.h [new file with mode: 0644]
lib/syscalls.c
lib/syscalls.h
lib/table.c
lib/table.h
lib/timeval.h
lib/trackdb-int.h
lib/trackdb-stub.c
lib/trackdb.c
lib/trackdb.h
lib/trackname.c
lib/trackname.h
lib/trackorder.c
lib/tracksort.c
lib/unicode.c
lib/unicode.h
lib/unidata.c
lib/unidata.h
lib/url.c
lib/url.h
lib/user.c
lib/user.h
lib/vacopy.h
lib/vector.c
lib/vector.h
lib/version.c
lib/version.h
lib/wav.c
lib/wav.h
lib/wstat.c
lib/wstat.h
lib/xgetdate.c
libtests/Makefile.am
libtests/t-addr.c
libtests/t-arcfour.c
libtests/t-basen.c
libtests/t-bits.c
libtests/t-cache.c
libtests/t-casefold.c
libtests/t-cgi.c
libtests/t-charset.c
libtests/t-cookies.c
libtests/t-dateparse.c
libtests/t-event.c
libtests/t-eventdist.c
libtests/t-filepart.c
libtests/t-hash.c
libtests/t-heap.c
libtests/t-hex.c
libtests/t-kvp.c
libtests/t-macros.c
libtests/t-mime.c
libtests/t-printf.c
libtests/t-regsub.c
libtests/t-selection.c
libtests/t-signame.c
libtests/t-sink.c
libtests/t-split.c
libtests/t-syscalls.c
libtests/t-trackname.c
libtests/t-unicode.c
libtests/t-url.c
libtests/t-utf8.c
libtests/t-vector.c
libtests/t-words.c
libtests/t-wstat.c
libtests/test.c
libtests/test.h
plugins/Makefile.am
plugins/exec.c
plugins/execraw.c
plugins/fs.c
plugins/mad.c
plugins/madshim.h
plugins/notify.c
plugins/shell.c
plugins/tracklength.c
prepare
python/Makefile.am
python/disorder.py.in
python/tkdisorder [deleted file]
scripts/Makefile.am
scripts/completion.bash
scripts/dist
scripts/fix-names [new file with mode: 0755]
scripts/format-gcov-report
scripts/htmlman
scripts/inst
scripts/macro-docs
scripts/make-unidata
scripts/make-version-string
scripts/makedeb
scripts/oggrename
scripts/sedfiles.make
scripts/setup.in
scripts/setversion [new file with mode: 0755]
scripts/teardown.in
scripts/text2c
server/Makefile.am
server/api-client.c
server/api-client.h
server/api-server.c
server/api.c
server/choose.c
server/daemonize.c
server/dbupgrade.c
server/deadlock.c
server/decode.c
server/disorder-server.h
server/disorderd.c
server/dump.c
server/exports.c
server/normalize.c
server/play.c
server/plugin.c
server/queue-ops.c
server/rescan.c
server/schedule.c
server/server-queue.c
server/server.c
server/speaker-alsa.c
server/speaker-command.c
server/speaker-coreaudio.c
server/speaker-network.c
server/speaker-oss.c
server/speaker.c
server/speaker.h
server/state.c
server/stats.c
server/trackname.c
sounds/Makefile.am
templates/Makefile.am
templates/about.tmpl
templates/choose.tmpl
templates/disorder.css
templates/error.tmpl
templates/help.tmpl
templates/login.tmpl
templates/macros.tmpl
templates/new.tmpl
templates/playing.tmpl
templates/prefs.tmpl
templates/recent.tmpl
tests/Makefile.am
tests/aliases.py
tests/cookie.py
tests/dbversion.py
tests/dtest.py
tests/dump.py
tests/files.py
tests/play.py
tests/queue.py
tests/recode.py
tests/schedule.py
tests/search.py
tests/udplog.c
tests/user-upgrade.py
tests/user.py

index a4501f990b08d76c1b92aca888e3fd607124ac53..022ddca92cb36f792c31caa02f3abba5bf6a4cd5 100644 (file)
@@ -197,3 +197,6 @@ libtests/index.html
 libtests/t-eventdist
 doc/disorder_preferences.5
 doc/disorder_preferences.5.html
+plugins/index.html
+doc/disorder-choose.8
+doc/disorder-choose.8.html
index d19afe7cc861f74876a24f1f79edc639c001c97c..6dca25c96af9e1802ed1089a9aa49b065b6dd977 100644 (file)
@@ -55,7 +55,90 @@ span.command {
 <body>
 <h1>DisOrder Change History</h1>
 
-<p>This file documents recent user-visible changes to DisOrder.</p>
+<p>This file documents recent user-visible changes to <a
+ href="http://www.greenend.org.uk/rjk/disorder/">DisOrder</a>.</p>
+
+<h2>Changes up to version 4.3</h2>
+
+  <div class=section>
+
+    <h3>Disobedience</h3>
+
+      <div class=section>
+
+        <p>A bug was fixed in the calculation of how much of the track had
+        played.  This would lead to the counter showing incorrect values in
+        various situations.</p>
+
+        <p>Disobedience's icons have been changed to larger, more colorful
+        ones.  The SVG source is included if you want to fiddle with them.</p>
+
+        <p>&ldquo;Select all&rdquo; is now no longer available in the choose
+        tab.  Instead there is a new &ldquo;Select children&rdquo; option which
+        selects the file children of a single subdirectory.</p>
+
+      </div>
+
+    <h3>Server</h3>
+
+      <div class=section>
+
+        <p>The selection bias for newly added tracks was reduced by half.  You
+        can put it back to the old very neophilic value with
+        &ldquo;<tt>new_bias 900000</tt>&rdquo; in the config file.</p>
+
+        <p>It is now possible to &lsquo;adopt&rsquo; randomly picked tracks.
+        Disobedience and the command-line client support this but the web
+        interface does not.</p>
+
+        <p>The default track name parsing was modified to handle filenames
+        generated by iTunes.</p>
+        
+      </div>
+
+    <h3>Miscellaneous</h3>
+
+      <div class=section>
+
+        <p><tt>disorderfm</tt> now preserves directory permissions.</p>
+
+        <p>DisOrder is now licensed under <a
+         href="http://www.gnu.org/licenses/gpl-3.0.html">GPL v3</a>.  The main
+        goal is to prohibit <a
+         href="http://en.wikipedia.org/wiki/Tivoization">Tivoization</a>.</p>
+
+        <p>The build system will now automatically cope with Fink's broken GTK+
+        packages.  There are a number of improvements to the Debian
+        packaging.</p>
+
+        <p>DisOrder now builds on 64-bit Linux systems.</p>
+
+        <p>There are various minor fixes.</p>
+
+      </div>
+
+  <h3>Bugs fixed</h3>
+  
+    <div class=section>
+
+      <table class=bugs>
+        <tr>
+          <th>ID</th>
+          <th>Description</th>
+        </tr>
+        
+        <tr>
+          <td><a href="http://code.google.com/p/disorder/issues/detail?id=24">#24</a></td>
+          <td>Fails to build on ubuntu 8.10</td>
+        </tr>
+        <tr>
+          <td><a href="http://code.google.com/p/disorder/issues/detail?id=26">#26</a></td>
+          <td>Disobedience shows wrong track elapsed time after a pause</td>
+        </tr>
+      </table>
+      
+    </div>
+  </div>
 
 <h2>Changes up to version 4.2</h2>
 
index e2eca1d244796495928983ad1ed82113d551f0ca..c6038072f5aefb987d805abd855ddaa2ad14b810 100644 (file)
--- a/Doxyfile
+++ b/Doxyfile
@@ -295,7 +295,7 @@ INTERNAL_DOCS          = YES
 # in case and if your file system supports case sensitive file names. Windows 
 # and Mac users are advised to set this option to NO.
 
-CASE_SENSE_NAMES       = YES
+CASE_SENSE_NAMES       = NO
 
 # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
 # will show members with their full class and namespace scopes in the 
@@ -307,7 +307,7 @@ HIDE_SCOPE_NAMES       = YES
 # will put a list of the files that are included by a file in the documentation 
 # of that file.
 
-SHOW_INCLUDE_FILES     = YES
+SHOW_INCLUDE_FILES     = NO
 
 # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
 # is inserted in the documentation for inline members.
@@ -556,7 +556,7 @@ FILTER_SOURCE_FILES    = NO
 # Note: To get rid of all source code in the generated output, make sure also 
 # VERBATIM_HEADERS is set to NO.
 
-SOURCE_BROWSER         = YES
+SOURCE_BROWSER         = NO
 
 # Setting the INLINE_SOURCES tag to YES will include the body 
 # of functions and classes directly in the documentation.
index cb5d491afec14b1a72ce562aefc2eda9a4bd89f1..501f344842485420a9bf423a10ba47a6b8131e28 100644 (file)
@@ -2,30 +2,30 @@
 # This file is part of DisOrder.
 # Copyright (C) 2004-2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 EXTRA_DIST=TODO CHANGES.html README.streams BUGS \
 README.upgrades README.client README.raw README.vhost README.developers
 SUBDIRS=@subdirs@
 
+DISTCHECK_CONFIGURE_FLAGS:=httpdir=$(distdir)/_inst/httpdir cgiexecdir=$(shell pwd)/$(distdir)/_inst/cgiexecdir
+
 check-report: before-check check make-coverage-reports
 before-check:
        rm -f */*.gcda */*.gcov
-make-coverage-reports:
+make-coverage-reports: check
        @for subdir in lib plugins server clients disobedience; do \
          echo cd $$subdir;\
          cd $$subdir;\
@@ -35,6 +35,11 @@ make-coverage-reports:
          cd ..;\
        done
 
+clean-gcov:
+       rm -f */index.html
+       rm -f */*.c.html
+       rm -f */*.gcov
+
 echo-distdir:
        @echo $(distdir)
 
diff --git a/README b/README
index 8cd2c35ff954953429e4b5a4ded972d666c9d057..a7736da42800143038f854e2dda622fb94ab0f10 100644 (file)
--- a/README
+++ b/README
@@ -25,7 +25,7 @@ effort.
 
 Build dependencies:
   Name             Tested              Notes
-  libdb            4.3.29              not 4.2.x; 4.4+ might work.
+  libdb            4.3.29              not 4.2/4.6; 4.[457] seem to be ok
   libgc            6.8
   libvorbisfile    1.1.2
   libpcre          6.7                 need UTF-8 support
@@ -273,18 +273,18 @@ Portions Copyright (C) 1997-2006 Free Software Foundation, Inc.
 Binaries may derive extra copyright owners through linkage (binary distributors
 are expected to do their own legwork)
 
-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 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 3 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.
+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
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 Local Variables:
 mode:text
index d0c1cdc1a8103e3bce9f5a946fd584fe42a08ce5..10226fdf95d19c4026fff23958cd84b07d4c85f1 100644 (file)
@@ -12,10 +12,13 @@ Dependencies:
      apt-get install gcc libc-dev automake autoconf libtool libgtk2.0-dev \
                     libgc-dev libgcrypt-dev libpcre3-dev libvorbis-dev \
                     libao-dev libmad0-dev libasound2-dev libdb4.3-dev \
-                    libflac-dev
+                    libflac-dev vorbis-tools wget
 
      (Use the bzr from backports, the one in etch is obsolete.)
 
+     On lenny use libdb4.5-deb.  libdb4.6 does not work (and configure will
+     refuse to use it).
+
    * On FreeBSD you'll need at least these packages:
         autotools
         bash
@@ -34,8 +37,8 @@ Dependencies:
 
 Building:
 
-   * Compiled versions of configure and the makefiles are including in bzr, so
-     if you didn't use a source tarball, you must start as follows:
+   * Compiled versions of configure and the makefiles are not included in bzr,
+     so if you didn't use a source tarball, you must start as follows:
 
         bash ./prepare
         ./configure -C
@@ -195,7 +198,7 @@ Code And Patches:
      branch somewhere I can get at it.
 
    * Please make it clear that your changes can be distributed under DisOrder's
-     licence (which is "GPL v2 or later").
+     licence (which is "GPL v3 or later").
 
 Local Variables:
 mode:text
index 9a11b7a350b4d98d6f877bfbf97a1ca74f4b4268..6df1aa39b4048130b4dacf642f1547e45939a760 100644 (file)
@@ -1,20 +1,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 AC_DEFUN([RJK_FIND_GC_H],[
index 72ea195a8acfa55827498d2276ab9b351db6464f..22e2a77e1f62fed6b9f5c70d324b90eff2d14a15 100644 (file)
@@ -2,20 +2,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2004-2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 cgiexec_PROGRAMS=disorder
@@ -31,3 +29,5 @@ disorder_DEPENDENCIES=../lib/libdisorder.a
 
 install-exec-hook:
        $(LIBTOOL) --mode=finish $(DESTDIR)$(cgiexecdir)
+
+CLEANFILES=*.gcda *.gcov *.gcno *.c.html index.html
index 4728503de41bd4f03507ba7d3ab0763a9c5d2ec2..d752660a141fe6d0d1406cf818028d39279851ea 100644 (file)
@@ -2,28 +2,28 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-/** @file server/actions.c
+/** @file cgi/actions.c
  * @brief DisOrder web actions
  *
  * Actions are anything that the web interface does beyond passive template
  * expansion and inspection of state recieved from the server.  This means
  * playing tracks, editing prefs etc but also setting extra headers e.g. to
  * auto-refresh the playing list.
+ *
+ * See @ref lib/macros-builtin.c for docstring syntax.
  */
 
 #include "disorder-cgi.h"
@@ -47,14 +47,14 @@ static void redirect(const char *url) {
     fatal(errno, "error writing to stdout");
 }
 
-/*! playing
+/*$ playing
  *
  * Expands \fIplaying.tmpl\fR as if there was no special 'playing' action, but
  * adds a Refresh: field to the HTTP header.  The maximum refresh interval is
  * defined by \fBrefresh\fR (see \fBdisorder_config\fR(5)) but may be less if
  * the end of the track is near.
  */
-/*! manage
+/*$ manage
  *
  * Expands \fIplaying.tmpl\fR (NB not \fImanage.tmpl\fR) as if there was no
  * special 'playing' action, and adds a Refresh: field to the HTTP header.  The
@@ -80,14 +80,14 @@ static void act_playing(void) {
     if(now + refresh > fin)
       refresh = fin - now;
   }
-  if(dcgi_queue && dcgi_queue->state == playing_isscratch) {
+  if(dcgi_queue && dcgi_queue->origin == origin_scratch) {
     /* next track is a scratch, don't leave more than the inter-track gap */
     if(refresh > config->gap)
       refresh = config->gap;
   }
   if(!dcgi_playing
      && ((dcgi_queue
-          && dcgi_queue->state != playing_random)
+          && dcgi_queue->origin != origin_random)
          || dcgi_random_enabled)
      && dcgi_enabled) {
     /* no track playing but playing is enabled and there is something coming
@@ -105,7 +105,7 @@ static void act_playing(void) {
   dcgi_expand("playing", 1);
 }
 
-/*! disable
+/*$ disable
  *
  * Disables play.
  */
@@ -115,7 +115,7 @@ static void act_disable(void) {
   redirect(0);
 }
 
-/*! enable
+/*$ enable
  *
  * Enables play.
  */
@@ -125,7 +125,7 @@ static void act_enable(void) {
   redirect(0);
 }
 
-/*! random-disable
+/*$ random-disable
  *
  * Disables random play.
  */
@@ -135,7 +135,7 @@ static void act_random_disable(void) {
   redirect(0);
 }
 
-/*! random-enable
+/*$ random-enable
  *
  * Enables random play.
  */
@@ -145,7 +145,7 @@ static void act_random_enable(void) {
   redirect(0);
 }
 
-/*! pause
+/*$ pause
  *
  * Pauses the current track (if there is one and it's not paused already).
  */
@@ -155,7 +155,7 @@ static void act_pause(void) {
   redirect(0);
 }
 
-/*! resume
+/*$ resume
  *
  * Resumes the current track (if there is one and it's paused).
  */
@@ -165,7 +165,7 @@ static void act_resume(void) {
   redirect(0);
 }
 
-/*! remove
+/*$ remove
  *
  * Removes the track given by the \fBid\fR argument.  If this is the currently
  * playing track then it is scratched.
@@ -179,29 +179,24 @@ static void act_remove(void) {
       error(0, "missing 'id' argument");
     else if(!(q = dcgi_findtrack(id)))
       error(0, "unknown queue id %s", id);
-    else switch(q->state) {
-    case playing_isscratch:
-    case playing_failed:
-    case playing_no_player:
-    case playing_ok:
-    case playing_quitting:
-    case playing_scratched:
-      error(0, "does not make sense to scratch %s", id);
-      break;
-    case playing_paused:                /* started but paused */
-    case playing_started:               /* started to play */
+    else if(q->origin == origin_scratch)
+      /* can't scratch scratches */
+      error(0, "does not make sense to scratch or remove %s", id);
+    else if(q->state == playing_paused
+            || q->state == playing_started)
+      /* removing the playing track = scratching */
       disorder_scratch(dcgi_client, id);
-      break;
-    case playing_random:                /* unplayed randomly chosen track */
-    case playing_unplayed:              /* haven't played this track yet */
+    else if(q->state == playing_unplayed)
+      /* otherwise it must be in the queue */
       disorder_remove(dcgi_client, id);
-      break;
-    }
+    else
+      /* various error states */
+      error(0, "does not make sense to scratch or remove %s", id);
   }
   redirect(0);
 }
 
-/*! move
+/*$ move
  *
  * Moves the track given by the \fBid\fR argument the distance given by the
  * \fBdelta\fR argument.  If this is positive the track is moved earlier in the
@@ -231,7 +226,7 @@ static void act_move(void) {
   redirect(0);
 }
 
-/*! play
+/*$ play
  *
  * Play the track given by the \fBtrack\fR argument, or if that is not set all
  * the tracks in the directory given by the \fBdir\fR argument.
@@ -264,7 +259,7 @@ static int clamp(int n, int min, int max) {
   return n;
 }
 
-/*! volume
+/*$ volume
  *
  * If the \fBdelta\fR argument is set: adjust both channels by that amount (up
  * if positive, down if negative).
@@ -326,7 +321,7 @@ static int login_as(const char *username, const char *password) {
   return 0;                             /* OK */
 }
 
-/*! login
+/*$ login
  *
  * If \fBusername\fR and \fBpassword\fR are set (and the username isn't
  * "guest") then attempt to log in using those credentials.  On success,
@@ -361,7 +356,7 @@ static void act_login(void) {
   }
 }
 
-/*! logout
+/*$ logout
  *
  * Logs out the current user and expands \fIlogin.tmpl\fR with \fBstatus\fR or
  * \fB@error\fR set according to the result.
@@ -386,7 +381,7 @@ static void act_logout(void) {
   dcgi_expand("login", 1);
 }
 
-/*! register
+/*$ register
  *
  * Register a new user using \fBusername\fR, \fBpassword1\fR, \fBpassword2\fR
  * and \fBemail\fR and expands \fIlogin.tmpl\fR with \fBstatus\fR or
@@ -453,7 +448,7 @@ static void act_register(void) {
   dcgi_expand("login", 1);
 }
 
-/*! confirm
+/*$ confirm
  *
  * Confirm a user registration using the nonce supplied in \fBc\fR and expands
  * \fIlogin.tmpl\fR with \fBstatus\fR or \fB@error\fR set according to the
@@ -489,7 +484,7 @@ static void act_confirm(void) {
   dcgi_expand("login", 1);
 }
 
-/*! edituser
+/*$ edituser
  *
  * Edit user details using \fBusername\fR, \fBchangepassword1\fR,
  * \fBchangepassword2\fR and \fBemail\fR and expands \fIlogin.tmpl\fR with
@@ -550,7 +545,7 @@ static void act_edituser(void) {
   dcgi_expand("login", 1);
 }
 
-/*! reminder
+/*$ reminder
  *
  * Issue an email password reminder to \fBusername\fR and expands
  * \fIlogin.tmpl\fR with \fBstatus\fR or \fB@error\fR set according to the
@@ -632,7 +627,7 @@ static int process_prefs(int numfile) {
   return 0;
 }
 
-/*! prefs
+/*$ prefs
  *
  * Set preferences on a number of tracks.
  *
index 219f2b77d937495fcec5252e6323388c8360e842..583af30e01a7e42f939259044f0edf691d11dfcd 100644 (file)
@@ -2,22 +2,20 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-/** @file server/cgimain.c
+/** @file cgi/cgimain.c
  * @brief DisOrder CGI
  */
 
index 3cabe9b13f806658b71725be447757760eb006c5..9a455e9ed6f3ce978471f65a87e0082b1be8295a 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file cgi/disorder-cgi.h
  * @brief Shared header for DisOrder CGI program
index 891ebe14d24994fe8b2e8718132d9007035f5f78..a7a6dc0818fd069f83259168097ea5e0fe96be72 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder.
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file cgi/login.c
+ * @brief Web login support
  */
-
 #include "disorder-cgi.h"
 
 /** @brief Client used by CGI
@@ -57,7 +57,7 @@ static int better_cookie(const struct cookie *a, const struct cookie *b) {
 /** @brief Login cookie */
 char *dcgi_cookie;
 
-/** @brief Set @ref login_cookie */
+/** @brief Set @ref dcgi_cookie */
 void dcgi_get_cookie(void) {
   const char *cookie_env;
   int n, best_cookie;
index 6dc254cdee33c30d96f4c16b8a27409e18f9c737..fd94900b9b1c39dfb935276b3be3a736d906b39a 100644 (file)
@@ -2,22 +2,20 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-/** @file server/lookup.c
+/** @file cgi/lookup.c
  * @brief Server lookups
  *
  * To improve performance many server lookups are cached.
index 5ea74138275f3ad77f2e078f9bdafb05f9fd2e51..c0eee5d735e287c299ede0a4f4c4f35ea83b84e4 100644 (file)
@@ -1,25 +1,24 @@
-
 /*
  * This file is part of DisOrder.
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-/** @file server/macros-disorder.c
+/** @file cgi/macros-disorder.c
  * @brief DisOrder-specific expansions
+ *
+ * See @ref lib/macros-builtin.c for docstring syntax.
  */
 
 #include "disorder-cgi.h"
@@ -38,7 +37,7 @@ static const char *make_index(int i) {
   return s;
 }
 
-/*! @server-version
+/*$ @server-version
  *
  * Expands to the server's version string, or a (safe to use) error
  * value if the server is unavailable or broken.
@@ -57,7 +56,7 @@ static int exp_server_version(int attribute((unused)) nargs,
   return sink_writes(output, cgi_sgmlquote(v)) < 0 ? -1 : 0;
 }
 
-/*! @version
+/*$ @version
  *
  * Expands to the local version string.
  */
@@ -69,7 +68,7 @@ static int exp_version(int attribute((unused)) nargs,
                      cgi_sgmlquote(disorder_short_version_string)) < 0 ? -1 : 0;
 }
 
-/*! @url
+/*$ @url
  *
  * Expands to the base URL of the web interface.
  */
@@ -81,7 +80,7 @@ static int exp_url(int attribute((unused)) nargs,
                      cgi_sgmlquote(config->url)) < 0 ? -1 : 0;
 }
 
-/*! @arg{NAME}
+/*$ @arg{NAME}
  *
  * Expands to the UNQUOTED form of CGI argument NAME, or the empty string if
  * there is no such argument.  Use @argq for a quick way to quote the argument.
@@ -98,7 +97,7 @@ static int exp_arg(int attribute((unused)) nargs,
     return 0;
 }
 
-/*! @argq{NAME}
+/*$ @argq{NAME}
  *
  * Expands to the (quoted) form of CGI argument NAME, or the empty string if
  * there is no such argument.  Use @arg for the unquoted argument.
@@ -115,7 +114,7 @@ static int exp_argq(int attribute((unused)) nargs,
     return 0;
 }
 
-/*! @user
+/*$ @user
  *
  * Expands to the logged-in username (which might be "guest"), or to
  * the empty string if not connected.
@@ -131,7 +130,7 @@ static int exp_user(int attribute((unused)) nargs,
   return 0;
 }
 
-/*! @part{TRACK|ID}{PART}{CONTEXT}
+/*$ @part{TRACK|ID}{PART}{CONTEXT}
  *
  * Expands to a track name part.
  *
@@ -171,7 +170,7 @@ static int exp_part(int nargs,
   return 0;
 }
 
-/*! @quote{STRING}
+/*$ @quote{STRING}
  *
  * SGML-quotes STRING.  Note that most expansion results are already suitable
  * quoted, so this expansion is usually not required.
@@ -183,7 +182,7 @@ static int exp_quote(int attribute((unused)) nargs,
   return sink_writes(output, cgi_sgmlquote(args[0])) < 0 ? -1 : 0;
 }
 
-/*! @who{ID}
+/*$ @who{ID}
  *
  * Expands to the name of the submitter of track ID, which must be a playing
  * track, in the queue, or in the recent list.
@@ -199,7 +198,7 @@ static int exp_who(int attribute((unused)) nargs,
   return 0;
 }
 
-/*! @when{ID}
+/*$ @when{ID}
  *
  * Expands to the time a track started or is expected to start.  The track must
  * be a playing track, in the queue, or in the recent list.
@@ -236,7 +235,7 @@ static int exp_when(int attribute((unused)) nargs,
   return sink_writes(output, "&nbsp;") < 0 ? -1 : 0;
 }
 
-/*! @length{ID|TRACK}
+/*$ @length{ID|TRACK}
  *
  * Expands to the length of a track, identified by its queue ID or its name.
  * If it is the playing track (identified by ID) then the amount played so far
@@ -268,7 +267,7 @@ static int exp_length(int attribute((unused)) nargs,
   return sink_writes(output, "&nbsp;") < 0 ? -1 : 0;
 }
 
-/*! @removable{ID}
+/*$ @removable{ID}
  *
  * Expands to "true" if track ID is removable (or scratchable, if it is the
  * playing track) and "false" otherwise.
@@ -288,7 +287,7 @@ static int exp_removable(int attribute((unused)) nargs,
                             (dcgi_rights, disorder_user(dcgi_client), q));
 }
 
-/*! @movable{ID}{DIR}
+/*$ @movable{ID}{DIR}
  *
  * Expands to "true" if track ID is movable and "false" otherwise.
  *
@@ -321,7 +320,7 @@ static int exp_movable(int  nargs,
                                       q));
 }
 
-/*! @playing{TEMPLATE}
+/*$ @playing{TEMPLATE}
  *
  * Expands to TEMPLATE, with the following expansions:
  * - @id: the queue ID of the playing track
@@ -349,7 +348,7 @@ static int exp_playing(int nargs,
                    output, u);
 }
 
-/*! @queue{TEMPLATE}
+/*$ @queue{TEMPLATE}
  *
  * For each track in the queue, expands TEMPLATE with the following expansions:
  * - @id: the queue ID of the track
@@ -381,7 +380,7 @@ static int exp_queue(int attribute((unused)) nargs,
   return 0;
 }
 
-/*! @recent{TEMPLATE}
+/*$ @recent{TEMPLATE}
  *
  * For each track in the recently played list, expands TEMPLATE with the
  * following expansions:
@@ -414,7 +413,7 @@ static int exp_recent(int attribute((unused)) nargs,
   return 0;
 }
 
-/*! @new{TEMPLATE}
+/*$ @new{TEMPLATE}
  *
  * For each track in the newly added list, expands TEMPLATE wit the following
  * expansions:
@@ -448,7 +447,7 @@ static int exp_new(int attribute((unused)) nargs,
   return 0;
 }
 
-/*! @volume{CHANNEL}
+/*$ @volume{CHANNEL}
  *
  * Expands to the volume in a given channel.  CHANNEL must be "left" or
  * "right".
@@ -463,7 +462,7 @@ static int exp_volume(int attribute((unused)) nargs,
                          ? dcgi_volume_left : dcgi_volume_right) < 0 ? -1 : 0;
 }
 
-/*! @isplaying
+/*$ @isplaying
  *
  * Expands to "true" if there is a playing track, otherwise "false".
  */
@@ -475,7 +474,7 @@ static int exp_isplaying(int attribute((unused)) nargs,
   return mx_bool_result(output, !!dcgi_playing);
 }
 
-/*! @isqueue
+/*$ @isqueue
  *
  * Expands to "true" if there the queue is nonempty, otherwise "false".
  */
@@ -487,7 +486,7 @@ static int exp_isqueue(int attribute((unused)) nargs,
   return mx_bool_result(output, !!dcgi_queue);
 }
 
-/*! @isrecent@
+/*$ @isrecent
  *
  * Expands to "true" if there the recently played list is nonempty, otherwise
  * "false".
@@ -500,7 +499,7 @@ static int exp_isrecent(int attribute((unused)) nargs,
   return mx_bool_result(output, !!dcgi_recent);
 }
 
-/*! @isnew
+/*$ @isnew
  *
  * Expands to "true" if there the newly added track list is nonempty, otherwise
  * "false".
@@ -513,7 +512,7 @@ static int exp_isnew(int attribute((unused)) nargs,
   return mx_bool_result(output, !!dcgi_nnew);
 }
 
-/*! @pref{TRACK}{KEY}
+/*$ @pref{TRACK}{KEY}
  *
  * Expands to a track preference.
  */
@@ -528,7 +527,7 @@ static int exp_pref(int attribute((unused)) nargs,
   return 0;
 }
 
-/*! @prefs{TRACK}{TEMPLATE}
+/*$ @prefs{TRACK}{TEMPLATE}
  *
  * For each track preference of track TRACK, expands TEMPLATE with the
  * following expansions:
@@ -567,7 +566,7 @@ static int exp_prefs(int attribute((unused)) nargs,
   return 0;
 }
 
-/*! @transform{TRACK}{TYPE}{CONTEXT}
+/*$ @transform{TRACK}{TYPE}{CONTEXT}
  *
  * Transforms a track name (if TYPE is "track") or directory name (if type is
  * "dir").  CONTEXT should be the context, if it is left out then "display" is
@@ -582,7 +581,7 @@ static int exp_transform(int nargs,
   return sink_writes(output, cgi_sgmlquote(t)) < 0 ? -1 : 0;
 }
 
-/*! @enabled@
+/*$ @enabled
  *
  * Expands to "true" if playing is enabled, otherwise "false".
  */
@@ -597,7 +596,7 @@ static int exp_enabled(int attribute((unused)) nargs,
   return mx_bool_result(output, e);
 }
 
-/*! @random-enabled
+/*$ @random-enabled
  *
  * Expands to "true" if random play is enabled, otherwise "false".
  */
@@ -612,7 +611,7 @@ static int exp_random_enabled(int attribute((unused)) nargs,
   return mx_bool_result(output, e);
 }
 
-/*! @trackstate{TRACK}
+/*$ @trackstate{TRACK}
  *
  * Expands to "playing" if TRACK is currently playing, or "queue" if it is in
  * the queue, otherwise to nothing.
@@ -638,7 +637,7 @@ static int exp_trackstate(int attribute((unused)) nargs,
   return 0;
 }
 
-/*! @thisurl
+/*$ @thisurl
  *
  * Expands to an UNQUOTED URL which points back to the current page.  (NB it
  * might not be byte for byte identical - for instance, CGI arguments might be
@@ -651,7 +650,7 @@ static int exp_thisurl(int attribute((unused)) nargs,
   return sink_writes(output, cgi_thisurl(config->url)) < 0 ? -1 : 0;
 }
 
-/*! @resolve{TRACK}
+/*$ @resolve{TRACK}
  *
  * Expands to an UNQUOTED name for the TRACK that is not an alias, or to
  * nothing if it is not a valid track.
@@ -667,7 +666,7 @@ static int exp_resolve(int attribute((unused)) nargs,
   return 0;
 }
 
-/*! @paused
+/*$ @paused
  *
  * Expands to "true" if the playing track is paused, to "false" if it is
  * playing (or if there is no playing track at all).
@@ -681,7 +680,7 @@ static int exp_paused(int attribute((unused)) nargs,
                                  && dcgi_playing->state == playing_paused));
 }
 
-/*! @state{ID}@
+/*$ @state{ID}
  *
  * Expands to the current state of track ID.
  */
@@ -696,7 +695,22 @@ static int exp_state(int attribute((unused)) nargs,
   return 0;
 }
 
-/*! @right{RIGHT}{WITH-RIGHT}{WITHOUT-RIGHT}@
+/*$ @origin{ID}
+ *
+ * Expands to the current origin of track ID.
+ */
+static int exp_origin(int attribute((unused)) nargs,
+                      char **args,
+                      struct sink *output,
+                      void attribute((unused)) *u) {
+  struct queue_entry *q = dcgi_findtrack(args[0]);
+
+  if(q)
+    return sink_writes(output, track_origins[q->origin]) < 0 ? -1 : 0;
+  return 0;
+}
+
+/*$ @right{RIGHT}{WITH-RIGHT}{WITHOUT-RIGHT}
  *
  * Expands to WITH-RIGHT if the current user has right RIGHT, otherwise to
  * WITHOUT-RIGHT.  The WITHOUT-RIGHT argument may be left out.
@@ -733,7 +747,7 @@ static int exp_right(int nargs,
   return 0;
 }
 
-/*! @userinfo{PROPERTY}
+/*$ @userinfo{PROPERTY}
  *
  * Expands to the named property of the current user.
  */
@@ -750,7 +764,7 @@ static int exp_userinfo(int attribute((unused)) nargs,
   return 0;
 }
 
-/*! @error
+/*$ @error
  *
  * Expands to the latest error string.
  */
@@ -762,7 +776,7 @@ static int exp_error(int attribute((unused)) nargs,
               < 0 ? -1 : 0;
 }
 
-/*! @status
+/*$ @status
  *
  * Expands to the latest status string.
  */
@@ -774,7 +788,7 @@ static int exp_status(int attribute((unused)) nargs,
               < 0 ? -1 : 0;
 }
 
-/*! @image{NAME}
+/*$ @image{NAME}
  *
  * Expands to the URL of the image called NAME.
  *
@@ -865,7 +879,7 @@ static int exp__files_dirs(int nargs,
 
 }
 
-/*! @tracks{DIR}{RE}{TEMPLATE}
+/*$ @tracks{DIR}{RE}{TEMPLATE}
  *
  * For each track below DIR, expands TEMPLATE with the
  * following expansions:
@@ -886,7 +900,7 @@ static int exp_tracks(int nargs,
   return exp__files_dirs(nargs, args, output, u, "track", disorder_files);
 }
 
-/*! @dirs{DIR}{RE}{TEMPLATE}
+/*$ @dirs{DIR}{RE}{TEMPLATE}
  *
  * For each directory below DIR, expands TEMPLATE with the
  * following expansions:
@@ -913,7 +927,7 @@ static int exp__search_shim(disorder_client *c, const char *terms,
   return disorder_search(c, terms, vecp, nvecp);
 }
 
-/*! @search{KEYWORDS}{TEMPLATE}
+/*$ @search{KEYWORDS}{TEMPLATE}
  *
  * For each track matching KEYWORDS, expands TEMPLATE with the
  * following expansions:
@@ -932,7 +946,7 @@ static int exp_search(int nargs,
   return exp__files_dirs(nargs, args, output, u, "track", exp__search_shim);
 }
 
-/*! @label{NAME}
+/*$ @label{NAME}
  *
  * Expands to label NAME from options.labels.  Undefined lables expand to the
  * last dot-separated component, e.g. X.Y.Z to Z.
@@ -944,7 +958,7 @@ static int exp_label(int attribute((unused)) nargs,
   return sink_writes(output, option_label(args[0])) < 0 ? -1 : 0;
 }
 
-/*! @breadcrumbs{DIR}{TEMPLATE}
+/*$ @breadcrumbs{DIR}{TEMPLATE}
  *
  * Expands TEMPLATE for each directory in the path up to DIR, excluding the root
  * but including DIR itself, with the following expansions:
@@ -1000,6 +1014,7 @@ void dcgi_expansions(void) {
   mx_register("label",  1, 1, exp_label);
   mx_register("length", 1, 1, exp_length);
   mx_register("movable", 1, 2, exp_movable);
+  mx_register("origin", 1, 1, exp_origin);
   mx_register("part", 2, 3, exp_part);
   mx_register("paused", 0, 0, exp_paused);
   mx_register("pref", 2, 2, exp_pref);
index 0e4a1d585e0e08b0326499d14a8577434e3989eb..05712c2a55f08caa7f700427d2e6a0953585ebc9 100644 (file)
@@ -2,22 +2,20 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-/** @file server/options.c
+/** @file cgi/options.c
  * @brief CGI options
  *
  * Options represent an additional configuration system private to the
index 0ff34777ad8f8aa74c06a5f55fcff88fe5a64b76..91d444887c95d3651ff67c45a4c852db9b2ed5d0 100644 (file)
@@ -2,20 +2,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2006-2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 bin_PROGRAMS=disorder disorderfm disorder-playrtp
@@ -77,6 +75,7 @@ check-completions: disorder
                | sort > ,completions
        diff -u ,commands ,completions
 
-CLEANFILES=,commands ,completions
+CLEANFILES=,commands ,completions \
+          *.gcda *.gcov *.gcno *.c.html index.html
 
 EXTRA_DIST=dump2wav
index fe908bcd88d170f4c30f895dc2ef490874a02b55..93fe3f46a23b0fa65421d8881ea605d07ea2fcb1 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file clients/authorize.c
+ * @brief Create a new login
  */
 
 #include "common.h"
index 5fb97318d2bd094ebbb357959db9dc53536adfbb..977e248d32d7a57e47fbf3dee464b3eb6474071f 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file clients/authorize.h
+ * @brief Create a new login
  */
 #ifndef AUTHORIZE_H
 #define AUTHORIZE_H
index b57a8de1f28f5ee2fee953577b1bc452bcf16cd7..4161d939cb141ef6e294a610f1a197d2267123b8 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file clients/disorder.c
+ * @brief Command-line client
  */
 
 #include "common.h"
@@ -100,8 +101,17 @@ static void cf_version(char attribute((unused)) **argv) {
 static void print_queue_entry(const struct queue_entry *q) {
   if(q->track) xprintf("track %s\n", nullcheck(utf82mb(q->track)));
   if(q->id) xprintf("  id %s\n", nullcheck(utf82mb(q->id)));
-  if(q->submitter) xprintf("  submitted by %s at %s",
-                          nullcheck(utf82mb(q->submitter)), ctime(&q->when));
+  switch(q->origin) {
+  case origin_adopted:
+  case origin_picked:
+  case origin_scheduled:
+    xprintf("  %s by %s at %s",
+            track_origins[q->origin],
+            nullcheck(utf82mb(q->submitter)), ctime(&q->when));
+    break;
+  default:
+    break;
+  }
   if(q->played) xprintf("  played at %s", ctime(&q->played));
   if(q->state == playing_started
      || q->state == playing_paused) xprintf("  %lds so far",  q->sofar);
@@ -588,6 +598,11 @@ static void cf_schedule_unset_global(char **argv) {
     exit(EXIT_FAILURE);
 }
 
+static void cf_adopt(char **argv) {
+  if(disorder_adopt(getclient(), argv[0]))
+    exit(EXIT_FAILURE);
+}
+
 static void cf_playlists(char attribute((unused)) **argv) {
   char **vec;
 
@@ -652,6 +667,8 @@ static const struct command {
 } commands[] = {
   { "adduser",        2, 3, cf_adduser, isarg_rights, "USERNAME PASSWORD [RIGHTS]",
                       "Create a new user" },
+  { "adopt",          1, 1, cf_adopt, 0, "ID",
+                      "Adopt a randomly picked track" },
   { "allfiles",       1, 2, cf_allfiles, isarg_regexp, "DIR [~REGEXP]",
                       "List all files and directories in DIR" },
   { "authorize",      1, 2, cf_authorize, isarg_rights, "USERNAME [RIGHTS]",
index b29330181e047ed3347f9085588d8274bc2ecf63..241b701b7f2e046c1dae102b7ff60972436a3b2b 100644 (file)
@@ -2,22 +2,25 @@
  * This file is part of DisOrder.
  * Copyright (C) 2006, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file clients/disorderfm.c
+ * @brief DisOrder file manager
+ *
+ * Intended to support encoding conversion, tag extraction, etc.  Not yet
+ * complete (and hasn't been worked on for ages).
  */
-
 #include "common.h"
 
 #include <getopt.h>
@@ -133,6 +136,7 @@ static int copy(const char *from, const char *to) {
   int fdin, fdout;
   char buffer[4096];
   int n;
+  struct stat sb;
 
   if((fdin = open(from, O_RDONLY)) < 0)
     fatal(errno, "error opening %s", from);
@@ -143,6 +147,12 @@ static int copy(const char *from, const char *to) {
       fatal(errno, "error writing to %s", to);
   }
   if(n < 0) fatal(errno, "error reading %s", from);
+  if(fstat(fdin, &sb) < 0)
+    fatal(errno, "error stating %s", from);
+  if(fchown(fdout, sb.st_uid, sb.st_gid) < 0)
+    fatal(errno, "error chowning %s", from);
+  if(fchmod(fdout, sb.st_mode & 07777) < 0)
+    fatal(errno, "error chmoding %s", from);
   if(close(fdout) < 0) fatal(errno, "error closing %s", to);
   xclose(fdin);
   return 0;
@@ -307,7 +317,20 @@ static void visit(const char *path, const char *destpath) {
   
     /* We create the directory on the destination side.  If it already exists,
      * that's fine. */
-    if(dirmaker(fulldestpath, 0777) < 0 && errno != EEXIST) {
+    if(dirmaker(fulldestpath, 0700) == 0) {
+      if(dirmaker != nomkdir) {
+        /* Created new directory.  Adjust permissions and ownership to match the
+         * old one. */
+        if(chown(fulldestpath, sb.st_uid, sb.st_gid) < 0) {
+          error(errno, "cannot chown %s", errdestpath);
+          ++errors;
+        }
+        if(chmod(fulldestpath, sb.st_mode & 07777) < 0) {
+          error(errno, "cannot chmod %s", errdestpath);
+          ++errors;
+        }
+      }
+    } else if(errno != EEXIST) {
       error(errno, "cannot mkdir %s", errdestpath);
       ++errors;
       return;
index 8bba942aa7b4b4684fbffffca4029f8653bec74d..13eea1965361570a2ac23097fd1505a1f529b7fc 100644 (file)
@@ -1,5 +1,6 @@
-/* Grotty program to print out the bytes making up filenames in some
- * directory */
+/** @file clients/filename-bytes.c
+ * @brief Print out raw bytes of filenames in a directory
+ */
 
 #include "common.h"
 
index a3995e9e4eddd07b9a28ae4ff48e655f82ff962c..a407b2f75e9bc54f2538804df1040c630ee0243b 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file clients/playrtp-alsa.c
  * @brief RTP player - ALSA support
index f490a0f28731ba244960ce310062b6138c942adb..809c89c316f08b77275622f45ca1d2aeace9a653 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file clients/playrtp-coreaudio.c
  * @brief RTP player - Core Audio support
index 2a868de87bd1d1874e868782582a23fc77e32835..ce45c9c953ed324920ad9d39f1d65def97536298 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file clients/playrtp-mem.c
  * @brief RTP player memory management
index 199487f6993efe800b9c063d3aea24556d4ceee9..4b0ab835d2811f9e68f817b4557eea512c7837e9 100644 (file)
@@ -3,20 +3,18 @@
  * Copyright (C) 2007 Richard Kettlewell
  * Portions copyright (C) 2007 Ross Younger
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file clients/playrtp-oss.c
  * @brief RTP player - OSS and empeg support
index cbc24aef4118c770762b8eb0379c026132cbc0be..aca1532f52f657da8248f1d3fdf7dcb6c757fff5 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file clients/playrtp.c
  * @brief RTP player
@@ -399,6 +397,9 @@ static void *listen_thread(void attribute((unused)) *arg) {
            timestamp, next_timestamp);
       continue;
     }
+    /* Ignore packets with the extension bit set. */
+    if(header.vpxcc & 0x10)
+      continue;
     p->next = 0;
     p->flags = 0;
     p->timestamp = timestamp;
index 565ca0b7d87bb5360c65a00c1cffc4ccc9dc983a..900ff50dc3f8e418d1a2127d9689129dc69a0b83 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file clients/playrtp.h
  * @brief RTP player
index 209e9c2bea38a9f6ed1886f29cb0f8dd59e464f5..1e465abf8a37e2a211b04ad19cffaa520212f8d9 100644 (file)
@@ -4,25 +4,23 @@
 # Copyright (C) 2004-2008 Richard Kettlewell
 # Portions copyright (C) 2007 Ross Younger
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-AC_INIT([disorder], [4.2], [richard+disorder@sfere.greenend.org.uk])
+AC_INIT([disorder], [4.3+], [richard+disorder@sfere.greenend.org.uk])
 AC_CONFIG_AUX_DIR([config.aux])
-AM_INIT_AUTOMAKE(disorder, [4.2])
+AM_INIT_AUTOMAKE(disorder, [4.3+])
 AC_CONFIG_SRCDIR([server/disorderd.c])
 AM_CONFIG_HEADER([config.h])
 
@@ -43,6 +41,7 @@ want_coreaudio=yes
 
 # Checks for programs.
 AC_PROG_CC
+AC_PROG_AWK
 AC_SET_MAKE
 if test "x$GCC" = xyes; then
   gcc_werror=-Werror
@@ -117,6 +116,11 @@ case "$host" in
   AC_MSG_RESULT([$minver])
   AC_DEFINE_UNQUOTED([MAC_OS_X_VERSION_MIN_REQUIRED], [$minver],
                      [define to minimum version of Mac OS X to support])
+
+  # Fink's GTK+ is hopelessly broken
+  PKG_CONFIG_PATH=${PKG_CONFIG_PATH:-/sw/lib/pango-ft219/lib/pkgconfig}
+  export PKG_CONFIG_PATH
+
   ;;
 *-freebsd* )
   AC_MSG_RESULT([FreeBSD])
@@ -164,6 +168,37 @@ if test -z "$browser"; then
 fi
 AC_DEFINE_UNQUOTED([BROWSER],["$browser"],[HTML viewer])
 
+# Figure out what version of sox is installed
+AC_CACHE_CHECK([sox version],[rjk_cv_soxver],[
+  rjk_cv_soxver=UNKNOWN
+  if sox --version > /dev/null 2>&1; then
+    rjk_cv_soxver=`sox --version|$AWK '{ if(match($0, /[[0-9\.]]+/)) print substr($0,RSTART,RLENGTH)}'`
+  else
+    rjk_cv_soxver=`sox -h 2>&1|$AWK '/Version/ { if(match($0, /[[0-9\.]]+/)) print substr($0,RSTART,RLENGTH)}'`
+  fi
+])
+
+# Decide what command line options to use
+#
+# sox version   endian     bits       deployed
+# 12.17.9       -x         -[bwld]    debian etch, ubuntu dapper
+# 14.0.0        -x/-[BL]   -[bwld]    ubuntu hardy
+# 14.0.1        -x/-[BL]   -[1248]    debian lenny
+# 14.2.0        -x/-[BL]   -[1248]    debian sid (at 2008-12)
+
+AC_CACHE_CHECK([default sox generation],[rjk_cv_soxgen],[
+  case $rjk_cv_soxver in
+  [[0-9]].* | 1[[0123]].* )
+    rjk_cv_soxgen=0
+    ;;
+  * )
+    rjk_cv_soxgen=1
+    ;;
+  esac
+])
+AC_DEFINE_UNQUOTED([DEFAULT_SOX_GENERATION],[$rjk_cv_soxgen],
+                   [default sox generation])
+
 AC_ARG_WITH([server],
            [AS_HELP_STRING([--without-server],
                            [do not build server])],
@@ -561,10 +596,27 @@ if test $want_server = yes; then
                      ],
                      [rjk_cv_db_version=ok],
                      [rjk_cv_db_version=inadequate])
+    if test $rjk_cv_db_version = ok; then
+      AC_PREPROC_IFELSE([
+                         #include <db.h>
+                         #if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == 6
+                         # error http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=510270
+                         #endif
+                        ],
+                        [rjk_cv_db_version=ok],
+                        [rjk_cv_db_version=toxic])
+    fi
   ])
-  if test $rjk_cv_db_version != ok; then
-    AC_MSG_ERROR([need db.h version at least 4.2])
-  fi
+  case $rjk_cv_db_version in
+  ok )
+    ;;
+  inadequate )
+    AC_MSG_ERROR([need db version at least 4.3 (but not 4.6)])
+    ;;
+  toxic )
+    AC_MSG_ERROR([db version 4.6.x does not work - see debian bug 510270])
+    ;;
+  esac
 fi
 
 AM_CONDITIONAL([SERVER], [test x$want_server = xyes])
index 8896a55fdea631ee131291aec73d338b74b5240d..b4af06d1df2e04dddcfc805f95b6c2898fa0be3b 100644 (file)
@@ -2,20 +2,18 @@
 # This file is part of DisOrder
 # Copyright (C) 2004-2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 noinst_SCRIPTS=rules
index 29fa83bd2b12e17820a3338fb1782009ec0cbd21..61e1fe7f08329ba7c8626561675d5d421f8c651e 100644 (file)
@@ -1,3 +1,9 @@
+disorder (4.3) unstable; urgency=low
+
+  * DisOrder 4.3
+
+ -- Richard Kettlewell <rjk@greenend.org.uk>  Sun, 15 Feb 2009 14:47:11 +0000
+
 disorder (4.2) unstable; urgency=low
 
   * DisOrder 4.2
index 9dc03be7e809cf9fb72521cee23f3be46b445976..71f3c82406eee4502b47be2a11b076495b1422b2 100755 (executable)
@@ -2,20 +2,18 @@
 #
 # Copyright (C) 2004-2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 set -e
index ead26aeba24407c3d240cc567bbb6d3163116572..f171349e88b06cec064b09461b061dce7459860a 100644 (file)
@@ -4,6 +4,8 @@ Section: sound
 Priority: optional
 Standards-Version: 3.7.2.2
 Build-Depends: libgc6-dev | libgc-dev, libgcrypt-dev, libdb4.3-dev, libpcre3-dev, libvorbis-dev, libmad0-dev, libasound2-dev, libao-dev, python, libflac-dev, libgtk2.0-dev
+Vcs-Bzr: http://www.greenend.org.uk/rjk/bzr/disorder.dev/
+Homepage: http://www.greenend.org.uk/rjk/disorder/
 
 Package: disorder
 Architecture: any
@@ -26,7 +28,7 @@ Package: disorder-server
 Architecture: any
 Section: sound
 Priority: extra
-Depends: disorder,httpd-cgi,sox,debconf,${shlibs:Depends},mail-transport-agent
+Depends: disorder,httpd-cgi,sox,debconf,${shlibs:Depends},exim4|mail-transport-agent,adduser
 Suggests: disorder-playrtp,disobedience
 Description: Play random or selected digital audio files continuously
  DisOrder is a software jukebox.  It can play OGG, MP3, WAV and FLAC files,
index 78f57333138e2cf2ac3fde5e77788944fe2a82d0..47a18e50ddf75a6940d949b2b5297aa265a6d09c 100644 (file)
@@ -14,9 +14,9 @@ Portions extracted from MPG321, http://mpg321.sourceforge.net/
 Binaries may derive extra copyright owners through linkage
 (binary distributors are expected to do their own legwork)
 
-This program is free software; you can redistribute it and/or modify
+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
+the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
@@ -25,8 +25,7 @@ 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
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 On Debian systems, look in /usr/share/common-licenses/GPL for a copy
 of the GPL.
index db2a49267aa5398e4da328532e64d06310445a46..4c06befaf6583ae55104d3afd49bb4df46c38511 100644 (file)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder
 # Copyright (C) 2007 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 set -e
index 458cc791c996fba490bf95ae979459b379f52ab5..cb5e60d009a4397e7463cc0acaf52eb884b1be17 100755 (executable)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder
 # Copyright (C) 2004, 2007, 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 set -e
@@ -36,7 +34,7 @@ configure_init_d() {
 }
 
 restart_server() {
-  /etc/init.d/disorder restart
+  invoke-rc.d disorder restart
   # Wait for the server to get going.  This is a horrid bodge and ought
   # to be done away with, but is required for the time being.  Sorry.
   sleep 5
@@ -168,10 +166,10 @@ reconfigure )
   create_config
   ;;
 abort-upgrade )
-  /etc/init.d/disorder restart
+  invoke-rc.d disorder restart
   ;;
 reconfigure )
-  /etc/init.d/disorder reload
+  invoke-rc.d disorder reload
   ;;
 esac
 
diff --git a/debian/postrm.disobedience b/debian/postrm.disobedience
new file mode 100755 (executable)
index 0000000..85f80a4
--- /dev/null
@@ -0,0 +1,28 @@
+#! /bin/sh
+#
+# This file is part of DisOrder
+# Copyright (C) 2007 Richard Kettlewell
+#
+# 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 3 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, see <http://www.gnu.org/licenses/>.
+#
+
+set -e
+
+case "$1" in
+remove )
+  if type update-menus >/dev/null 2>&1; then
+    update-menus
+  fi
+  ;;
+esac
index 99488dd617b8dbf77dd49669550ae619f0656854..7ba0933d4f4aef6efc8bfc54582b0240bc4159bb 100755 (executable)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder
 # Copyright (C) 2004, 2007, 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 set -e
 
index 394afcdb5367f90d467a6397eda2a67d3a85af9e..93b7e237ae946ef0206b485fad66c10bec1fba63 100755 (executable)
@@ -3,25 +3,23 @@
 # This file is part of DisOrder
 # Copyright (C) 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
-set -
+set -e
 case "$1" in
 upgrade )
-  /etc/init.d/disorder stop
+  invoke-rc.d disorder stop
   ;;
 failed-upgrade )
   # Upgrading from 2.0 to 3.0.x can provoke this problem.  The 2.0
index 0c14444f4670b20317517f82eecf223848a2f589..5c53f50bc27ae6044fcde3ffd47ffd3fc5d87e14 100755 (executable)
@@ -2,20 +2,18 @@
 #
 # Copyright (C) 2004-2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 cgiexecdir=/usr/lib/cgi-bin
@@ -45,6 +43,12 @@ ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
 INSTALL_PROGRAM += -s
 endif
 
+# Set DEB_BUILD_OPTIONS=parallel=N to do make -jN
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+PARALLEL = -j$(NUMJOBS)
+endif
+
 export INSTALL_DATA
 export INSTALL_SCRIPT
 export INSTALL_PROGRAM
@@ -70,7 +74,7 @@ build:
          echo ./config.status;\
          ./config.status;\
        fi
-       $(MAKE) SENDMAIL=${SENDMAIL}
+       $(MAKE) SENDMAIL=${SENDMAIL} ${PARALLEL}
 
 pkg-disorder: build
        rm -rf debian/disorder
@@ -83,7 +87,13 @@ pkg-disorder: build
        $(INSTALL_DATA) debian/changelog \
                debian/disorder/usr/share/doc/disorder/changelog.Debian
        gzip -9 debian/disorder/usr/share/doc/disorder/changelog.Debian
-       @for f in preinst postinst prerm postrm conffiles templates config; do\
+       @for f in conffiles templates; do\
+         if test -e debian/$$f.disorder; then\
+           echo $(INSTALL_DATA) debian/$$f.disorder debian/disorder/DEBIAN/$$f; \
+           $(INSTALL_DATA) debian/$$f.disorder debian/disorder/DEBIAN/$$f; \
+         fi;\
+       done
+       @for f in preinst postinst prerm postrm config; do\
          if test -e debian/$$f.disorder; then\
            echo $(INSTALL_SCRIPT) debian/$$f.disorder debian/disorder/DEBIAN/$$f; \
            $(INSTALL_SCRIPT) debian/$$f.disorder debian/disorder/DEBIAN/$$f; \
@@ -130,12 +140,18 @@ pkg-disorder-server: build
        $(INSTALL_DATA) debian/changelog \
                debian/disorder-server/usr/share/doc/disorder-server/changelog.Debian
        gzip -9 debian/disorder-server/usr/share/doc/disorder-server/changelog.Debian
-       @for f in preinst postinst prerm postrm conffiles templates config; do\
+       @for f in preinst postinst prerm postrm config; do\
          if test -e debian/$$f.disorder-server; then\
            echo $(INSTALL_SCRIPT) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \
            $(INSTALL_SCRIPT) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \
          fi;\
        done
+       @for f in conffiles templates; do\
+         if test -e debian/$$f.disorder-server; then\
+           echo $(INSTALL_DATA) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \
+           $(INSTALL_DATA) debian/$$f.disorder-server debian/disorder-server/DEBIAN/$$f; \
+         fi;\
+       done
        $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C images
        $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C server
        $(MAKE) DESTDIR=`pwd`/debian/disorder-server installdirs install -C templates
@@ -146,7 +162,20 @@ pkg-disorder-server: build
        rm -rf debian/disorder-server/usr/share/man/man1
        rm -rf debian/disorder-server/usr/share/man/man3
        rm -f debian/disorder-server/usr/share/man/man5/disorder_config.5
+       rm -f debian/disorder-server/usr/share/man/man5/disorder_preferences.5
        rm -f debian/disorder-server/usr/share/man/man5/disorder_protocol.5
+       find debian/disorder-server -name '*.la' -print0 | xargs -r0 rm -f
+       find debian/disorder-server -name '*.so.0' -print0 | xargs -r0 rm -f
+       @for f in debian/disorder-server/usr/lib/disorder/*.so.0.0.0; do \
+         echo mv $$f $${f/.0.0.0};\
+         mv $$f $${f/.0.0.0};\
+       done
+       @for f in debian/disorder-server/usr/lib/ao/plugins*/*.so.0.0.0; do \
+         echo mv $$f $${f/.0.0.0};\
+         mv $$f $${f/.0.0.0};\
+       done
+       find debian/disorder-server -name '*.so' -print0 | xargs -r0 strip --strip-unneeded
+       find debian/disorder-server -name '*.so' -print0 | xargs -r0 chmod -x
        $(MKDIR) debian/disorder-server/etc/disorder
        $(MKDIR) debian/disorder-server/etc/init.d
        $(MKDIR) debian/disorder-server${cgiexecdir}
@@ -161,10 +190,11 @@ pkg-disorder-server: build
                debian/disorder-server/etc/disorder/options.user
        $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) cgi/disorder \
                $(shell pwd)/debian/disorder-server${cgiexecdir}/disorder
+       gzip -9f debian/disorder-server/usr/share/man/man*/*
        dpkg-shlibdeps -Tdebian/substvars.disorder-server \
                debian/disorder-server${cgiexecdir}/disorder \
                debian/disorder-server/usr/sbin/* \
-               debian/disorder-server/usr/lib/disorder/*.so*
+               debian/disorder-server/usr/lib/disorder/*.so
        rm -rf debian/disorder-server/usr/share/doc/disorder-server
        ln -s disorder debian/disorder-server/usr/share/doc/disorder-server
        dpkg-gencontrol -isp -pdisorder-server -Pdebian/disorder-server -Tdebian/substvars.disorder-server
@@ -233,6 +263,7 @@ pkg-disobedience: build
                        debian/disobedience/usr/share/pixmaps
        $(INSTALL_DATA) debian/usr.share.menu.disobedience \
                debian/disobedience/usr/share/menu/disobedience
+       gzip -9f debian/disobedience/usr/share/man/man*/*
        dpkg-shlibdeps -Tdebian/substvars.disobedience \
                debian/disobedience/usr/bin/*
        rm -rf debian/disobedience/usr/share/doc/disobedience
@@ -265,7 +296,7 @@ binary-arch: pkg-disorder pkg-disorder-server pkg-disorder-playrtp \
 binary-indep: 
 
 clean:
-       -$(MAKE) distclean
+       test -f Makefile && $(MAKE) distclean
        rm -f config.cache
        rm -f debian/files
        rm -f debian/substvars.*
index f62e4043c5481a9629c713e96fff890d2acd31f7..a0888bdbfb71a187a50d517b2da9c1c32d34a547 100644 (file)
@@ -1,20 +1,20 @@
 Template: disorder/roots
 Type: string
 Default:
-Description: Audio directories
+Description: Audio directories:
  Enter the list of directories that contain audio files (e.g. MP3 or OGG
  files) separated by spaces.
 
 Template: disorder/encoding
 Type: string
-Description: Filesystem encoding
+Description: Filesystem encoding:
  Enter your filesystem's character encoding.  Check rather than
  guessing if you are not sure.
 
 Template: disorder/scratches
 Type: string
 Default: /usr/share/disorder/slap.ogg /usr/share/disorder/scratch.ogg
-Description: Scratch files
+Description: Scratch files:
  Enter a list of files to be played when a track is scratched, separated
  by spaces.  Leave this blank if you don't want any scratch sounds.
  All filenames should be absolute path names.
@@ -22,7 +22,7 @@ Description: Scratch files
 Template: disorder/port
 Type: string
 Default: none
-Description: Port number for clients to connect to
+Description: Port number for clients to connect to:
  Enter the port number that the server should listen on for clients.  This
  can be set to 'none' to permit only local clients or a port number for
  remote clients to connect to, e.g. using Disobedience.
@@ -31,7 +31,7 @@ Template: disorder/interface
 Type: select
 Choices: local, network
 Default: local
-Description: Interface to use to play sound
+Description: Interface to use to play sound:
  'local' means the default local sound device will be used.  Use this
  if you want to play through your sound card and don't want to play on any
  other computers.
@@ -42,20 +42,20 @@ Description: Interface to use to play sound
 
 Template: disorder/mcast_address
 Type: string
-Description: Destination address for network sound transmission
+Description: Destination address for network sound transmission:
  Sound data will be sent to this address using the RTP protocol.  Users
  would use (for instance) disorder-playrtp to play it.  Typically this
  would be a multicast address but this is not mandatory.
 
 Template: disorder/mcast_port
 Type: string
-Description: Destination port for network sound transmission
+Description: Destination port for network sound transmission:
  Sound data will be sent to this UDP port using the RTP protocol.
 
 Template: disorder/mail_sender
 Type: string
 Default: 
-Description: Sender address for email from web interface
+Description: Sender address for email from web interface:
  The web interface needs to know what email address it should send messages
  from.  It is possible that users will reply to this address if they are
  unsure what to do.
index 1373b95d9cd528414f607ac11dc0f8ad306e80fd..d60b8c02bb83523e19c9618de3a8cfeb32d0dccd 100644 (file)
@@ -1,6 +1,6 @@
 ?package(disobedience):\
        needs="x11" \
-       section="Apps/Sound" \
+       section="Applications/Sound" \
        title="Disobedience" \
         icon16x16="/usr/share/pixmaps/disobedience16x16.xpm" \
         icon32x32="/usr/share/pixmaps/disobedience32x32.xpm" \
index db74563d23d455b60e48fc2e808391fa080f3fa5..94a4c786e9b146d5a18d117dc200ec4a4bdf00f3 100644 (file)
@@ -2,20 +2,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2006-2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 bin_PROGRAMS=disobedience
@@ -29,7 +27,8 @@ disobedience_SOURCES=disobedience.h disobedience.c client.c queue.c   \
        recent.c added.c queue-generic.c queue-generic.h queue-menu.c   \
        choose.c choose-menu.c choose-search.c popup.c misc.c           \
        control.c properties.c menu.c log.c progress.c login.c rtp.c    \
-       help.c ../lib/memgc.c settings.c users.c lookup.c playlists.c
+       help.c ../lib/memgc.c settings.c users.c lookup.c choose.h      \
+       popup.h playlists.c
 disobedience_LDADD=../lib/libdisorder.a $(LIBPCRE) $(LIBGC) $(LIBGCRYPT) \
        $(LIBASOUND) $(COREAUDIO) $(LIBDB)
 disobedience_LDFLAGS=$(GTK_LIBS)
@@ -67,6 +66,7 @@ check-help: all
        unset DISPLAY;./disobedience --version > /dev/null
        unset DISPLAY;./disobedience --help > /dev/null
 
-CLEANFILES=disobedience.html images.h
+CLEANFILES=disobedience.html images.h \
+          *.gcda *.gcov *.gcno *.c.html index.html
 
 export GNUSED
index ce747c49a9a016a2426fb95dd0862a6d24f6be90..32628ac93c16245907296bb7fdd55f5aa2a4387e 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2006-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file disobedience/added.c
+ * @brief List of recently added tracks
  */
 #include "disobedience.h"
 #include "popup.h"
index cc1d1a3660095bcd828a9df5e4fd57d2842c5c34..f1aa3b02c18323a5ed93fbcf8f21cd4dc44594f3 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file disobedience/choose-menu.c
+ * @brief Popup menu for choose screen
  */
 #include "disobedience.h"
 #include "popup.h"
 /** @brief Popup menu */
 static GtkWidget *choose_menu;
 
-/** @brief Recursion step for choose_get_visible()
- * @param parent A visible node, or NULL for the root
- * @param callback Called for each visible node
- * @param userdata Passed to @p callback
- *
- * If @p callback returns nonzero, the walk stops immediately.
- */
-static int choose_visible_recurse(GtkTreeIter *parent,
-                                  int (*callback)(GtkTreeIter *it,
-                                                  int isfile,
-                                                  void *userdata),
-                                  void *userdata) {
-  int expanded;
-  if(parent) {
-    /* Skip placeholders */
-    if(choose_is_placeholder(parent))
-      return 0;
-    const int isfile = choose_is_file(parent);
-    if(callback(parent, isfile, userdata))
-      return 1;
-    if(isfile)
-      return 0;                 /* Files never have children */
-    GtkTreePath *parent_path
-      = gtk_tree_model_get_path(GTK_TREE_MODEL(choose_store),
-                                parent);
-    expanded = gtk_tree_view_row_expanded(GTK_TREE_VIEW(choose_view),
-                                          parent_path);
-    gtk_tree_path_free(parent_path);
-  } else
-    expanded = 1;
-  /* See if parent is expanded */
-  if(expanded) {
-    /* Parent is expanded, visit all its children */
-    GtkTreeIter it[1];
-    gboolean itv = gtk_tree_model_iter_children(GTK_TREE_MODEL(choose_store),
-                                                it,
-                                                parent);
-    while(itv) {
-      if(choose_visible_recurse(it, callback, userdata))
-        return TRUE;
-      itv = gtk_tree_model_iter_next(GTK_TREE_MODEL(choose_store), it);
-    }
-  }
-  return 0;
-}
-
-static void choose_visible_visit(int (*callback)(GtkTreeIter *it,
-                                                 int isfile,
-                                                 void *userdata),
-                                 void *userdata) {
-  choose_visible_recurse(NULL, callback, userdata);
-}
+/** @brief Path to directory pending a "select children" operation */
+static GtkTreePath *choose_eventually_select_children;
 
-static int choose_selectall_sensitive_callback
-   (GtkTreeIter attribute((unused)) *it,
-     int isfile,
-     void *userdata) {
-  if(isfile) {
-    *(int *)userdata = 1;
-    return 1;
-  }
-  return 0;
-}
-
-/** @brief Should 'select all' be sensitive?
- *
- * Yes if there are visible files.
- */
+/** @brief Should edit->select all be sensitive?  No, for the choose tab. */
 static int choose_selectall_sensitive(void attribute((unused)) *extra) {
-  int files = 0;
-  choose_visible_visit(choose_selectall_sensitive_callback, &files);
-  return files > 0;
-}
-
-static int choose_selectall_activate_callback
-    (GtkTreeIter *it,
-     int isfile,
-     void attribute((unused)) *userdata) {
-  if(isfile)
-    gtk_tree_selection_select_iter(choose_selection, it);
-  else
-    gtk_tree_selection_unselect_iter(choose_selection, it);
-  return 0;
+  return FALSE;
 }
 
-/** @brief Activate select all
- *
- * Selects all files and deselects everything else.
- */
+/** @brief Activate edit->select all (which should do nothing) */
 static void choose_selectall_activate(GtkMenuItem attribute((unused)) *item,
                                       gpointer attribute((unused)) userdata) {
-  choose_visible_visit(choose_selectall_activate_callback, 0);
 }
 
 /** @brief Should 'select none' be sensitive
@@ -168,6 +88,16 @@ static void choose_gather_selected_files_callback(GtkTreeModel attribute((unused
     vector_append(v, choose_get_track(iter));
 }
 
+static void choose_gather_selected_dirs_callback(GtkTreeModel attribute((unused)) *model,
+                                                 GtkTreePath attribute((unused)) *path,
+                                                 GtkTreeIter *iter,
+                                                 gpointer data) {
+  struct vector *v = data;
+
+  if(choose_is_dir(iter))
+    vector_append(v, choose_get_track(iter));
+}
+
   
 static void choose_play_activate(GtkMenuItem attribute((unused)) *item,
                                  gpointer attribute((unused)) userdata) {
@@ -194,6 +124,92 @@ static void choose_properties_activate(GtkMenuItem attribute((unused)) *item,
   properties(v->nvec, (const char **)v->vec);
 }
 
+/** @brief Set sensitivity for select children
+ *
+ * Sensitive if we've selected exactly one directory.
+ */
+static int choose_selectchildren_sensitive(void attribute((unused)) *extra) {
+  struct vector v[1];
+  /* Only one thing should be selected */
+  if(gtk_tree_selection_count_selected_rows(choose_selection) != 1)
+    return FALSE;
+  /* The selected thing should be a directory */
+  vector_init(v);
+  gtk_tree_selection_selected_foreach(choose_selection,
+                                      choose_gather_selected_dirs_callback,
+                                      v);
+  return v->nvec == 1;
+}
+
+/** @brief Actually select the children of path
+ *
+ * We deselect everything else, too.
+ */
+static void choose_select_children(GtkTreePath *path) {
+  GtkTreeIter iter[1], child[1];
+  
+  if(gtk_tree_model_get_iter(GTK_TREE_MODEL(choose_store), iter, path)) {
+    gtk_tree_selection_unselect_all(choose_selection);
+    for(int n = 0;
+        gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(choose_store), child,
+                                      iter, n);
+        ++n) {
+      if(choose_is_file(child))
+        gtk_tree_selection_select_iter(choose_selection, child);
+    }
+  }
+}
+
+/** @brief Called to expand the children of path/iter */
+static void choose_selectchildren_callback(GtkTreeModel attribute((unused)) *model,
+                                           GtkTreePath *path,
+                                           GtkTreeIter attribute((unused)) *iter,
+                                           gpointer attribute((unused)) data) {
+  if(gtk_tree_view_row_expanded(GTK_TREE_VIEW(choose_view), path)) {
+    /* Directory is already expanded */
+    choose_select_children(path);
+  } else {
+    /* Directory is not expanded, so expand it */
+    gtk_tree_view_expand_row(GTK_TREE_VIEW(choose_view), path, FALSE/*!expand_all*/);
+    /* Select its children when it's done */
+    if(choose_eventually_select_children)
+      gtk_tree_path_free(choose_eventually_select_children);
+    choose_eventually_select_children = gtk_tree_path_copy(path);
+  }
+}
+
+/** @brief Called when all pending track fetches are finished
+ *
+ * If there's a pending select-children operation, it can now be actioned
+ * (or might have gone stale).
+ */
+void choose_menu_moretracks(const char attribute((unused)) *event,
+                            void attribute((unused)) *eventdata,
+                            void attribute((unused)) *callbackdata) {
+  if(choose_eventually_select_children) {
+    choose_select_children(choose_eventually_select_children);
+    gtk_tree_path_free(choose_eventually_select_children);
+    choose_eventually_select_children = 0;
+  }
+}
+
+/** @brief Select all children
+ *
+ * Easy enough if the directory is already expanded, we can just select its
+ * children.  However if it is not then we must expand it and _when this has
+ * completed_ select its children.
+ *
+ * The way this is implented could cope with multiple directories but
+ * choose_selectchildren_sensitive() should stop this.
+ */
+static void choose_selectchildren_activate
+    (GtkMenuItem attribute((unused)) *item,
+     gpointer attribute((unused)) userdata) {
+  gtk_tree_selection_selected_foreach(choose_selection,
+                                      choose_selectchildren_callback,
+                                      0);
+}
+
 /** @brief Pop-up menu for choose */
 static struct menuitem choose_menuitems[] = {
   {
@@ -211,9 +227,9 @@ static struct menuitem choose_menuitems[] = {
     0
   },
   {
-    "Select all tracks",
-    choose_selectall_activate,
-    choose_selectall_sensitive,
+    "Select children",
+    choose_selectchildren_activate,
+    choose_selectchildren_sensitive,
     0,
     0
   },
index 8637687faeb96be8645b5057d9fd6c1a859b0691..1208f174f6996c4fcf2b5c6ee6dc0bdb41153786 100644 (file)
@@ -2,23 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-/** @file disobedience/search.c
- * @brief Search support
+/** @file disobedience/choose-search.c
+ * @brief Search support for Disobedience choose window
  */
 #include "disobedience.h"
 #include "choose.h"
index 4cb6f7c500e62c87e677b2f614692f4904094c15..b9a9e7e647b71698872505752034e6f12692e4c3 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file disobedience/choose.c
  * @brief Hierarchical track selection and search
@@ -105,7 +103,7 @@ int choose_can_autocollapse(GtkTreeIter *iter) {
 }
 
 /** @brief Remove node @p it and all its children
- * @param Iterator, updated to point to next
+ * @param it Iterator, updated to point to next
  * @return True if iterator remains valid
  *
  * TODO is this necessary?  gtk_tree_store_remove() does not document what
@@ -165,12 +163,12 @@ static void choose_set_state(const char attribute((unused)) *event,
  * @param parent_ref Node to populate or NULL to fill root
  * @param nvec Number of children to add
  * @param vec Children
- * @param files 1 if children are files, 0 if directories
+ * @param isfile 1 if children are files, 0 if directories
  *
  * Adjusts the set of files (or directories) below @p parent_ref to match those
  * listed in @p nvec and @p vec.
  *
- * @parent_ref will be destroyed.
+ * @p parent_ref will be destroyed.
  */
 static void choose_populate(GtkTreeRowReference *parent_ref,
                             int nvec, char **vec,
@@ -621,6 +619,7 @@ GtkWidget *choose_widget(void) {
   event_register("playing-track-changed", choose_set_state, 0);
   event_register("search-results-changed", choose_set_state, 0);
   event_register("lookups-completed", choose_set_state, 0);
+  event_register("choose-more-tracks", choose_menu_moretracks, 0);
 
   /* After a rescan we update the choose tree.  We get a rescan-complete
    * automatically at startup and upon connection too. */
index c101e6bcf303aaeacddda06ff53bca691eee7897..521333211ec45ee328cfcd9c409bf84749cd68b1 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file disobedience/choose.h
+ * @brief Choose window for Disobedience
  */
 #ifndef CHOOSE_H
 #define CHOOSE_H
@@ -78,6 +79,9 @@ void choose_next_clicked(GtkButton *button,
 void choose_prev_clicked(GtkButton *button,
                          gpointer userdata);
 void choose_search_new(void);
+void choose_menu_moretracks(const char *event,
+                            void *eventdata,
+                            void *callbackdata);
 
 #endif /* CHOOSE_H */
 
index 80aef8864365856cdda3293dec33b1254c455f3a..dd40597fcc3962874b9166206629ddca90508119 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2006, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file disobedience/client.c
  * @brief GLIB integration for @ref lib/eclient.c client
index 6ed9fb3564db522c00afc5e0e5f3ceb00df196e3..c51205966057c1aae229cdedd6a3abd4d0bb45a7 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2006-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file disobedience/control.c
  * @brief Volume control and buttons
@@ -169,9 +167,9 @@ static int rtp_sensitive(void) {
 /** @brief Table of all icons */
 static struct icon icons[] = {
   {
-    icon_on: "pause.png",
+    icon_on: "pause32.png",
     tip_on: "Pause playing track",
-    icon_off: "play.png",
+    icon_off: "play32.png",
     tip_off: "Resume playing track",
     menuitem: "<GdisorderMain>/Control/Playing",
     on: pause_resume_on,
@@ -181,7 +179,7 @@ static struct icon icons[] = {
     events: "pause-changed playing-changed rights-changed",
   },
   {
-    icon_on: "cross.png",
+    icon_on: "cross32.png",
     tip_on: "Cancel playing track",
     menuitem: "<GdisorderMain>/Control/Scratch",
     sensitive: scratch_sensitive,
@@ -189,9 +187,9 @@ static struct icon icons[] = {
     events: "playing-track-changed rights-changed",
   },
   {
-    icon_on: "randomcross.png",
+    icon_on: "randomenabled32.png",
     tip_on: "Disable random play",
-    icon_off: "random.png",
+    icon_off: "randomdisabled32.png",
     tip_off: "Enable random play",
     menuitem: "<GdisorderMain>/Control/Random play",
     on: random_enabled,
@@ -201,9 +199,9 @@ static struct icon icons[] = {
     events: "random-changed rights-changed",
   },
   {
-    icon_on: "notescross.png",
+    icon_on: "playenabled32.png",
     tip_on: "Disable play",
-    icon_off: "notes.png",
+    icon_off: "playdisabled32.png",
     tip_off: "Enable play",
     on: playing_enabled,
     sensitive: playing_sensitive,
@@ -212,9 +210,9 @@ static struct icon icons[] = {
     events: "enabled-changed rights-changed",
   },
   {
-    icon_on: "speakercross.png",
+    icon_on: "rtpenabled32.png",
     tip_on: "Stop playing network stream",
-    icon_off: "speaker.png",
+    icon_off: "rtpdisabled32.png",
     tip_off: "Play network stream",
     menuitem: "<GdisorderMain>/Control/Network player",
     on: rtp_enabled,
index dd052adaf0e56364ef1295ce32d06442d38a5472..1f9ee43d3d6e4d9a81cfac76ad4f64e2dac5efba 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2006, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file disobedience/disobedience.c
  * @brief Main Disobedience program
index 547cfc8113832760207a615ec334b5836f387356..46877245e29cfbbb03703d601a885a8ac9fbd82b 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2006-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file disobedience/disobedience.h
  * @brief Header file for Disobedience, the DisOrder GTK+ client
index a1829408d749b01ec1a33d31fc9d4a5c1c185c2c..94086545af95b829d12ab08e34240a83950fbbdb 100644 (file)
@@ -1,22 +1,19 @@
-
 /*
  * This file is part of DisOrder
  * Copyright (C) 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file disobedience/help.c
  * @brief Help support
index 9a94e0630cfe3ef9fa13f8dbc177ad8faf681c21..f1c4f79d814597863d0a717425a484871c0b2789 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2006, 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file disobedience/log.c
  * @brief State monitoring
@@ -43,6 +41,7 @@ static void log_state(void *v, unsigned long state);
 static void log_volume(void *v, int l, int r);
 static void log_rescanned(void *v);
 static void log_rights_changed(void *v, rights_type r);
+static void log_adopted(void *v, const char *id, const char *user);
 static void log_playlist_created(void *v,
                                  const char *playlist, const char *sharing);
 static void log_playlist_modified(void *v,
@@ -66,6 +65,7 @@ const disorder_eclient_log_callbacks log_callbacks = {
   .volume = log_volume,
   .rescanned = log_rescanned,
   .rights_changed = log_rights_changed,
+  .adopted = log_adopted,
   .playlist_created = log_playlist_created,
   .playlist_modified = log_playlist_modified,
   .playlist_deleted = log_playlist_deleted,
@@ -213,6 +213,13 @@ static void log_rights_changed(void attribute((unused)) *v,
   --suppress_actions;
 }
 
+/** @brief Called when a track is adopted */
+static void log_adopted(void attribute((unused)) *v,
+                        const char attribute((unused)) *id,
+                        const char attribute((unused)) *who) {
+  event_raise("queue-changed", 0);
+}
+
 static void log_playlist_created(void attribute((unused)) *v,
                                  const char *playlist,
                                  const char attribute((unused)) *sharing) {
index 9dbbeac21752a8e6df4016ebd7d9ec8f0191b4bb..1c6df79c57107c834dd9bc21fd74ff136e5f23e9 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file disobedience/login.c
  * @brief Login box for Disobedience
index 9b6a5b55fcad5c5c58738d48b83d2b63af853c84..68939aef2915f015b925c5699e196a70017ef18c 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file disobedience/lookup.c
+ * @brief Disobedience server lookups and caching
  */
 #include "disobedience.h"
 
@@ -81,7 +82,6 @@ static void namepart_fill(const char *track,
  * @param track Track name
  * @param context Context
  * @param part Name part
- * @param lookup If nonzero, will schedule a lookup for unknown values
  *
  * If it is in the cache then just return its value.  If not then look it up
  * and arrange for the queues to be updated when its value is available. */
index b8ba4399a1272cfc5a71247a6f0f143267059ef8..1d50223d3dfff0c9192a06c800552c480da1eada 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2006-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file disobedience/menu.c
  * @brief Main menu
index 8c4ed095a61f2b4a8f4568bb8c82e1032d484fc2..c807a27082821bc7d9aba1a4d4c390d8e013f62e 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2006-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file disobedience/misc.c
  * @brief Miscellaneous GTK+ interfacing stuff
index 4e099371b2767ca48109609d843a4ead0149af40..6613cfc4fb7f0691e71621cafb8b03458ec37093 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file disobedience/popup.c
+ * @brief Disobedience popup menus
  */
 #include "disobedience.h"
 #include "popup.h"
@@ -57,7 +58,7 @@ void popup(GtkWidget **menup,
 }
 
 /** @brief Make sure the right thing is selected
- * @param widget Tree view
+ * @param treeview Tree view
  * @param event Mouse event
  */
 void ensure_selected(GtkTreeView *treeview,
index 165f69b8732844362da4ff98ce25094286d1bf25..9706e0398b2de45bbe2db7b5dabf1fa0298ed148 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file disobedience/popup.h
+ * @brief Disobedience popup menus
  */
 #ifndef POPUP_H
 #define POPUP_H
index 4eb5b5541c8625bf7a369c62478379b2faaf5982..2e31603f7b563d2c69893a9f5e03b689b70ff680 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2006, 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file disobedience/progress.c
  * @brief Progress bar support
index 7c1c816aaaa70580950995cade0f8f976d98f4d4..62ea22f5bae6013908e98c9360c75a2176c539d5 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2006-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file disobedience/properties.c
  * @brief Track properties editor
index daf5a6b963ee8ff90575a0e5358f11967d1dbb40..60ff7944dffc9481cc506d78b7212aecf5210c5e 100644 (file)
@@ -2,23 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2006-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file disobedience/queue-generic.c
- * @brief Queue widgets
+ * @brief Disobedience queue widgets
  *
  * This file provides contains code shared between all the queue-like
  * widgets - the queue, the recent list and the added tracks list.
@@ -129,6 +127,8 @@ const char *column_length(const struct queue_entry *q,
     if(last_state & DISORDER_TRACK_PAUSED)
       l = playing_track->sofar;
     else {
+      if(!last_playing)
+        return NULL;
       time(&now);
       l = playing_track->sofar + (now - last_playing);
     }
@@ -178,11 +178,14 @@ void ql_update_row(struct queue_entry *q,
     iter = my_iter;
   }
   /* Update all the columns */
-  for(int col = 0; col < ql->ncolumns; ++col)
-    gtk_list_store_set(ql->store, iter,
-                       col, ql->columns[col].value(q,
-                                                   ql->columns[col].data),
-                       -1);
+  for(int col = 0; col < ql->ncolumns; ++col) {
+    const char *const v = ql->columns[col].value(q,
+                                                 ql->columns[col].data);
+    if(v)
+      gtk_list_store_set(ql->store, iter,
+                         col, v,
+                         -1);
+  }
   gtk_list_store_set(ql->store, iter,
                      ql->ncolumns + QUEUEPOINTER_COLUMN, q,
                      -1);
index 2bf33e7583020c258ed4304834e326e3d80cb4c3..8dd9fdb3dc81ecddcdbc70dcfc5eb35157892b3b 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2006-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file disobedience/queue-generic.h
+ * @brief Disobedience queue widgets
  */
 #ifndef QUEUE_GENERIC_H
 #define QUEUE_GENERIC_H
@@ -145,6 +146,9 @@ void ql_remove_activate(GtkMenuItem *menuitem,
 int ql_play_sensitive(void *extra);
 void ql_play_activate(GtkMenuItem *menuitem,
                       gpointer user_data);
+int ql_adopt_sensitive(void *extra);
+void ql_adopt_activate(GtkMenuItem *menuitem,
+                       gpointer user_data);
 gboolean ql_button_release(GtkWidget *widget,
                            GdkEventButton *event,
                            gpointer user_data);
index 5775ee342d7b68704c1c0c7479e08e9f1d59cdb4..beb40f5b550ec42e0fb1d2e03af332ebe96cbdfc 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2006-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file disobedience/queue-menu.c
+ * @brief Disobedience queue widget popup menu
  */
 #include "disobedience.h"
 #include "popup.h"
@@ -186,6 +187,64 @@ gboolean ql_button_release(GtkWidget *widget,
   return FALSE;
 }
 
+/* Adopt */
+
+static void ql_adopt_sensitive_callback(GtkTreeModel *model,
+                                        GtkTreePath attribute((unused)) *path,
+                                        GtkTreeIter *iter,
+                                        gpointer data) {
+  struct queue_entry *const q = ql_iter_to_q(model, iter);
+  int *const count = data;
+
+  if(*count < 0)
+    return;
+  if(q->origin == origin_random)
+    ++*count;
+  else
+    *count = -1;
+}
+
+/** @brief Determine whether we're pointing at an adoptable track */
+int ql_adopt_sensitive(void *extra) {
+  struct queuelike *ql = extra;
+  int count = 0;
+
+  /* We'll need RIGHT_PLAY */
+  if(!(last_rights & RIGHT_PLAY))
+    return FALSE;
+  /* Check that (1) only random tracks are selected (2) at least something is
+   * selected */
+  gtk_tree_selection_selected_foreach(ql->selection,
+                                      ql_adopt_sensitive_callback,
+                                      &count);
+  if(count <= 0)
+    return FALSE;
+  return TRUE;
+}
+
+static void ql_adopt_completed(void attribute((unused)) *v, const char *err) {
+  if(err)
+    popup_protocol_error(0, err);
+}
+
+static void ql_adopt_activate_callback(GtkTreeModel *model,
+                                       GtkTreePath attribute((unused)) *path,
+                                       GtkTreeIter *iter,
+                                       gpointer attribute((unused)) data) {
+  struct queue_entry *const q = ql_iter_to_q(model, iter);
+
+  disorder_eclient_adopt(client, ql_adopt_completed, q->id, q);
+}
+
+/** @brief Called to adopt a track */
+void ql_adopt_activate(GtkMenuItem attribute((unused)) *menuitem,
+                       gpointer user_data) {
+  struct queuelike *ql = user_data;
+  gtk_tree_selection_selected_foreach(ql->selection,
+                                      ql_adopt_activate_callback,
+                                      NULL);
+}
+
 struct tabtype *ql_tabtype(struct queuelike *ql) {
   static const struct tabtype queuelike_tabtype = {
     ql_properties_sensitive,
index c35b90b7887ca02942cdd1278766c4b8ac1ccf4e..b6eae61d523028512b44b042ed9244e1c0fc013a 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2006-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file disobedience/queue.c
+ * @brief Disobedience queue widget
  */
 #include "disobedience.h"
 #include "popup.h"
@@ -28,7 +29,10 @@ static struct queue_entry *actual_playing_track;
 /** @brief The playing track */
 struct queue_entry *playing_track;
 
-/** @brief When we last got the playing track */
+/** @brief When we last got the playing track
+ *
+ * Set to 0 if the timings are currently off due to having just unpaused.
+ */
 time_t last_playing;
 
 static void queue_completed(void *v,
@@ -40,7 +44,6 @@ static void playing_completed(void *v,
 
 /** @brief Called when either the actual queue or the playing track change */
 static void queue_playing_changed(void) {
-
   /* Check that the playing track isn't in the queue.  There's a race here due
    * to the fact that we issue the two commands at slightly different times.
    * If it goes wrong we re-issue and try again, so that we never offer up an
@@ -66,7 +69,6 @@ static void queue_playing_changed(void) {
     playing_track = NULL;
     q = actual_queue;
   }
-  time(&last_playing);          /* for column_length() */
   ql_new_queue(&ql_queue, q);
   /* Tell anyone who cares */
   event_raise("queue-list-changed", q);
@@ -95,6 +97,7 @@ static void playing_completed(void attribute((unused)) *v,
   }
   actual_playing_track = q;
   queue_playing_changed();
+  time(&last_playing);
 }
 
 /** @brief Schedule an update to the queue
@@ -118,6 +121,9 @@ static void playing_changed(const char attribute((unused)) *event,
                             void  attribute((unused)) *callbackdata) {
   D(("playing_changed"));
   gtk_label_set_text(GTK_LABEL(report_label), "updating playing track");
+  /* Setting last_playing=0 means that we don't know what the correct value
+   * is right now, e.g. because things have been deranged by a pause. */
+  last_playing = 0;
   disorder_eclient_playing(client, playing_completed, 0);
 }
 
@@ -218,6 +224,7 @@ static struct menuitem queue_menuitems[] = {
   { "Deselect all tracks", ql_selectnone_activate, ql_selectnone_sensitive, 0, 0 },
   { "Scratch playing track", ql_scratch_activate, ql_scratch_sensitive, 0, 0 },
   { "Remove track from queue", ql_remove_activate, ql_remove_sensitive, 0, 0 },
+  { "Adopt track", ql_adopt_activate, ql_adopt_sensitive, 0, 0 },
 };
 
 struct queuelike ql_queue = {
index 788b824a805a406360da2800b89622708b504f42..0923a6d240ee852e224b9ce277ac87e8dffef234 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2006-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file disobedience/recent.c
+ * @brief Disobedience recently-played widget
  */
 #include "disobedience.h"
 #include "popup.h"
index faf2c6116cc4a51a88f1f7f7379ee5094f0223d9..f5f91f039a77d3b5ba7c6f0ab1f108a0ae4ee775 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of Disobedience
  * Copyright (C) 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file disobedience/rtp.c
  * @brief RTP player support for Disobedience
index 83557122943ae688abef258778acef4ffe65ad32..71b953d1fe8416524cec6219872d58f93ded9341 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of Disobedience
  * Copyright (C) 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file disobedience/settings.c
  * @brief Disobedience settings
index 363684f14163f7b2418e42cd68aa4303ae721b35..1d2a169c3910c7134a85df084b128cb81e5e1591 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file disobedience/users.c
  * @brief User management for Disobedience
@@ -350,6 +348,8 @@ static void users_details_destroyed(GtkWidget attribute((unused)) *widget,
  * @param email Email address
  * @param rights User rights string
  * @param password Password
+ * @param nameflags Visibility/editability for username
+ * @param flags Visibility/editability for other fields
  */
 static void users_makedetails(const char *name,
                               const char *email,
index 27f3639ea12c6c8c19afa3ac5196eb3e1e3ec04d..eaad306eb16f9c015d2daa52ce4df87c68f1a9a5 100644 (file)
@@ -1,21 +1,19 @@
 #
 # This file is part of DisOrder.
-# Copyright (C) 2004-2008 Richard Kettlewell
+# Copyright (C) 2004-2009 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 noinst_DATA=$(HTMLMAN)
@@ -26,15 +24,14 @@ man_MANS=disorderd.8 disorder.1 disorder.3 disorder_config.5 disorder-dump.8 \
        disorder-playrtp.1 disorder-normalize.8 disorder-decode.8 \
        disorder-stats.8 disorder-dbupgrade.8 disorder_templates.5 \
        disorder_actions.5 disorder_options.5 disorder.cgi.8 \
-       disorder_preferences.5
-noinst_MANS=tkdisorder.1
+       disorder_preferences.5 disorder-choose.8
 
 SEDFILES=disorder.1 disorderd.8 disorder_config.5 \
        disorder-dump.8 disorder_protocol.5 disorder-deadlock.8 \
        disorder-rescan.8 disobedience.1 disorderfm.1 disorder-playrtp.1 \
        disorder-decode.8 disorder-stats.8 disorder-dbupgrade.8 \
        disorder_options.5 disorder.cgi.8 disorder_templates.5 \
-       disorder_actions.5 disorder_preferences.5
+       disorder_actions.5 disorder_preferences.5 disorder-choose.8
 
 include ${top_srcdir}/scripts/sedfiles.make
 
@@ -85,13 +82,14 @@ endif
 
 EXTRA_DIST=disorderd.8.in disorder.1.in disorder_config.5.in \
           disorder.3 disorder-dump.8.in disorder_protocol.5.in \
-          tkdisorder.1 disorder-deadlock.8.in disorder-rescan.8.in \
+          disorder-deadlock.8.in disorder-rescan.8.in \
           disobedience.1.in disorderfm.1.in disorder-speaker.8 \
           disorder-playrtp.1.in disorder-decode.8.in disorder-normalize.8 \
           disorder-stats.8.in disorder-dbupgrade.8.in \
           disorder_actions.5.head disorder_templates.5.head \
           disorder_actions.5.tail disorder_templates.5.tail \
-          disorder_options.5.in disorder.cgi.8.in disorder_preferences.5.in
+          disorder_options.5.in disorder.cgi.8.in disorder_preferences.5.in \
+          disorder-choose.8.in
 
 CLEANFILES=$(SEDFILES) $(HTMLMAN) $(TMPLMAN) \
        disorder_actions.5.in disorder_templates.5.in
index 2d9beb944750b8b0a8a75d696eb4da60da355b68..fa4bd4264c71ebf6b9629213e11ada43fd2a2f7f 100644 (file)
@@ -1,20 +1,18 @@
 .\"
 .\" Copyright (C) 2004-2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .TH disobedience 1
 .SH NAME
@@ -40,8 +38,11 @@ Terminates the program.
 .SS "Edit Menu"
 This has the following options:
 .TP
-.B "Select All"
-Select all tracks in whichever of the Queue or Recent tabs are showing.
+.B "Select All Tracks"
+Select all tracks.
+.TP
+.B "Deselect All Tracks"
+Deselect all tracks.
 .TP
 .B Properties
 Edit the details of the selected tracks.
@@ -73,6 +74,8 @@ name, author and version number of the software.
 .TP
 .B "Pause button"
 The pause button can be used to pause and resume tracks.
+This button shows either a pause symbol (two vertical bars) or a resume symbol
+(a right-pointing arrow).
 .TP
 .B "Scratch button"
 The scratch button, a red cross, can be used to interrupt the currently playing
@@ -81,16 +84,22 @@ track.
 .B "Random play button"
 The random play button can be used to enable and disable random play.
 It does not take effect until the currently playing track finishes.
+When the button is green, random play is enabled.
+When it is grey, random play is disabled.
 .TP
 .B "Play button"
 The play button controls whether tracks will be played at all.
 As above it does not take effect until the currently playing track finishes.
+When the button is green, play is enabled.
+When it is grey, play is disabled.
 .TP
 .B "Network play button"
 The network play buttons enables or disables network play.
 See
 .B "NETWORK PLAY"
 below.
+When the button is green, network play is enabled.
+When it is grey, network play is disabled.
 .TP
 .B "Volume slider"
 The volume slider indicates the current volume level and can be used to adjust
@@ -128,16 +137,22 @@ See
 .B "Properties Window"
 below.
 .TP
-.B "Select All"
+.B "Select All Tracks"
 Select all tracks.
 .TP
+.B "Deselect All Tracks"
+Deselect all tracks.
+.TP
 .B Scratch
 Interrupt the currently playing track.
 (Note that this appears even if you right click over a queued track rather
 than the currently playing track.)
 .TP
-.B Remove
+.B "Remove track from queue"
 Remove the selected tracks from the queue.
+.TP
+.B "Adopt track"
+Sets the submitter of a randomly picked track to you.
 .SS "Recent Tab"
 This displays recently played tracks, the most recent at the top.
 .PP
@@ -151,8 +166,14 @@ See
 .B "Properties Window"
 below.
 .TP
-.B "Select All"
+.B "Play track"
+Play the select track(s);
+.TP
+.B "Select All Tracks"
 Select all tracks.
+.TP
+.B "Deselect All Tracks"
+Deselect all tracks.
 .SS "Choose Tab"
 This displays all the tracks known to the server in a tree structure.
 .PP
@@ -198,11 +219,11 @@ Play all the tracks in the directory, in the order they appear on screen.
 .B "Track properties"
 Edit properties of all tracks in the directory.
 .TP
-.B "Select all tracks"
+.B "Select children"
 Select all the tracks in the directory (and deselect everything else).
-.PP
-Note that these options do not apply recursively - only the tracks in the
-relevant directory are affected, not those in its subdirectories.
+.TP
+.B "Deselect all tracks"
+Deselect everything.
 .SS "Added Tab"
 This displays a list of tracks recently added to the server's database.
 The most recently added track is at the top.
@@ -223,6 +244,9 @@ Play selected tracks.
 .TP
 .B "Select All Tracks"
 Select all tracks.
+.TP
+.B "Deselect All Tracks"
+Deselect all tracks.
 .SS "Login Details Window"
 The login details window allows you to edit the connection details and
 authorization information used by Disobedience.
diff --git a/doc/disorder-choose.8.in b/doc/disorder-choose.8.in
new file mode 100644 (file)
index 0000000..709e1ec
--- /dev/null
@@ -0,0 +1,52 @@
+.\"
+.\" Copyright (C) 2009 Richard Kettlewell
+.\"
+.\" 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 3 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, see <http://www.gnu.org/licenses/>.
+.\"
+.TH disorder-choose 8
+.SH NAME
+disorder-choose \- DisOrder track chooser
+.SH SYNOPSIS
+.B disorder\-choose
+.RI [ OPTIONS ]
+.SH DESCRIPTION
+.B disorder\-choose
+chooses a track to play at random and writes it to standard output.
+It is used by the server and would not normally be invoked manually.
+.SH OPTIONS
+.TP
+.B \-\-config \fIPATH\fR, \fB\-c \fIPATH
+Set the configuration file.
+.TP
+.B \-\-debug\fR, \fB\-d
+Enable debugging.
+.TP
+.B \-\-syslog
+Log to syslog.
+This is the default if stderr is not a terminal.
+.TP
+.B \-\-no\-syslog
+Do not log to syslog.
+This is the default if stderr is a terminal.
+.TP
+.B \-\-help\fR, \fB\-h
+Display a usage message.
+.TP
+.B \-\-version\fR, \fB\-V
+Display version number.
+.SH "SEE ALSO"
+\fBdisorderd\fR(8), \fBdisorder_config\fR(5)
+.\" Local Variables:
+.\" mode:nroff
+.\" End:
index 966d88d8101d84b173dd4f8d00ff3b5034593a7d..269822d5c91bb10ecc29175a797091c962836838 100644 (file)
@@ -1,20 +1,18 @@
 .\"
 .\" Copyright (C) 2007, 2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .TH disorder-dbupgrade 8
 .SH NAME
index 249758dbfe89bdc6d6a86480ea2ca36afa601199..421e943b49409e5130bec8e002168ae364539be1 100644 (file)
@@ -1,20 +1,18 @@
 .\"
 .\" Copyright (C) 2005, 2007, 2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .TH disorder-deadlock 8
 .SH NAME
index 47884cc30b017e3432e9a8c1674924c0233183cb..b240ff81324c5dd9227ca4a36e2eb780d0058714 100644 (file)
@@ -2,20 +2,18 @@
 .\"
 .\" Copyright (C) 2007, 2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .TH disorder-decode 8
 .SH NAME
index d6c6ba52f0ca8d41e129956b2b138b14311b002e..3f0b6f0c941fa655a627f322177211eb22d56021 100644 (file)
@@ -1,20 +1,18 @@
 .\"
 .\" Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .TH disorder-dump 8
 .SH NAME
index df9f2fe2ff85f00632e38140ca273c507de7f0ce..2605b1f52cdc792a32907549051c4fa029ceb56c 100644 (file)
@@ -1,20 +1,18 @@
 .\"
 .\" Copyright (C) 2007, 2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .TH disorder-normalize 8
 .SH NAME
index c187de4f66fd90bb4a445577c270f95d838d0d52..5e0d09100c674315badd20b060041830fdbf00ac 100644 (file)
@@ -1,20 +1,18 @@
 .\"
 .\" Copyright (C) 2007, 2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .TH disorder-playrtp 1
 .SH NAME
index 7f67b237f9f59b564894ea4095d6beae52448ee4..490f04c8174be07546bbfd697413918898095e8f 100644 (file)
@@ -1,20 +1,18 @@
 .\"
 .\" Copyright (C) 2005, 2007, 2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .TH disorder-rescan 8
 .SH NAME
index 0517f6dfddcecea1f71563b73fb954d44fd90e87..a7a14ca8f5558c292000b4e19755bcc8c204cb21 100644 (file)
@@ -1,20 +1,18 @@
 .\"
 .\" Copyright (C) 2007, 2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .TH disorder-speaker 8
 .SH NAME
index af1958d9bab5c5901df4152b8de5c2ed36d96f4d..f1bd5615a292befa7517f41113493938d5a7429d 100644 (file)
@@ -1,20 +1,18 @@
 .\"
 .\" Copyright (C) 2007, 2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .TH disorder-stats 8
 .SH NAME
index b045f10a5224342bac6e08d90b47e5fb8e068dda..784b37a99d5c78e9d1ab85075611bba3985e23a8 100644 (file)
@@ -1,20 +1,18 @@
 .\"
 .\" Copyright (C) 2004-2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .TH disorder 1
 .SH NAME
@@ -64,6 +62,10 @@ Create a new user.
 If \fIRIGHTS\fR is not specified then the \fBdefault_rights\fR
 setting from the server's configuration file applies.
 .TP
+.B adopt \fIID\fR
+Adopts track \fIID\fR (in the queue).
+The track will show up as submitted by the calling user.
+.TP
 .B authorize \fIUSERNAME\fR [\fIRIGHTS\fR]
 Create user \fIUSERNAME\fR with a random password.
 User \fIUSERNAME\fR must be a UNIX login user (not just any old string).
index ae54acd82049d5434f79dfde31bbd99f73240731..5bd10b3483139a4ed0f9e07afa187747de2837dd 100644 (file)
@@ -1,20 +1,18 @@
 .\"
 .\" Copyright (C) 2004-2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .TH disorder 3
 .SH NAME
index 833e1146b258778f78e5e87fdb4bc77d4d1e09ec..eecb87f48c3ae1cf034782a301f548a596c30c21 100644 (file)
@@ -1,20 +1,18 @@
 .\"
 .\" Copyright (C) 2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .TH disorder.cgi 8
 .SH NAME
index c093a2d6508dc50b2f69ac6bbb95cb1cc1cd1fb1..d03032f5fb94f2ebbba7d0d7f7a22a19794c71fe 100644 (file)
@@ -1,20 +1,18 @@
 .\"
 .\" Copyright (C) 2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .TH disorder_actions 5
 .SH NAME
index 9c955217cd4202955ce852143244d5e8b9572d0a..ff07d9868537d35c115a9e3159ad224d2bfb505f 100644 (file)
@@ -1,20 +1,18 @@
 .\"
 .\" Copyright (C) 2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .SH "SEE ALSO"
 .BR disorder_templates (5),
index 20c9e8b72da42116a085a26bc9f4917a61d89db1..e2f1ab0ec181dd680a2608ea7c70c31d1625491c 100644 (file)
@@ -1,20 +1,18 @@
 .\"
 .\" Copyright (C) 2004-2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .TH disorder_config 5
 .SH NAME
@@ -479,7 +477,7 @@ namepart ext    "(\\.[a-zA-Z0-9]+)$"                        $1 *
 .TP
 .B new_bias \fIWEIGHT\fR
 The weight for new tracks.
-The default is 900000, i.e. recently added tracks are a hundred times as likely
+The default is 450000, i.e. recently added tracks are a fifty times as likely
 to be picked as normal.
 .TP
 .B new_bias_age \fISECONDS\fR
@@ -648,7 +646,10 @@ Determines whether calls to \fBsox\fR(1) should use \fB\-b\fR, \fB\-x\fR, etc (i
 the generation is 0) or \fB\-\fIbits\fR, \fB\-L\fR etc (if it is 1).
 See the documentation for your installed copy of \fBsox\fR to determine
 which you need.
-The default is 0.
+The default is set according to the version of sox found when DisOrder was
+built.
+If you run on a system with a different version of sox, you will need to
+set this option.
 .TP
 .B speaker_backend \fINAME
 This is an alias for \fBapi\fR; see above.
index 62dd9c29ec1b3cba7f0510a106495b49af67c5c1..b8492b63bbe72e0789d0341c550c4be0f9c0a15f 100644 (file)
@@ -1,20 +1,18 @@
 .\"
 .\" Copyright (C) 2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .TH disorder_options 5
 .SH NAME
index 4aca881e7d11b296897ff64126ec2a23b1e1c826..9fbe6fbc8f8729a74cbd795598751280b2e8930f 100644 (file)
@@ -1,20 +1,18 @@
 .\"
 .\" Copyright (C) 2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .TH disorder_preferences 5
 .SH NAME
index 5a8a48125a16c73118461e95b7003fd9a9a448ac..4ad1d42bc5bcffe69f8c31a4fa0be13df293f3bf 100644 (file)
@@ -1,20 +1,18 @@
 .\"
 .\" Copyright (C) 2004-2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .TH disorder_protocol 5
 .SH NAME
@@ -66,6 +64,10 @@ then the \fBdefault_rights\fR setting applies instead.
 Requires the \fBadmin\fR right, and only works on local
 connections.
 .TP
+.B adopt \fIID\fR
+Adopts a randomly picked track, leaving it in a similar state to if it was
+picked by this user.  Requires the \fBplay\fR right.
+.TP
 .B allfiles \fIDIRECTORY\fR [\fIREGEXP\fR]
 List all the files and directories in \fIDIRECTORY\fR in a response body.
 If \fIREGEXP\fR is present only matching files and directories are returned.
@@ -541,6 +543,26 @@ The time the track was played at.
 .B scratched
 The user that scratched the track.
 .TP
+.B origin
+The origin of the track.  Valid origins are:
+.RS
+.TP 12
+.B adopted
+The track was originally randomly picked but has been adopted by a user.
+.TP
+.B picked
+The track was picked by a user.
+.TP
+.B random
+The track was randomly picked.
+.TP
+.B scheduled
+The track was played from a scheduled action.
+.TP
+.B scratch
+The track is a scratch sound.
+.RE
+.TP
 .B state
 The current track state.
 Valid states are:
@@ -549,12 +571,6 @@ Valid states are:
 .B failed
 The player failed (exited with nonzero status but wasn't scratched).
 .TP
-.B isscratch
-The track is actually a scratch.
-.TP
-.B no_player
-No player could be found for the track.
-.TP
 .B ok
 The track was played without any problems.
 .TP
@@ -564,6 +580,9 @@ The track was scratched.
 .B started
 The track is currently playing.
 .TP
+.B paused
+Track is playing but paused.
+.TP
 .B unplayed
 In the queue, hasn't been played yet.
 .TP
@@ -582,6 +601,9 @@ The time the track was added to the queue.
 .TP
 .B wstat
 The wait status of the player in decimal.
+.PP
+Note that \fBorigin\fR is new with DisOrder 4.3, and obsoletes some old
+\fBstate\fR values.
 .SH NOTES
 Times are decimal integers using the server's \fBtime_t\fR.
 .PP
@@ -599,6 +621,9 @@ keyword followed by (optionally) parameters.
 The parameters are quoted in the usual DisOrder way.
 Currently the following keywords are used:
 .TP
+.B adopted \fIID\fR \fIUSERNAME\fR
+\fIUSERNAME\fR adopted track \fIID\fR.
+.TP
 .B completed \fITRACK\fR
 Completed playing \fITRACK\fR
 .TP
index 5efeef07286f08aad07d141a1080a16513ebf312..fe100f79fae3618ebc909f3157961fe16bebf445 100644 (file)
@@ -1,20 +1,18 @@
 .\"
 .\" Copyright (C) 2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .TH disorder_templates 5
 .SH NAME
index e43e86f8a03de10efaf23bb2124197b5e3e79e0e..766937c6b3f01d895d4c6afede38da0eceb0a22c 100644 (file)
@@ -1,20 +1,18 @@
 .\"
 .\" Copyright (C) 2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .SH "SEE ALSO"
 .BR disorder_actions (5),
index 01448ab85600f05d63ee6931cbe4a18103b38d03..a575c5852f9c562ebe42044da890550102324164 100644 (file)
@@ -1,20 +1,18 @@
 .\"
 .\" Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .TH disorderd 8
 .SH NAME
index 822a36698949b789f9c109cda9d373adced88fdd..1f100ad34e8da268fb051c3872291ad8a013b224 100644 (file)
@@ -1,20 +1,18 @@
 .\"
 .\" Copyright (C) 2006-2008 Richard Kettlewell
 .\"
-.\" This program is free software; you can redistribute it and/or modify
+.\" 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
+.\" the Free Software Foundation, either version 3 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.
-.\"
+.\" 
+.\" 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
+.\" along with this program.  If not, see <http://www.gnu.org/licenses/>.
 .\"
 .TH disorderfm 1
 .SH NAME
diff --git a/doc/tkdisorder.1 b/doc/tkdisorder.1
deleted file mode 100644 (file)
index 8cd1b68..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-.\"
-.\" Copyright (C) 2005 Richard Kettlewell
-.\"
-.\" 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
-.\"
-.TH tkdisorder 1
-.SH NAME
-tkdisorder \- DisOrder jukebox client
-.SH SYNOPSIS
-.B tkdisorder
-.RI [ OPTIONS ]
-.SH DESCRIPTION
-.B tkdisorder
-is a simple graphical client for DisOrder.
-It is not finished and no further
-development is planned.
-Use \fBdisobedience\fR(1) instead.
-.PP
-The main window is divided into two.
-The top half contains the name
-of the current track and a progress bar indicating how far through
-playing it is.
-It also contains three buttons:
-.TP
-.B Quit
-Terminates tkdisorder.
-.TP
-.B Scratch
-Terminates the current track.
-.TP
-.B Recent
-Pops up a window listing recently played tracks, most recent at the
-top.
-.PP
-The bottom half of the window lists the current queue, with the next
-track to be played at the top.
-.SH OPTIONS
-.TP
-.B \-\-help\fR, \fB\-h
-Display a usage message.
-.TP
-.B \-\-version\fR, \fB\-V
-Display version number.
-.SH "SEE ALSO"
-\fBdisorder\fR(1), \fBdisobedience\fR(1), \fBdisorder_config\fR(5)
-.PP
-"\fBpydoc disorder\fR" for the Python API documentation.
-.\" Local Variables:
-.\" mode:nroff
-.\" fill-column:79
-.\" End:
index 7485b8336b20250a133cba6a0e6639dd5e8701ba..df8fe1f6d65aab50b3b6d1f21539fd21e74a3309 100644 (file)
@@ -2,20 +2,18 @@
 # This file is part of DisOrder
 # Copyright (C) 2005, 2007, 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 
index d075a03c1aaf2445b76bf96bb4b0f9d48e1ceba9..e6b65752f3fb7eef2189b98abad25d4843990e66 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file driver/disorder.c
  * @brief libao driver used by DisOrder
index 8c671af24739f8257dd83db647ecabc9998db454..13b6d5588337d13241b2d484d7ac85dcc59f8c73 100644 (file)
@@ -2,20 +2,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 noinst_SCRIPTS=disorder.init disorder.rc
index de921e550878e57faba82ffb85ebda243b463583..111ad0b4fc368f19cff680035f20db162c447711 100755 (executable)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder
 # Copyright (C) 2005 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 # Example use of disorder.monitor class
index 905fc2ecb7fc6eb302af154dd9abb58fb3f121dc..d8d3f083dec47b7e2c2f6c55be81b477850dea4f 100644 (file)
@@ -1,24 +1,32 @@
 #! /bin/sh
 #
 # This file is part of DisOrder.
-# Copyright (C) 2004, 2005, 2007 Richard Kettlewell
+# Copyright (C) 2004, 2005, 2007, 2009 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
+### BEGIN INIT INFO
+# Provides:          disorder
+# Required-Start:    $local_fs $network $named $remote_fs $syslog $time
+# Required-Stop:     $local_fs $network $named $remote_fs $syslog $time
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start and stop DisOrder
+# Description:       DisOrder is a multi-user software jukebox.
+### END INIT INFO
+
 set -e
 
 DAEMON=sbindir/disorderd
index 3543b169a43eccc3d7b0df6f4f435ea36f6666e2..b958cd6790afd3e2babece0781d418b431e5b395 100755 (executable)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # PROVIDE: disorder
 # REQUIRE: DAEMON
index 607d0254a465b1e17726c269db2394e6f6de58fd..109a7e29f5db55ea36b823409a3ced9335cbecf6 100644 (file)
@@ -2,20 +2,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2005-2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 pkghttp_DATA=cross.png down.png downdown.png edit.png nocross.png      \
@@ -24,6 +22,11 @@ notes.png play.png pause.png random.png randomcross.png notescross.png       \
 propagate.png speaker.png speakercross.png directory.png logo.png      \
 logosmall.png logo256.png
 
-EXTRA_DIST=$(pkghttp_DATA) duck.png disobedience16x16.xpm disobedience32x32.xpm
+EXTRA_DIST=$(pkghttp_DATA) duck.png disobedience16x16.xpm              \
+disobedience32x32.xpm cross.svg go.svg notes.svg noteson.svg pause.svg \
+query.svg queryon.svg speaker.svg speakeron.svg cross32.png            \
+pause32.png play32.png playdisabled32.png playenabled32.png            \
+randomdisabled32.png randomenabled32.png rtpdisabled32.png             \
+rtpenabled32.png
 
 CLEANFILES=$(SEDFILES)
diff --git a/images/cross.svg b/images/cross.svg
new file mode 100644 (file)
index 0000000..c76e7d7
--- /dev/null
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="32"
+   height="32"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.45.1"
+   version="1.0"
+   sodipodi:docbase="/Users/richard/Documents/Inkscape/disorder"
+   sodipodi:docname="cross.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   inkscape:export-filename="/Users/richard/Documents/Inkscape/disorder/cross.png"
+   inkscape:export-xdpi="90.099998"
+   inkscape:export-ydpi="90.099998">
+  <defs
+     id="defs4">
+    <linearGradient
+       id="linearGradient3136">
+      <stop
+         style="stop-color:#ff0000;stop-opacity:1;"
+         offset="0"
+         id="stop3138" />
+      <stop
+         id="stop3144"
+         offset="0.75"
+         style="stop-color:#ff8080;stop-opacity:1;" />
+      <stop
+         style="stop-color:#ff0000;stop-opacity:1;"
+         offset="1"
+         id="stop3140" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3136"
+       id="linearGradient3142"
+       x1="0"
+       y1="8"
+       x2="16"
+       y2="8"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="scale(1.9978214,1.9978214)" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="14.34375"
+     inkscape:cx="16"
+     inkscape:cy="16"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     width="32px"
+     height="32px"
+     showgrid="true"
+     inkscape:grid-points="false"
+     inkscape:window-width="818"
+     inkscape:window-height="664"
+     inkscape:window-x="827"
+     inkscape:window-y="171"
+     inkscape:grid-bbox="false" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <path
+       style="fill:url(#linearGradient3142);fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.99891067;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       d="M 24.09872,0.49945534 L 15.982571,8.6156046 L 7.9288535,0.62431917 L 0.62431917,7.9288535 L 8.6156046,15.982571 L 0.49945534,24.09872 L 7.8664216,31.465686 L 15.982571,23.349537 L 24.09872,31.465686 L 31.465686,24.09872 L 23.349537,15.982571 L 31.465686,7.8664216 L 24.09872,0.49945534 z "
+       id="rect2160"
+       inkscape:export-xdpi="180"
+       inkscape:export-ydpi="180"
+       inkscape:export-filename="/Users/richard/Documents/Inkscape/cross.png" />
+  </g>
+</svg>
diff --git a/images/cross32.png b/images/cross32.png
new file mode 100644 (file)
index 0000000..df52c34
Binary files /dev/null and b/images/cross32.png differ
diff --git a/images/go.svg b/images/go.svg
new file mode 100644 (file)
index 0000000..53a61b4
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="32px"
+   height="32px"
+   id="svg8035"
+   sodipodi:version="0.32"
+   inkscape:version="0.45.1"
+   sodipodi:docbase="/Users/richard/Documents/Inkscape/disorder"
+   sodipodi:docname="go.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   inkscape:export-filename="/Users/richard/Documents/Inkscape/disorder/go.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs8037" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="11.8125"
+     inkscape:cx="16"
+     inkscape:cy="16"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:grid-bbox="true"
+     inkscape:document-units="px"
+     inkscape:window-width="701"
+     inkscape:window-height="583"
+     inkscape:window-x="866"
+     inkscape:window-y="75" />
+  <metadata
+     id="metadata8040">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer">
+    <path
+       style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
+       d="M 9.5,29.910697 L 23.5,15.910697 L 9.5,1.9106968 L 9.5,29.910697 z "
+       id="path8043" />
+  </g>
+</svg>
diff --git a/images/notes.svg b/images/notes.svg
new file mode 100644 (file)
index 0000000..464b2ea
--- /dev/null
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="32"
+   height="32"
+   id="svg2304"
+   sodipodi:version="0.32"
+   inkscape:version="0.45.1"
+   version="1.0"
+   sodipodi:docbase="/Users/richard/Documents/Inkscape"
+   sodipodi:docname="notes2.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   inkscape:export-filename="/Users/richard/Documents/Inkscape/notes2.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs2306">
+    <linearGradient
+       id="linearGradient3200">
+      <stop
+         style="stop-color:#c0c0c0;stop-opacity:1;"
+         offset="0"
+         id="stop3202" />
+      <stop
+         id="stop3208"
+         offset="0.75"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+      <stop
+         style="stop-color:#c0c0c0;stop-opacity:1;"
+         offset="1"
+         id="stop3204" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3200"
+       id="linearGradient3206"
+       x1="0.053109944"
+       y1="16.061862"
+       x2="31.990934"
+       y2="16.061862"
+       gradientUnits="userSpaceOnUse" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="18.34375"
+     inkscape:cx="16"
+     inkscape:cy="16"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     width="32px"
+     height="32px"
+     showgrid="true"
+     showborder="true"
+     inkscape:showpageshadow="false"
+     inkscape:window-width="1031"
+     inkscape:window-height="792"
+     inkscape:window-x="391"
+     inkscape:window-y="11" />
+  <metadata
+     id="metadata2309">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <path
+       id="path2312"
+       style="fill:url(#linearGradient3206);fill-rule:evenodd;stroke:#000000;stroke-width:0.89378011px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;fill-opacity:1.0"
+       d="M 11.043557,5.610662 C 13.769281,4.8336965 29.90861,1.1279818 31.544044,0.62372499 C 31.544044,1.2642723 31.5,21.379001 31.5,22 C 31.5,24.484 28.14,26.5 24,26.5 C 19.86,26.5 16.5,24.484 16.5,22 C 16.5,19.516 19.86,17.5 24,17.5 C 25.035,17.5 26.02125,17.626 26.918437,17.853813 C 26.918437,17.212397 27.043557,7.2206785 27.043557,6.0621118 C 13.142364,9.2101891 28.736548,5.6918635 15.544044,8.6220189 C 15.544044,9.2625661 15.5,26.379 15.5,26.999999 C 15.5,29.483999 12.14,31.499999 8,31.499999 C 3.86,31.499999 0.5,29.483999 0.5,26.999999 C 0.5,24.515999 3.86,22.499999 8,22.499999 C 9.035,22.499999 10.02125,22.625998 10.918437,22.853812 C 10.918437,22.212396 11.043557,6.7692289 11.043557,5.610662 z "
+       sodipodi:nodetypes="ccsssscccsssscc" />
+  </g>
+</svg>
diff --git a/images/noteson.svg b/images/noteson.svg
new file mode 100644 (file)
index 0000000..e42a43d
--- /dev/null
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="32"
+   height="32"
+   id="svg2304"
+   sodipodi:version="0.32"
+   inkscape:version="0.45.1"
+   version="1.0"
+   sodipodi:docbase="/Users/richard/Documents/Inkscape"
+   sodipodi:docname="noteon.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   inkscape:export-filename="/Users/richard/Documents/Inkscape/noteson.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs2306">
+    <linearGradient
+       id="linearGradient3200">
+      <stop
+         style="stop-color:#00c000;stop-opacity:1;"
+         offset="0"
+         id="stop3202" />
+      <stop
+         id="stop3208"
+         offset="0.75"
+         style="stop-color:#80ff80;stop-opacity:1;" />
+      <stop
+         style="stop-color:#00c000;stop-opacity:1;"
+         offset="1"
+         id="stop3204" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3200"
+       id="linearGradient3206"
+       x1="0.053109944"
+       y1="16.061862"
+       x2="31.990934"
+       y2="16.061862"
+       gradientUnits="userSpaceOnUse" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="18.34375"
+     inkscape:cx="16"
+     inkscape:cy="16"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     width="32px"
+     height="32px"
+     showgrid="true"
+     showborder="true"
+     inkscape:showpageshadow="false"
+     inkscape:window-width="1031"
+     inkscape:window-height="792"
+     inkscape:window-x="391"
+     inkscape:window-y="11" />
+  <metadata
+     id="metadata2309">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <path
+       id="path2312"
+       style="fill:url(#linearGradient3206);fill-rule:evenodd;stroke:#000000;stroke-width:0.89378011px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;fill-opacity:1.0"
+       d="M 11.043557,5.610662 C 13.769281,4.8336965 29.90861,1.1279818 31.544044,0.62372499 C 31.544044,1.2642723 31.5,21.379001 31.5,22 C 31.5,24.484 28.14,26.5 24,26.5 C 19.86,26.5 16.5,24.484 16.5,22 C 16.5,19.516 19.86,17.5 24,17.5 C 25.035,17.5 26.02125,17.626 26.918437,17.853813 C 26.918437,17.212397 27.043557,7.2206785 27.043557,6.0621118 C 13.142364,9.2101891 28.736548,5.6918635 15.544044,8.6220189 C 15.544044,9.2625661 15.5,26.379 15.5,26.999999 C 15.5,29.483999 12.14,31.499999 8,31.499999 C 3.86,31.499999 0.5,29.483999 0.5,26.999999 C 0.5,24.515999 3.86,22.499999 8,22.499999 C 9.035,22.499999 10.02125,22.625998 10.918437,22.853812 C 10.918437,22.212396 11.043557,6.7692289 11.043557,5.610662 z "
+       sodipodi:nodetypes="ccsssscccsssscc" />
+  </g>
+</svg>
diff --git a/images/pause.svg b/images/pause.svg
new file mode 100644 (file)
index 0000000..08f659c
--- /dev/null
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="32px"
+   height="32px"
+   id="svg7048"
+   sodipodi:version="0.32"
+   inkscape:version="0.45.1"
+   sodipodi:docbase="/Users/richard/Documents/Inkscape/disorder"
+   sodipodi:docname="pause.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   inkscape:export-filename="/Users/richard/Documents/Inkscape/disorder/pause.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs7050" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="11.197802"
+     inkscape:cx="16"
+     inkscape:cy="16"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:grid-bbox="true"
+     inkscape:document-units="px"
+     inkscape:grid-points="true"
+     inkscape:window-width="701"
+     inkscape:window-height="583"
+     inkscape:window-x="272"
+     inkscape:window-y="20" />
+  <metadata
+     id="metadata7053">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer">
+    <rect
+       style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
+       id="rect7058"
+       width="9"
+       height="28"
+       x="5"
+       y="2" />
+    <use
+       x="0"
+       y="0"
+       xlink:href="#rect7058"
+       id="use8031"
+       transform="translate(13.5,3.581944e-2)"
+       width="32"
+       height="32" />
+  </g>
+</svg>
diff --git a/images/pause32.png b/images/pause32.png
new file mode 100644 (file)
index 0000000..1dc9c9f
Binary files /dev/null and b/images/pause32.png differ
diff --git a/images/play32.png b/images/play32.png
new file mode 100644 (file)
index 0000000..77942bb
Binary files /dev/null and b/images/play32.png differ
diff --git a/images/playdisabled32.png b/images/playdisabled32.png
new file mode 100644 (file)
index 0000000..c09ba76
Binary files /dev/null and b/images/playdisabled32.png differ
diff --git a/images/playenabled32.png b/images/playenabled32.png
new file mode 100644 (file)
index 0000000..d6406dd
Binary files /dev/null and b/images/playenabled32.png differ
diff --git a/images/query.svg b/images/query.svg
new file mode 100644 (file)
index 0000000..797cf17
--- /dev/null
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="32"
+   height="32"
+   id="svg4179"
+   sodipodi:version="0.32"
+   inkscape:version="0.45.1"
+   version="1.0"
+   sodipodi:docbase="/Users/richard/Documents/Inkscape/disorder"
+   sodipodi:docname="query.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   inkscape:export-filename="/Users/richard/Documents/Inkscape/disorder/query.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs4181">
+    <linearGradient
+       id="linearGradient5161">
+      <stop
+         style="stop-color:#c0c0c0;stop-opacity:1;"
+         offset="0"
+         id="stop5163" />
+      <stop
+         id="stop5169"
+         offset="0.75"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+      <stop
+         style="stop-color:#c0c0c0;stop-opacity:1;"
+         offset="1"
+         id="stop5165" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient5161"
+       id="linearGradient5167"
+       x1="7"
+       y1="16.075975"
+       x2="26.150736"
+       y2="16.075975"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1,0,0,0.9843005,0,2.3855502e-3)" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="11.8125"
+     inkscape:cx="16"
+     inkscape:cy="16"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     width="32px"
+     height="32px"
+     showgrid="true"
+     inkscape:window-width="701"
+     inkscape:window-height="583"
+     inkscape:window-x="496"
+     inkscape:window-y="244" />
+  <metadata
+     id="metadata4184">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <path
+       style="font-size:42.91105652px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:url(#linearGradient5167);fill-opacity:1;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       d="M 18.901113,21.105648 L 11.337202,21.105648 L 11.337202,20.095086 C 11.337194,18.967668 11.567673,17.970856 12.028639,17.104646 C 12.48959,16.224716 13.460395,15.111037 14.94106,13.763604 L 16.28203,12.567428 C 17.078218,11.852492 17.657908,11.178785 18.021101,10.546304 C 18.398235,9.9138654 18.586809,9.281405 18.586823,8.648922 C 18.586809,7.6865057 18.251567,6.9371781 17.581095,6.4009368 C 16.910597,5.8509967 15.974713,5.576014 14.773438,5.5759881 C 13.641985,5.576014 12.419747,5.8097492 11.106722,6.2771944 C 9.7936828,6.730941 8.4247768,7.4115231 7,8.3189426 L 7,1.8430951 C 8.6901769,1.2656612 10.233688,0.83943817 11.630539,0.56442461 C 13.027374,0.28947291 14.375328,0.1519816 15.674403,0.15195025 C 19.082688,0.1519816 21.680816,0.83943817 23.468794,2.2143221 C 25.256734,3.5755154 26.150713,5.5691395 26.150735,8.1952002 C 26.150713,9.5426384 25.878329,10.752562 25.333581,11.824974 C 24.788791,12.883677 23.859891,14.024855 22.546877,15.248512 L 21.205906,16.424063 C 20.256036,17.276525 19.634441,17.963982 19.341119,18.486436 C 19.047767,18.995166 18.901098,19.55888 18.901113,20.17758 L 18.901113,21.105648 M 11.337202,24.157958 L 18.901113,24.157958 L 18.901113,31.500002 L 11.337202,31.500002 L 11.337202,24.157958"
+       id="text4187" />
+  </g>
+</svg>
diff --git a/images/queryon.svg b/images/queryon.svg
new file mode 100644 (file)
index 0000000..a6e441e
--- /dev/null
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="32"
+   height="32"
+   id="svg4179"
+   sodipodi:version="0.32"
+   inkscape:version="0.45.1"
+   version="1.0"
+   sodipodi:docbase="/Users/richard/Documents/Inkscape/disorder"
+   sodipodi:docname="queryon.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   inkscape:export-filename="/Users/richard/Documents/Inkscape/disorder/queryon.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs4181">
+    <linearGradient
+       id="linearGradient5161">
+      <stop
+         style="stop-color:#00c000;stop-opacity:1;"
+         offset="0"
+         id="stop5163" />
+      <stop
+         id="stop5169"
+         offset="0.75"
+         style="stop-color:#80ff80;stop-opacity:1;" />
+      <stop
+         style="stop-color:#00c000;stop-opacity:1;"
+         offset="1"
+         id="stop5165" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient5161"
+       id="linearGradient5167"
+       x1="7"
+       y1="16.075975"
+       x2="26.150736"
+       y2="16.075975"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1,0,0,0.9843005,0,2.3855502e-3)" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="11.8125"
+     inkscape:cx="16"
+     inkscape:cy="16"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     width="32px"
+     height="32px"
+     showgrid="true"
+     inkscape:window-width="701"
+     inkscape:window-height="583"
+     inkscape:window-x="642"
+     inkscape:window-y="233" />
+  <metadata
+     id="metadata4184">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <path
+       style="font-size:42.91105652px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:url(#linearGradient5167);fill-opacity:1.0;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       d="M 18.901113,21.105648 L 11.337202,21.105648 L 11.337202,20.095086 C 11.337194,18.967668 11.567673,17.970856 12.028639,17.104646 C 12.48959,16.224716 13.460395,15.111037 14.94106,13.763604 L 16.28203,12.567428 C 17.078218,11.852492 17.657908,11.178785 18.021101,10.546304 C 18.398235,9.9138654 18.586809,9.281405 18.586823,8.648922 C 18.586809,7.6865057 18.251567,6.9371781 17.581095,6.4009368 C 16.910597,5.8509967 15.974713,5.576014 14.773438,5.5759881 C 13.641985,5.576014 12.419747,5.8097492 11.106722,6.2771944 C 9.7936828,6.730941 8.4247768,7.4115231 7,8.3189426 L 7,1.8430951 C 8.6901769,1.2656612 10.233688,0.83943817 11.630539,0.56442461 C 13.027374,0.28947291 14.375328,0.1519816 15.674403,0.15195025 C 19.082688,0.1519816 21.680816,0.83943817 23.468794,2.2143221 C 25.256734,3.5755154 26.150713,5.5691395 26.150735,8.1952002 C 26.150713,9.5426384 25.878329,10.752562 25.333581,11.824974 C 24.788791,12.883677 23.859891,14.024855 22.546877,15.248512 L 21.205906,16.424063 C 20.256036,17.276525 19.634441,17.963982 19.341119,18.486436 C 19.047767,18.995166 18.901098,19.55888 18.901113,20.17758 L 18.901113,21.105648 M 11.337202,24.157958 L 18.901113,24.157958 L 18.901113,31.500002 L 11.337202,31.500002 L 11.337202,24.157958"
+       id="text4187" />
+  </g>
+</svg>
diff --git a/images/randomdisabled32.png b/images/randomdisabled32.png
new file mode 100644 (file)
index 0000000..853175e
Binary files /dev/null and b/images/randomdisabled32.png differ
diff --git a/images/randomenabled32.png b/images/randomenabled32.png
new file mode 100644 (file)
index 0000000..752502c
Binary files /dev/null and b/images/randomenabled32.png differ
diff --git a/images/rtpdisabled32.png b/images/rtpdisabled32.png
new file mode 100644 (file)
index 0000000..7533925
Binary files /dev/null and b/images/rtpdisabled32.png differ
diff --git a/images/rtpenabled32.png b/images/rtpenabled32.png
new file mode 100644 (file)
index 0000000..5caca17
Binary files /dev/null and b/images/rtpenabled32.png differ
diff --git a/images/speaker.svg b/images/speaker.svg
new file mode 100644 (file)
index 0000000..24a2d11
--- /dev/null
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="32"
+   height="32"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.45.1"
+   version="1.0"
+   sodipodi:docbase="/Users/richard/Documents/Inkscape/disorder"
+   sodipodi:docname="speaker.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   inkscape:export-filename="/Users/richard/Documents/Inkscape/disorder/speaker.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs4">
+    <linearGradient
+       id="linearGradient5007">
+      <stop
+         style="stop-color:#404040;stop-opacity:1;"
+         offset="0"
+         id="stop5009" />
+      <stop
+         id="stop5015"
+         offset="0.75"
+         style="stop-color:#7f7f7f;stop-opacity:1;" />
+      <stop
+         style="stop-color:#404040;stop-opacity:1;"
+         offset="1"
+         id="stop5011" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient5007"
+       id="linearGradient5013"
+       x1="0"
+       y1="15.9"
+       x2="17.8"
+       y2="15.9"
+       gradientUnits="userSpaceOnUse" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="25.09375"
+     inkscape:cx="16"
+     inkscape:cy="15.997489"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     width="32px"
+     height="32px"
+     showgrid="true"
+     inkscape:grid-points="true"
+     gridspacingx="-0.5px"
+     gridspacingy="-0.5px"
+     showguides="true"
+     inkscape:window-width="1176"
+     inkscape:window-height="1008"
+     inkscape:window-x="252"
+     inkscape:window-y="0" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <path
+       style="fill:url(#linearGradient5013);fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;fill-opacity:1.0"
+       d="M 0.5,11.9 L 6.1,11.9 L 17.3,0.7 L 17.3,31.1 L 6.1,19.9 L 0.5,19.9 L 0.5,11.9 z "
+       id="path4021"
+       sodipodi:nodetypes="ccccccc" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.99999988px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 20,3.3 C 22.0424,3.3 23.7,8.9896002 23.7,15.999999 C 23.7,23.0104 22.0424,28.700001 20,28.700001"
+       id="path4992"
+       sodipodi:nodetypes="ccs"
+       inkscape:export-xdpi="90"
+       inkscape:export-ydpi="90" />
+    <path
+       sodipodi:nodetypes="ccs"
+       id="path4995"
+       d="M 23,1.7000001 C 25.0424,1.7000001 26.7,8.1064003 26.7,16.000001 C 26.7,23.8936 25.0424,30.3 23,30.3"
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000012px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 26.1,0.9 C 28.1424,0.9 29.8,7.6648001 29.8,16 C 29.8,24.3352 28.1424,31.1 26.1,31.1"
+       id="path4997"
+       sodipodi:nodetypes="ccs" />
+  </g>
+</svg>
diff --git a/images/speakeron.svg b/images/speakeron.svg
new file mode 100644 (file)
index 0000000..0ae5c02
--- /dev/null
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://web.resource.org/cc/"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="32"
+   height="32"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.45.1"
+   version="1.0"
+   sodipodi:docbase="/Users/richard/Documents/Inkscape/disorder"
+   sodipodi:docname="speakeron.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   inkscape:export-filename="/Users/richard/Documents/Inkscape/disorder/speakeron.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs4">
+    <linearGradient
+       id="linearGradient5007">
+      <stop
+         style="stop-color:#00ff00;stop-opacity:1;"
+         offset="0"
+         id="stop5009" />
+      <stop
+         id="stop5015"
+         offset="0.75"
+         style="stop-color:#80ff80;stop-opacity:1;" />
+      <stop
+         style="stop-color:#00ff00;stop-opacity:1;"
+         offset="1"
+         id="stop5011" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient5007"
+       id="linearGradient5013"
+       x1="0"
+       y1="15.9"
+       x2="17.8"
+       y2="15.9"
+       gradientUnits="userSpaceOnUse" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="25.09375"
+     inkscape:cx="16"
+     inkscape:cy="15.997489"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     width="32px"
+     height="32px"
+     showgrid="true"
+     inkscape:grid-points="true"
+     gridspacingx="-0.5px"
+     gridspacingy="-0.5px"
+     showguides="true"
+     inkscape:window-width="1176"
+     inkscape:window-height="1008"
+     inkscape:window-x="252"
+     inkscape:window-y="0" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <path
+       style="fill:url(#linearGradient5013);fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-opacity:1;fill-opacity:1.0"
+       d="M 0.5,11.9 L 6.1,11.9 L 17.3,0.7 L 17.3,31.1 L 6.1,19.9 L 0.5,19.9 L 0.5,11.9 z "
+       id="path4021"
+       sodipodi:nodetypes="ccccccc" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.99999988px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 20,3.3 C 22.0424,3.3 23.7,8.9896002 23.7,15.999999 C 23.7,23.0104 22.0424,28.700001 20,28.700001"
+       id="path4992"
+       sodipodi:nodetypes="ccs"
+       inkscape:export-xdpi="90"
+       inkscape:export-ydpi="90" />
+    <path
+       sodipodi:nodetypes="ccs"
+       id="path4995"
+       d="M 23,1.7000001 C 25.0424,1.7000001 26.7,8.1064003 26.7,16.000001 C 26.7,23.8936 25.0424,30.3 23,30.3"
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1.00000012px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 26.1,0.9 C 28.1424,0.9 29.8,7.6648001 29.8,16 C 29.8,24.3352 28.1424,31.1 26.1,31.1"
+       id="path4997"
+       sodipodi:nodetypes="ccs" />
+  </g>
+</svg>
index 9df944f90bc7d071f446a79e199caa78a310c656..ca0e82d194ac14af7ba631983e0533aa13f94e23 100644 (file)
@@ -2,20 +2,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2004-2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 noinst_LIBRARIES=libdisorder.a
@@ -75,6 +73,7 @@ libdisorder_a_SOURCES=charset.c charset.h             \
        sink.c sink.h                                   \
        speaker-protocol.c speaker-protocol.h           \
        split.c split.h                                 \
+       strptime.c strptime.h                           \
        syscalls.c syscalls.h                           \
        common.h                                        \
        table.c table.h                                 \
@@ -109,7 +108,12 @@ versionstring.h: version-string ${top_srcdir}/scripts/text2c
 
 definitions.h: Makefile
        rm -f $@.new
-       echo "#define PKGLIBDIR \"${pkglibdir}\"" > $@.new
+       echo "/** @file lib/definitions.h" >> $@.new
+       echo " * @brief Definitions exported from makefile" >> $@.new
+       echo " *" >> $@.new
+       echo " * DO NOT EDIT." >> $@.new
+       echo " */" >> $@.new
+       echo "#define PKGLIBDIR \"${pkglibdir}\"" >> $@.new
        echo "#define PKGCONFDIR \"${sysconfdir}/\"PACKAGE" >> $@.new
        echo "#define PKGSTATEDIR \"${localstatedir}/\"PACKAGE" >> $@.new
        echo "#define PKGDATADIR \"${pkgdatadir}/\"" >> $@.new
@@ -131,6 +135,6 @@ rebuild-unicode:
        mv $@.new $@
 
 CLEANFILES=definitions.h definitions.h.new version-string versionstring.h \
-          *.gcda *.gcov *.gcno
+          *.gcda *.gcov *.gcno *.c.html index.html
 
 EXTRA_DIST=trackdb.c trackdb-stub.c
index c7a1e7445ed45a017ab87496a68521fa8f772edf..fecc28c24b467612e3df8b4dbe626ddabcd007de 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/addr.c
  * @brief Socket address support */
index 4049b078dba343f6eaa4180bdfb1190153927ab9..973733f57ae9a2aa74581eb6b44551100ef94acc 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/addr.h
  * @brief Socket address support */
index 336c2a3320adb6c77699d045ed89759744aa4131..56e5c6aa2711909e779bbe130001747ea033774c 100644 (file)
@@ -2,23 +2,27 @@
  * This file is part of DisOrder.
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file alsabg.c
  * @brief Background-thread interface to ALSA
+ *
+ * This wraps ALSA with an interface which calls back to the client from a
+ * thread.  It's not intended for completely general use, just what DisOrder
+ * needs.
+ *
+ * Only builds on Linux systems.
  */
 
 #include "common.h"
@@ -275,6 +279,10 @@ void alsa_bg_init(const char *device,
   ep(pthread_create(&alsa_bg_play_tid, 0, alsa_bg_play, 0));
 }
 
+/** @brief Deinitialize background ALSA playback
+ *
+ * The opposite of alsa_bg_init().
+ */
 void alsa_bg_close(void) {
   void *r;
 
index 57fb64dbe56a05cd5ef524c2999bd22b813ffe83..78c83dc156a01d2384d41f661e613475ee90769e 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file alsabg.h
  * @brief Background-thread interface to ALSA
@@ -31,6 +29,7 @@
 /** @brief Supply audio callback
  * @param dst Where to write audio data
  * @param nsamples Number of samples to write
+ * @return Number of samples written
  *
  * This function should write up to @p *nsamples samples of data at
  * @p dst, and return the number of samples written, or -1 if some error
index 42aaf2b9a3f6bebc52be0c82d3bc50a5db382afb..34505628372061f28c4eaeb109abcc07d9941de2 100644 (file)
  * 02110-1301, USA.
  *
  */
-
-/* Code from Libgcrypt adapted for gnulib by Simon Josefsson. */
-
-/*
+/** @file lib/arcfour.c
+ * @brief Arcfour (RC4-compatible) stream cipher implementation
+ *
+ * Code from Libgcrypt adapted for gnulib by Simon Josefsson.
+ *
  * For a description of the algorithm, see:
+ * 
  *   Bruce Schneier: Applied Cryptography. John Wiley & Sons, 1996.
  *   ISBN 0-471-11709-9. Pages 397 ff.
  */
 
 #include "arcfour.h"
 
+/** @brief Encrypt using Arcfour stream cipher
+ * @param context Context structure
+ * @param inbuf Input buffer
+ * @param outbuf Output buffer
+ * @param length Number of bytes in @p inbuf
+ *
+ * Copies from @p inbuf to @p outbuf, encrypting (or decrypting) using
+ * the stream controlled by @p context.
+ */
 void
 arcfour_stream (arcfour_context * context, const char *inbuf, char *outbuf,
                size_t length)
@@ -54,6 +65,13 @@ arcfour_stream (arcfour_context * context, const char *inbuf, char *outbuf,
   context->idx_j = j;
 }
 
+/** @brief Initialize an @ref arcfour_context
+ * @param context Context structure
+ * @param key Key data
+ * @param keylen Length of key
+ *
+ * Initializes @p context using @p key.
+ */
 void
 arcfour_setkey (arcfour_context * context, const char *key, size_t keylen)
 {
index 0a9d75c0f745fd9c18a84abd3cf4654f326c1084..4993961066a2d641b4c2d65bd2bcf5bae0d9a9df 100644 (file)
@@ -18,6 +18,9 @@
  * 02110-1301, USA.
  *
  */
+/** @file lib/arcfour.h
+ * @brief Arcfour (RC4-compatible) stream cipher implementation
+ */
 
 /* Code from Libgcrypt adapted for gnulib by Simon Josefsson. */
 
@@ -29,6 +32,7 @@
 
 #define ARCFOUR_SBOX_SIZE 256
 
+/** @brief Context structture for Arcfour stream cipher */
 typedef struct
 {
   char sbox[ARCFOUR_SBOX_SIZE];
index 7d7bd315e541f7e0a4de5b559953d8c05a82ed1c..54003395dc85b9a9cc61cf94ca36446db965435d 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/asprintf.c @brief printf() workalikes */
 
index a08390255971175291142bcdcbf59133bb95e3d0..d5da9c5e48ce97470543adeac9c7a593e4f37aa3 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2004, 2006, 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/authhash.c @brief The authorization hash */
 
 
 /** @brief Structure of algorithm lookup table */
 struct algorithm {
+  /** @brief DisOrder algorithm name */
   const char *name;
+
+  /** @brief gcrypt algorithm ID */
   int id;
 };
 
@@ -58,6 +59,7 @@ static const struct algorithm algorithms[] = {
  * @param nchallenge Size of challenge
  * @param password Password
  * @param algo Algorithm to use
+ * @return Hex string or NULL on error
  *
  * Computes H(challenge|password) and returns it as a newly allocated hex
  * string, or returns NULL on error.
index 23713366bd2a88300ed8f871a25062560a1eea05..8604a13948f1a81e602ea15992a87ecc15c35c29 100644 (file)
@@ -1,22 +1,21 @@
 /*
  * This file is part of DisOrder.
- * Copyright (C) 2004, 2006, 2007 Richard Kettlewell
+ * Copyright (C) 2004, 2006, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+/** @file lib/authhash.h @brief The authorization hash */
 #ifndef AUTHHASH_H
 #define AUTHHASH_H
 
index 297533363b1ef92921abe03a0c9d663f4e66d5b6..7d9d3a94d434920947ed14d1d7025073a6bb252e 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/base64.c
  * @brief Support for MIME base64
index 0beb53496560e7710401d5936e00f05745645af6..656552cb12023726f9470cb518a3941a4dffab08 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2005, 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/base64.h
  * @brief Support for MIME base64
index a41a73bc37391f3062336a243566e6ffedb4ae03..87d2795340d28657fd53616e86aff57d30009c99 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/basen.c @brief Arbitrary base conversion 
  *
index 4a3cdad41af578e4947de674b34a44179e87b59b..717f2eaeb48396fa887dc3b3883d9aeb9ceef2a1 100644 (file)
@@ -2,22 +2,20 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-
+/** @file lib/basen.h @brief Arbitrary base conversion */
 #ifndef BASEN_H
 #define BASEN_H
 
index 4ed2402cae9f89613ce230ea0d317a4c6f3a45b0..25ef6a725a3dacf581afa192ea39edb1079c76c8 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 /** @file lib/bits.c
index e0f7c6289991d093833e2886588a3315aca9d0a8..a49d413ab0a4063ed1d198a6705596c57c5e59f4 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 /** @file lib/bits.h
index f812dc6b7e660c8814956a1c90c327e7a7d5d697..e0f69ef6225cff4048914529a6a9b976fa64ac33 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2006-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/cache.c @brief Object caching */
 
index 26fa3dd3588acdfd8af503a27f9ae9c9f2ff50f8..ac9bc0104080934143079e90687f97f9ed284edd 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2006-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/cache.h
  * @brief Object caching
index 8cb04bb8f9170aa30bc4df9251ba01e837c17f7e..42d599f2fa6a845809f3ae309d15a10636b0b39b 100644 (file)
--- a/lib/cgi.c
+++ b/lib/cgi.c
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/cgi.c
  * @brief CGI tools
@@ -258,54 +256,6 @@ char *cgi_sgmlquote(const char *src) {
   return d->vec;
 }
 
-/** @brief Write a CGI attribute
- * @param output Where to send output
- * @param name Attribute name
- * @param value Attribute value
- */
-void cgi_attr(struct sink *output, const char *name, const char *value) {
-  /* Try to avoid needless quoting */
-  if(!value[strspn(value, "abcdefghijklmnopqrstuvwxyz"
-                  "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-                  "0123456789")])
-    sink_printf(output, "%s=%s", name, value);
-  else
-    sink_printf(output, "%s=\"%s\"", name, cgi_sgmlquote(value));
-}
-
-/** @brief Write an open tag
- * @param output Where to send output
- * @param name Element name
- * @param ... Attribute name/value pairs
- *
- * The name/value pair list is terminated by a single (char *)0.
- */
-void cgi_opentag(struct sink *output, const char *name, ...) {
-  va_list ap;
-  const char *n, *v;
-   
-  sink_printf(output, "<%s", name);
-  va_start(ap, name);
-  while((n = va_arg(ap, const char *))) {
-    sink_printf(output, " ");
-    v = va_arg(ap, const char *);
-    if(v)
-      cgi_attr(output, n, v);
-    else
-      sink_printf(output, n);
-  }
-  va_end(ap);
-  sink_printf(output, ">");
-}
-
-/** @brief Write a close tag
- * @param output Where to send output
- * @param name Element name
- */
-void cgi_closetag(struct sink *output, const char *name) {
-  sink_printf(output, "</%s>", name);
-}
-
 /** @brief Construct a URL
  * @param url Base URL
  * @param ... Name/value pairs for constructed query string
index f8f5bf21ab7c4b5680434c61ba380bc68ca158f0..dd27fa218542f209e71be86a0ded1c552048fe7c 100644 (file)
--- a/lib/cgi.h
+++ b/lib/cgi.h
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/cgi.h
  * @brief CGI tools
@@ -30,9 +28,6 @@ void cgi_init(void);
 const char *cgi_get(const char *name);
 void cgi_set(const char *name, const char *value);
 char *cgi_sgmlquote(const char *src);
-void cgi_attr(struct sink *output, const char *name, const char *value);
-void cgi_opentag(struct sink *output, const char *name, ...);
-void cgi_closetag(struct sink *output, const char *name);
 char *cgi_makeurl(const char *url, ...);
 char *cgi_thisurl(const char *url);
 void cgi_clear(void);
index 3c5f88b79cae97c747af797d65df9c384c7d10e2..e9c503ec7a0053afc9948070377084511411098c 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/charset.c @brief Character set conversion */
 
index db5e7375ae6c9d238a7a54380e6b15bde14f3f11..be2b05a45ae5a3ced48f189fb1b69167b701a330 100644 (file)
@@ -1,23 +1,21 @@
-
 /*
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+/** @file lib/charset.h @brief Character set conversion */
 #ifndef CHARSET_H
 #define CHARSET_H
 
index 2c639348019e3d507c89d58a604173e07ade306e..ced82e4fb6eaf71199dc79fd422cb9ae4cbca8d4 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2004, 2005, 2006, 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/client-common.c
+ * @brief Common code to client APIs
  */
 
 #include "common.h"
index d6422785e48703f088e86c54e968af968b4851e8..736ac6f209a363cc936ec4b9af39c25e8e2b8483 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2004-2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/client-common.h
+ * @brief Common code to client APIs
  */
 
 #ifndef CLIENT_COMMON_H
index 5c4cac5af445d0c382012063ac7b7de90bd66004..f8a2c9e39f84ba768d630be57cd38ee284136d00 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/client.c
  * @brief Simple C client
@@ -1361,6 +1359,15 @@ int disorder_schedule_add(disorder_client *c,
   return rc;
 }
 
+/** @brief Adopt a track
+ * @param c Client
+ * @param id Track ID to adopt
+ * @return 0 on success, non-0 on error
+ */
+int disorder_adopt(disorder_client *c, const char *id) {
+  return disorder_simple(c, 0, "adopt", id, (char *)0);
+}
+
 /** @brief Delete a playlist
  * @param c Client
  * @param playlist Playlist to delete
index 37920bac42686e8e468e838f64c3e5365bce43ca..f7ff7289198a2107c3d33753d33918e72dcd79d0 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/client.h
  * @brief Simple C client
@@ -133,6 +131,7 @@ int disorder_schedule_add(disorder_client *c,
                          const char *priority,
                          const char *action,
                          ...);
+int disorder_adopt(disorder_client *c, const char *id);
 int disorder_playlist_delete(disorder_client *c,
                              const char *playlist);
 int disorder_playlist_get(disorder_client *c, const char *playlist,
index 77a2cd9ccca803fb99028fb2150b14148d9a6993..2ca41a69b88852f3572200e0ccea36a2acd20495 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/common.h
  * @brief Common includes and definitions
index 934e52b698535fd039d86082376a4dbf048836d4..cd83224cb50138a678b80a7f35a462f714abfeef 100644 (file)
@@ -3,20 +3,18 @@
  * Copyright (C) 2004-2008 Richard Kettlewell
  * Portions copyright (C) 2007 Mark Wooding
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/configuration.c
  * @brief Configuration file support
@@ -1199,7 +1197,8 @@ static struct config *config_default(void) {
   c->new_max = 100;
   c->reminder_interval = 600;          /* 10m */
   c->new_bias_age = 7 * 86400;         /* 1 week */
-  c->new_bias = 9000000;               /* 100 times the base weight */
+  c->new_bias = 4500000;               /* 50 times the base weight */
+  c->sox_generation = DEFAULT_SOX_GENERATION;
   c->playlist_max = INT_MAX;            /* effectively no limit */
   c->playlist_lock_timeout = 10;        /* 10s */
   /* Default stopwords */
@@ -1252,7 +1251,7 @@ static void config_postdefaults(struct config *c,
   int n;
 
   static const char *namepart[][4] = {
-    { "title",  "/([0-9]+ *[-:] *)?([^/]+)\\.[a-zA-Z0-9]+$", "$2", "display" },
+    { "title",  "/([0-9]+ *[-:]? *)?([^/]+)\\.[a-zA-Z0-9]+$", "$2", "display" },
     { "title",  "/([^/]+)\\.[a-zA-Z0-9]+$",           "$1", "sort" },
     { "album",  "/([^/]+)/[^/]+$",                    "$1", "*" },
     { "artist", "/([^/]+)/[^/]+/[^/]+$",              "$1", "*" },
@@ -1261,7 +1260,7 @@ static void config_postdefaults(struct config *c,
 #define NNAMEPART (int)(sizeof namepart / sizeof *namepart)
 
   static const char *transform[][5] = {
-    { "track", "^.*/([0-9]+ *[-:] *)?([^/]+)\\.[a-zA-Z0-9]+$", "$2", "display", "" },
+    { "track", "^.*/([0-9]+ *[-:]? *)?([^/]+)\\.[a-zA-Z0-9]+$", "$2", "display", "" },
     { "track", "^.*/([^/]+)\\.[a-zA-Z0-9]+$",           "$1", "sort", "" },
     { "dir",   "^.*/([^/]+)$",                          "$1", "*", "" },
     { "dir",   "^(the) ([^/]*)",                        "$2, $1", "sort", "i", },
index b94b684f2345630c228ed56abda8f6a0d4a87aaf..54fb4f8eebff6abbd7c7b5910a54c41fa2d1056d 100644 (file)
@@ -3,20 +3,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/configuration.h
  * @brief Configuration file support
index 40e3c3ee7cbd0ed45bb641ec7d547f1f862ea44b..0ff17b5410643eb83efca8f6438cc24a713fb7a6 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/cookies.c
  * @brief Cookie support
index ea6e41277748be998f91a3886ac1efd813bf38cb..66b853b02f36126f9d63b08c65a63bb0ea148e30 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/cookies.h
  * @brief Cookie support
index f390d0c778186a57433359cb8711df64ca245bad..be96e8f437377590dc9b90aa7d05cfd8f06b841c 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 /** @file lib/dateparse.c
  * This set of patterns is designed to parse a specific time of a specific day,
  * since that's what the scheduler needs.  Other requirements might need other
  * pattern lists.
+ *
+ * NB DisOrder now uses my_strptime() instead of the system strptime().  This
+ * has some bits missing.  Therefore check carefuly before adding to this
+ * table.
  */
 static const char *const datemsk[] = {
   /* ISO format */
index 7b96fe9b0688996786074c86427c3a50efafc1b0..dc37a6a5c2dad34af0df9c9e4b4671ce2cb99c8c 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/dateparse.h
  * @brief Date parsing
index 67f7951934700df6e5f64595c0ef5db9c9a8d9bc..633d56adb719b0785bfa01ab100e09c8cfd8fa3a 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/defs.c @brief Definitions chosen by configure
  *
index 73d633e8b655ab43b8fe1e4a9730de3d69a13249..41b65ea584254f7b5a3fbce6ef0b1415a25c7ea0 100644 (file)
@@ -2,22 +2,20 @@
  * This file is part of DisOrder
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-
+/** @file lib/defs.h @brief Definitions chosen by configure */
 #ifndef DEFS_H
 #define DEFS_H
 
index 856f0a349e73d15dca48af1066e6082eeb7ad8c1..cb0c070e8ca7562f67b2509cfb4ca8c8f28cf888 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifndef DISORDER_H
index 8e89a3122ce038ee72aa458af27c58cdff353e7c..676aa06aa745118457dbefe0f0f21d7e71f8b479 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2006-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/eclient.c
  * @brief Client code for event-driven programs
@@ -191,6 +189,7 @@ static void logentry_user_confirm(disorder_eclient *c, int nvec, char **vec);
 static void logentry_user_delete(disorder_eclient *c, int nvec, char **vec);
 static void logentry_user_edit(disorder_eclient *c, int nvec, char **vec);
 static void logentry_rights_changed(disorder_eclient *c, int nvec, char **vec);
+static void logentry_adopted(disorder_eclient *c, int nvec, char **vec);
 static void logentry_playlist_created(disorder_eclient *c, int nvec, char **vec);
 static void logentry_playlist_deleted(disorder_eclient *c, int nvec, char **vec);
 static void logentry_playlist_modified(disorder_eclient *c, int nvec, char **vec);
@@ -210,6 +209,7 @@ struct logentry_handler {
 /** @brief Table for parsing log entries */
 static const struct logentry_handler logentry_handlers[] = {
 #define LE(X, MIN, MAX) { #X, MIN, MAX, logentry_##X }
+  LE(adopted, 2, 2),
   LE(completed, 1, 1),
   LE(failed, 2, 2),
   LE(moved, 1, 1),
@@ -1465,6 +1465,20 @@ int disorder_eclient_adduser(disorder_eclient *c,
                 "adduser", user, password, rights, (char *)0);
 }
 
+/** @brief Adopt a track
+ * @param c Client
+ * @param completed Called on completion
+ * @param id Track ID
+ * @param v Passed to @p completed
+ */
+int disorder_eclient_adopt(disorder_eclient *c,
+                           disorder_eclient_no_response *completed,
+                           const char *id,
+                           void *v) {
+  return simple(c, no_response_opcallback, (void (*)())completed, v, 
+                "adopt", id, (char *)0);
+}
+
 /** @brief Get the list of playlists
  * @param c Client
  * @param completed Called with list of playlists
@@ -1877,6 +1891,12 @@ char *disorder_eclient_interpret_state(unsigned long statebits) {
   return d->vec;
 }
 
+static void logentry_adopted(disorder_eclient *c,
+                             int attribute((unused)) nvec, char **vec) {
+  if(c->log_callbacks->adopted) 
+    c->log_callbacks->adopted(c->log_v, vec[0], vec[1]);
+}
+
 /*
 Local Variables:
 c-basic-offset:2
index 2bbc3676001df11722a4b35e51c7f33a9beb2714..fae610c99bd3e2ba7f16a79d5f88de96ee522f9d 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2006-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/eclient.h
  * @brief Client code for event-driven programs
@@ -127,7 +125,7 @@ typedef struct disorder_eclient_log_callbacks {
   /** @brief Called when @p id is removed from the recent list */
   void (*recent_removed)(void *v, const char *id);
 
-  /** @brief Called when @id is removed from the queue
+  /** @brief Called when @id is removed from the queue
    *
    * @p user might be 0.
    */
@@ -168,6 +166,9 @@ typedef struct disorder_eclient_log_callbacks {
   /** @brief Called when your rights change */
   void (*rights_changed)(void *v, rights_type new_rights);
 
+  /** @brief Called when a track is adopted */
+  void (*adopted)(void *v, const char *id, const char *who);
+
   /** @brief Called when a new playlist is created */
   void (*playlist_created)(void *v, const char *playlist, const char *sharing);
 
@@ -496,6 +497,10 @@ int disorder_eclient_adduser(disorder_eclient *c,
                              void *v);
 void disorder_eclient_enable_connect(disorder_eclient *c);
 void disorder_eclient_disable_connect(disorder_eclient *c);
+int disorder_eclient_adopt(disorder_eclient *c,
+                           disorder_eclient_no_response *completed,
+                           const char *id,
+                           void *v);  
 int disorder_eclient_playlists(disorder_eclient *c,
                                disorder_eclient_list_response *completed,
                                void *v);
index fb2f744cf39574c05a2666f94eca90edbdcbddb3..3fb289f03e12624aa676e15021615fffdf770750 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 /** @file lib/email.c
index 7c12b6fc41ae47aa53a60dbe87685259be506623..ee25024c594369c8818471dd6b2b07a5a2ed778f 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/event.c
  * @brief DisOrder event loop
@@ -313,6 +311,8 @@ int ev_fd(ev_source *ev,
 
   D(("registering %s fd %d callback %p %p", modenames[mode], fd,
      (void *)callback, u));
+  if(fd >= FD_SETSIZE)
+    return -1;
   assert(mode < ev_nmodes);
   if(ev->mode[mode].nfds >= ev->mode[mode].fdslots) {
     ev->mode[mode].fdslots = (ev->mode[mode].fdslots
@@ -519,7 +519,9 @@ static void sighandler(int s) {
 
   /* probably the reader has stopped listening for some reason */
   if(write(sigfd[s], &sc, 1) < 0) {
-    write(2, errmsg, sizeof errmsg - 1);
+       /* do the best we can as we're about to abort; shut _up_, gcc */
+       int _ignore = write(2, errmsg, sizeof errmsg - 1);
+       (void)_ignore;
     abort();
   }
 }
index c666d81f3e50dde414bf839c257f070c4b1dd353..2838c41412f994387ddcca4ad3e09bc2304969ea 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/event.h
+ * @brief DisOrder event loop
  */
-
 #ifndef EVENT_H
 #define EVENT_H
 
index b2d27d953667d76d04cb496ab31028ce6926d086..37893b6ef1cc30fd5dfdf6d60441ea00002b5e0d 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/eventdist.c
+ * @brief Event distribution
  */
-
 #include "common.h"
 
 #include "mem.h"
index a25929cf70fdd45550652f040b93ae67af93f898..367d8165ff142273ff41398bff889719b3ed233c 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/eventdist.h
+ * @brief Event distribution
  */
-
 #ifndef EVENTDIST_H
 #define EVENTDIST_H
 
index 9c7f4fb72c93e3a9fa8a3b1ed19ba6db079dbf17..a56884b33d50b3874f3f537eca2b5daedbfb3b5a 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/eventlog.c
+ * @brief Event logging
  */
-
 #include "common.h"
 
 #include <stdarg.h>
index 65497960621b966c2148b3c65b69a55bdae27c53..87eea513495368e51c3ee588b54477f00cf40923 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/eventlog.h
+ * @brief Event logging
  */
-
 #ifndef EVENTLOG_H
 #define EVENTLOG_H
 
index b772002e828045874b018351a31af7caf6113523..20889afce4ed9f5b759d07ce35a40132da7bfda1 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2005, 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/filepart.c
  * @brief Filename parsing
@@ -28,8 +26,8 @@
 
 /** @brief Parse a filename
  * @param path Filename to parse
- * @param Where to put directory name, or NULL
- * @param Where to put basename, or NULL
+ * @param dirnamep Where to put directory name, or NULL
+ * @param basenamep Where to put basename, or NULL
  */
 static void parse_filename(const char *path,
                            char **dirnamep,
@@ -104,7 +102,7 @@ char *d_dirname(const char *path) {
 }
 
 /** @brief Return the basename part of @p path
- * @param Path to parse
+ * @param path Path to parse
  * @return Base part of @p path
  *
  * Extracts the base part of @p path.  This is a simple lexical transformation
index 9b6cf62081fe27fb62a0998db67a9b7af7c6de23..a0189f28624b88ca7d915bc598b2228154c388be 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2005, 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/filepart.h
  * @brief Filename parsing
index 741a31e4115f18d477ce462b9de4880da15aeca6..b4de8300cd8175706198245c986523e70641862b 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2004, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/fprintf.c
+ * @brief UTF-8 workalike for fprintf() and vfprintf()
  */
 
 #include "common.h"
index f730a585da12a34dd8acdb1cdebdee9c61832c32..d507d0a376b86473125843720e2062bce3dd6d19 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder
  * Copyright (C) 2005-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/hash.c
+ * @brief A simple hash table
  */
-
 #include "common.h"
 
 #include "hash.h"
index 3dfb0edc8208644bc08707f66e877b7b0b82a318..e932f4b359b93534b0dd08a2ee05757be5ab140a 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2005-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/hash.h
+ * @brief A simple hash table
  */
 
 #ifndef HASH_H
index c6504efedba2af5e1e501eca0c9048832aec6d18..b5a8930818c0048dd011337f37129d197b56954f 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/heap.h @brief Binary heap template */
 
index e0542ce1c73d067d62ebe1fec7d3b6a1d941b634..4ae9d6756f8a2df027628081e6b7fd3e91620bb9 100644 (file)
--- a/lib/hex.c
+++ b/lib/hex.c
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/hex.c @brief Hexadecimal encoding and decoding */
 
index 6ae642c4222bee7bb65f3f8dd1ec7133c94b458a..150621970f4928ccb01a1a9f13113e769098bf0c 100644 (file)
--- a/lib/hex.h
+++ b/lib/hex.h
@@ -2,21 +2,20 @@
  * This file is part of DisOrder
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+/** @file lib/hex.h @brief Hexadecimal encoding and decoding */
 
 #ifndef HEX_H
 #define HEX_H
index ee7ed49cb4b5125f9c4f089c7b4c095edf2feafd..292b3add4e2b6d094679a891a6e16d0b45996d5c 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/hostname.c
+ * @brief Get the local hostname
  */
 
 #include "common.h"
index 89bfeaafca5a3c843c847630175b91c14c1f3a3c..38808ee2d274bd0bdf02ea4d83eaef72ad751c68 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/hostname.h
+ * @brief Get the local hostname
  */
 
 #ifndef HOSTNAME_H
index 3ec92b0163a4d2f211da655c8d02a72da6655b36..46326adf0d28d7909562d10a622b8e3a6eff9070 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/ifreq.c
  * @brief Network interface support
index 3f2dd9dc38f50ca0569b42db43bb21bccc398022..cbb414b57b7344e90670ff1234ed21d623018637 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/ifreq.h
  * @brief Network interface support
index 8882f573fcd5e45a8de5f8da8846cf4badf9b0e8..5894546113b63a6970a4176a55cec8e60d99b4bf 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/inputline.c
  * @brief Line input
index 96f590799742deeda35fb0390788146e1d22b55b..a844194c6382fe5fa853143f58b8d4ed7854f276 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/inputline.h
+ * @brief Line input
  */
 
 #ifndef INPUTLINE_H
index c56249d2e707df687768fd4708e2ae96786e9226..5a116deab632720b1c31c31d1ac4dc495961d457 100644 (file)
--- a/lib/kvp.c
+++ b/lib/kvp.c
@@ -2,20 +2,25 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/kvp.c
+ * @brief Linked list of key-value pairs
  *
- * 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.
+ * Also supports URL encoding/decoding (of raw strings and kvp lists).
  *
- * 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
+ * For large sets of keys, see @ref lib/hash.c.
  */
 
 #include "common.h"
 #include "hex.h"
 #include "sink.h"
 
+/** @brief Decode a URL-encoded string to a ink
+ * @param sink Where to store result
+ * @param ptr Start of string
+ * @param n Length of string
+ * @return 0 on success, non-0 if string could not be decoded or sink write failed
+ */
 int urldecode(struct sink *sink, const char *ptr, size_t n) {
   int c, d1, d2;
   
@@ -64,6 +75,15 @@ static char *decode(const char *ptr, size_t n) {
   return d.vec;
 }
 
+/** @brief Decode a URL-decoded key-value pair list
+ * @param ptr Start of input string
+ * @param n Length of input string
+ * @return @ref kvp of values from input
+ *
+ * The KVP is in the same order as the original input.
+ *
+ * If the original input contains duplicates names, so will the KVP.
+ */
 struct kvp *kvp_urldecode(const char *ptr, size_t n) {
   struct kvp *kvp, **kk = &kvp, *k;
   const char *q, *r, *top = ptr + n, *next;
@@ -87,6 +107,12 @@ struct kvp *kvp_urldecode(const char *ptr, size_t n) {
   return kvp;
 }
 
+/** @brief URL-encode a string to a sink
+ * @param sink Where to send output
+ * @param s String to encode
+ * @param n Length of string to encode
+ * @return 0 on success or non-0 if sink write failed
+ */
 int urlencode(struct sink *sink, const char *s, size_t n) {
   unsigned char c;
 
@@ -148,6 +174,11 @@ char *urldecodestring(const char *s, size_t ns) {
   return d.vec;
 }
 
+/** @brief URL-encode a KVP
+ * @param kvp Linked list to encode
+ * @param np Where to store length (or NULL)
+ * @return Newly created string
+ */
 char *kvp_urlencode(const struct kvp *kvp, size_t *np) {
   struct dynstr d;
   struct sink *sink;
@@ -168,6 +199,20 @@ char *kvp_urlencode(const struct kvp *kvp, size_t *np) {
   return d.vec;
 }
 
+/** @brief Set or remove a value in a @ref kvp
+ * @param kvpp Address of KVP head to modify
+ * @param name Key to search for
+ * @param value New value or NULL to delete
+ * @return 1 if any change was made otherwise 0
+ *
+ * If @p value is not NULL then the first matching key is replaced; if
+ * there was no matching key a new one is added at the end.
+ *
+ * If @p value is NULL then the first matching key is removed.
+ *
+ * If anything actually changes the return value is 1.  If no actual
+ * change is made then 0 is returned instead.
+ */
 int kvp_set(struct kvp **kvpp, const char *name, const char *value) {
   struct kvp *k, **kk;
 
@@ -195,12 +240,29 @@ int kvp_set(struct kvp **kvpp, const char *name, const char *value) {
   }
 }
 
+/** @brief Look up a value in a @ref kvp
+ * @param kvp Head of KVP linked list
+ * @param name Key to search for
+ * @return Value or NULL
+ *
+ * The returned value is owned by the KVP so must not be modified or
+ * freed.
+ */
 const char *kvp_get(const struct kvp *kvp, const char *name) {
   for(;kvp && strcmp(kvp->name, name); kvp = kvp->next)
     ;
   return kvp ? kvp->value : 0;
 }
 
+/** @brief Construct a KVP from arguments
+ * @param name First name
+ * @return Newly created KVP
+ *
+ * Arguments must come in name/value pairs and must be followed by a (char *)0.
+ *
+ * The order of the new KVP is not formally defined though the test
+ * programs rely on it nonetheless so update them if you change it.
+ */
 struct kvp *kvp_make(const char *name, ...) {
   const char *value;
   struct kvp *kvp = 0, *k;
@@ -211,7 +273,7 @@ struct kvp *kvp_make(const char *name, ...) {
     value = va_arg(ap, const char *);
     k = xmalloc(sizeof *k);
     k->name = name;
-    k->value = value ? xstrdup(value) : value;
+    k->value = value ? xstrdup(value) : "";
     k->next = kvp;
     kvp = k;
     name = va_arg(ap, const char *);
index dcdca5f89df80136370ef07a6887d0cb8e94a04d..0a7e4780d0af3691c25ea3a10043406f78e26c0f 100644 (file)
--- a/lib/kvp.h
+++ b/lib/kvp.h
@@ -2,20 +2,21 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/kvp.h
+ * @brief Linked list of key-value pairs
  */
 
 #ifndef KVP_H
 struct dynstr;
 struct sink;
 
+/** @brief Linked list of key-value pairs */
 struct kvp {
-  struct kvp *next;                    /* next entry */
-  const char *name;                    /* name */
-  const char *value;                   /* value */
+  /** @brief Next entry */
+  struct kvp *next;
+
+  /** @brief Name
+   *
+   * Might not be unique.  Must not be null.
+   */
+  const char *name;
+
+  /** @brief Value
+   *
+   * Must not be null.
+   */
+  const char *value;
 };
 
 struct kvp *kvp_urldecode(const char *ptr, size_t n);
index d42cec48344731ce7860491dbb2d8e1d805fd94f..de47cf2730ebcda677cc8678323165a7ec4f4b34 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/log-impl.h @brief Errors and logging */
 
index 24f9427f3c808ae9fc3e8917e5240a2b934f2c0a..f885e880023e45a694eeabf590b1f16b43c86f4c 100644 (file)
--- a/lib/log.c
+++ b/lib/log.c
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/log.c @brief Errors and logging
  *
index d112685ce2178b8a0a15738f4af68a5cdfcd1ab9..e7f6e43c221026e6666ad5db172f38c33ad59bcd 100644 (file)
--- a/lib/log.h
+++ b/lib/log.h
@@ -2,20 +2,21 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/log.h
+ * @brief Errors and logging
  */
 
 #ifndef LOG_H
index 1baaff2bbf930a3df6b4ac646687e1aee4e8013a..a6f14c3022a44766c350158340967ef027a06548 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2005, 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/logfd.c
+ * @brief Redirect subprocess stderr to DisOrder server's log
  */
 
 #include "common.h"
index 31e7f49d96f6155d997e6ac86499703b4ffb92ae..ad4370059fab96fa1edd7aa9718fe9cb1b5941d2 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/logfd.h
+ * @brief Redirect subprocess stderr to DisOrder server's log
  */
 
 #ifndef LOGFD_H
index ec5628da145ff145ab2ba9fd785c5a821ab3f202..3d49c253248c1db68f05fd6be52d513e3d0ba8c6 100644 (file)
@@ -2,27 +2,33 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 /** @file lib/macros-builtin.c
  * @brief Built-in expansions
  *
- * This is a grab-bag of non-domain-specific expansions.  Documentation will be
- * generated from the comments at the head of each function.
+ * This is a grab-bag of non-domain-specific expansions
+ *
+ * Documentation is generated from the comments at the head of each function.
+ * The comment should have a '$' and the expansion name on the first line and
+ * should have a blank line between each paragraph.
+ *
+ * To make a bulleted list, put a '-' at the start of each line.
+ *
+ * You can currently get away with troff markup but this is horribly ugly and
+ * might be changed.
  */
 
 #include "common.h"
@@ -93,7 +99,7 @@ char *mx_find(const char *name, int report) {
   return path;
 }
 
-/*! @include{TEMPLATE}@
+/*$ @include{TEMPLATE}
  *
  * Includes TEMPLATE.
  *
@@ -148,7 +154,7 @@ static int exp_include(int attribute((unused)) nargs,
   return 0;
 }
 
-/*! @include{COMMAND}@
+/*$ @include{COMMAND}
  *
  * Executes COMMAND via the shell (using "sh -c") and copies its
  * standard output to the template output.  The shell command output
@@ -197,7 +203,7 @@ static int exp_shell(int attribute((unused)) nargs,
   return 0;
 }
 
-/*! @if{CONDITION}{IF-TRUE}{IF-FALSE}@
+/*$ @if{CONDITION}{IF-TRUE}{IF-FALSE}
  *
  * If CONDITION is "true" then evaluates to IF-TRUE.  Otherwise
  * evaluates to IF-FALSE.  The IF-FALSE part is optional.
@@ -219,7 +225,7 @@ static int exp_if(int nargs,
     return 0;
 }
 
-/*! @and{BRANCH}{BRANCH}...@
+/*$ @and{BRANCH}{BRANCH}...
  *
  * Expands to "true" if all the branches are "true" otherwise to "false".  If
  * there are no brances then the result is "true".  Only as many branches as
@@ -245,7 +251,7 @@ static int exp_and(int nargs,
   return mx_bool_result(output, result);
 }
 
-/*! @or{BRANCH}{BRANCH}...@
+/*$ @or{BRANCH}{BRANCH}...
  *
  * Expands to "true" if any of the branches are "true" otherwise to "false".
  * If there are no brances then the result is "false".  Only as many branches
@@ -271,7 +277,7 @@ static int exp_or(int nargs,
   return mx_bool_result(output, result);
 }
 
-/*! @not{CONDITION}@
+/*$ @not{CONDITION}
  *
  * Expands to "true" unless CONDITION is "true" in which case "false".
  */
@@ -282,7 +288,7 @@ static int exp_not(int attribute((unused)) nargs,
   return mx_bool_result(output, !mx_str2bool(args[0]));
 }
 
-/*! @#{...}@
+/*$ @#{...}
  *
  * Expands to nothing.  The argument(s) are not fully evaluated, and no side
  * effects occur.
@@ -294,7 +300,7 @@ static int exp_comment(int attribute((unused)) nargs,
   return 0;
 }
 
-/*! @urlquote{STRING}@
+/*$ @urlquote{STRING}
  *
  * URL-quotes a string, i.e. replaces any characters not safe to use unquoted
  * in a URL with %-encoded form.
@@ -309,7 +315,7 @@ static int exp_urlquote(int attribute((unused)) nargs,
     return 0;
 }
 
-/*! @eq{S1}{S2}...@
+/*$ @eq{S1}{S2}...
  *
  * Expands to "true" if all the arguments are identical, otherwise to "false"
  * (i.e. if any pair of arguments differs).
@@ -333,7 +339,7 @@ static int exp_eq(int nargs,
   return mx_bool_result(output, result);
 }
 
-/*! @ne{S1}{S2}...@
+/*$ @ne{S1}{S2}...
  *
  * Expands to "true" if all of the arguments differ from one another, otherwise
  * to "false" (i.e. if any value appears more than once).
@@ -357,7 +363,7 @@ static int exp_ne(int nargs,
   return mx_bool_result(output, result);
 }
 
-/*! @discard{...}@
+/*$ @discard{...}
  *
  * Expands to nothing.  Unlike the comment expansion @#{...}, side effects of
  * arguments are not suppressed.  So this can be used to surround a collection
@@ -370,7 +376,7 @@ static int exp_discard(int attribute((unused)) nargs,
   return 0;
 }
 
-/*! @define{NAME}{ARG1 ARG2...}{DEFINITION}@
+/*$ @define{NAME}{ARG1 ARG2...}{DEFINITION}
  *
  * Define a macro.  The macro will be called NAME and will act like an
  * expansion.  When it is expanded, the expansion is replaced by DEFINITION,
@@ -393,7 +399,7 @@ static int exp_define(int attribute((unused)) nargs,
   return 0;
 }
 
-/*! @basename{PATH}
+/*$ @basename{PATH}
  *
  * Expands to the UNQUOTED basename of PATH.
  */
@@ -404,7 +410,7 @@ static int exp_basename(int attribute((unused)) nargs,
   return sink_writes(output, d_basename(args[0])) < 0 ? -1 : 0;
 }
 
-/*! @dirname{PATH}
+/*$ @dirname{PATH}
  *
  * Expands to the UNQUOTED directory name of PATH.
  */
@@ -415,7 +421,7 @@ static int exp_dirname(int attribute((unused)) nargs,
   return sink_writes(output, d_dirname(args[0])) < 0 ? -1 : 0;
 }
 
-/*! @q{STRING}
+/*$ @q{STRING}
  *
  * Expands to STRING.
  */
index 7b7714423ac02c6a45544d74453b7b255c6d16ff..d194ef5242b07f386eff91a1a23f68a064b9eeac 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 /** @file lib/macros.c
index e9b0af5250f1166ea796a6a199196b00b79f189e..d908fca3572157906d09b4311b9112180142470d 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 /** @file lib/macros.h
index 08978bd2ac1d611c75a450f651f56c5dea9b5853..b3a16bb16db552e12ad70a4e0c3dc7f436ed355b 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 int disorder_asprintf(char **rp, const char *fmt, ...) {
index 10fffe3ba5f8ad278266db873dd701be40dbda7f..5f08b90a050bdf8daaaff4f70bc1fb26a0dbb852 100644 (file)
--- a/lib/mem.c
+++ b/lib/mem.c
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2006, 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/mem.c
  * @brief Memory management
index 2b0396dbba03c57c7f7f4cb5a43d3c095dfb0efc..2aa70aaf57d644eb6d2917f6b922a251e9d81675 100644 (file)
--- a/lib/mem.h
+++ b/lib/mem.h
@@ -2,20 +2,21 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/mem.h
+ * @brief Memory management
  */
 
 #ifndef MEM_H
index 1fbb30f41af80307c8e98ffe924ada0aef2d6610..4b7dabeb9f8097263acea3ccfc3e7270fe2e1836 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder.
  * Copyright (C) 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/memgc.c
+ * @brief Memory management with garbage collection
  */
 
 #define GC 1
index b7975f2097cfa1f7b9c2b380cce6492fd57f58ab..6bff61d6e382d4ef56f030b8fd3c7a7f1d8162c6 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/mime.c
  * @brief Support for MIME and allied protocols
index 1fdf9b74c0792b1cce659375096c2d3fdefa1274..c3292fd40a5ceff2f466ce001deca097758fe343 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/mime.h
  * @brief Support for MIME and allied protocols
index 4ba684f75eb0808a605f5f47e54e842cb466824f..1ab85ab3ad3070daccd40e1122fefe21bd879c6a 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/mixer-alsa.c
  * @brief ALSA mixer support
index 158b6f610c7efb9eb413bcdcff8ba60f19e82b51..a4ee419c18d7f671a3bdbfc958ed486b9ea20c6c 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2004, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/mixer-oss.c
  * @brief OSS mixer support
index 36acd7337feda5f03067f86e70b6a4e1b94c5ee3..a24f7eb3fef975a318f4633b97749abd0df26e00 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/mixer.c
  * @brief Mixer support
index 5e05c6a2cefc83ffc5e471c238c1db0f97d00d45..3d4224647d212465c7326cb905b07e5c609d63c8 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2004, 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/mixer.h
  * @brief Mixer support
index ed6af66c78f44b4b491f2cdfa50971f9a6388af6..f921791ed32961b6c12959a1e070e1a30d44fd0e 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2004, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/printf.c
+ * @brief UTF-8 *printf workalike (core)
  */
 
 #define NO_MEMORY_ALLOCATION
index fd052b0a37e12b39b8d3db566ba1060f24bd60d0..9adb9ab40b4106bdc2fdd9467d2e8df6eaf717b5 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2004, 2006-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/printf.h
+ * @brief UTF-8 *printf workalikes
  */
 #ifndef PRINTF_H
 #define PRINTF_H
index 4205d26f07400d503c0f9154cb16f992e8f51dc7..d371b28eb37dd3fafc8bc85de88a7b632590edc1 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/queue-rights.c
  * @brief Various rights-checking operations
index 084907023222b3e421795c07e5e41c001306b8bb..333fe7d0d40e0fe8c5b9765a6185a54e24cd5bce 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/queue.c
+ * @brief Track queues
  */
-
 #include "common.h"
 
 #include <errno.h>
@@ -31,7 +31,7 @@
 #include "table.h"
 #include "printf.h"
 
-const char *playing_states[] = {
+const char *const playing_states[] = {
   "failed",
   "isscratch",
   "no_player",
@@ -44,6 +44,15 @@ const char *playing_states[] = {
   "unplayed"
 };
 
+/** @brief String values for @c origin field */
+const char *const track_origins[] = {
+  "adopted",
+  "picked",
+  "random",
+  "scheduled",
+  "scratch",
+};
+
 #define VALUE(q, offset, type) *(type *)((char *)q + offset)
 
 /* add new entry @n@ to a doubly linked list just after @b@ */
@@ -139,10 +148,31 @@ static int unmarshall_state(char *data, struct queue_entry *q,
   return 0;
 }
 
+static int unmarshall_origin(char *data, struct queue_entry *q,
+                             size_t offset,
+                             void (*error_handler)(const char *, void *),
+                             void *u) {
+  int n;
+
+  if((n = table_find(track_origins, 0, sizeof (char *),
+                    sizeof track_origins / sizeof *track_origins,
+                    data)) < 0) {
+    D(("origin=[%s] n=%d", data, n));
+    error_handler("invalid origin", u);
+    return -1;
+  }
+  VALUE(q, offset, enum track_origin) = n;
+  return 0;
+}
+
 static const char *marshall_state(const struct queue_entry *q, size_t offset) {
   return playing_states[VALUE(q, offset, enum playing_state)];
 }
 
+static const char *marshall_origin(const struct queue_entry *q, size_t offset) {
+  return track_origins[VALUE(q, offset, enum track_origin)];
+}
+
 #define F(n, h) { #n, offsetof(struct queue_entry, n), marshall_##h, unmarshall_##h }
 
 static const struct field {
@@ -156,6 +186,7 @@ static const struct field {
   /* Keep this table sorted. */
   F(expected, time_t),
   F(id, string),
+  F(origin, origin),
   F(played, time_t),
   F(scratched, string),
   F(sofar, long),
index e466c954685a802930013a569069c0c3a884e3fe..1c70cfde8ffe2a22fcb6c63e02f2aad0ae00e4c2 100644 (file)
  * This file is part of DisOrder.
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/queue.h
+ * @brief Track queues
+ *
+ * Used for the queue, the recently played list and the currently playing
+ * track, both in the server and in clients.
  */
-
 #ifndef QUEUE_H
 #define QUEUE_H
 
 #include <time.h>
 
-
+/** @brief Possible track states */
 enum playing_state {
-  playing_failed,                      /* failed to play */
-  playing_isscratch,                   /* this is a scratch track */
-  playing_no_player,                   /* couldn't find a player */
-  playing_ok,                          /* played OK */
-  playing_paused,                      /* started but paused */
-  playing_quitting,                    /* interrupt because server quit */
-  playing_random,                      /* unplayed randomly chosen track */
-  playing_scratched,                   /* was scratched */
-  playing_started,                     /* started to play */
-  playing_unplayed                     /* haven't played this track yet */
+  /** @brief Track failed to play */
+  playing_failed,
+
+  /** @brief OBSOLETE
+   *
+   * Formerly denoted an unplayed scratch.  This is now indicated by @p
+   * playing_unplayed and @p origin_scratch.
+   */
+  playing_isscratch,
+
+  /** @brief Could not find a player
+   *
+   * Obsolete - nothing sets this any more
+   */
+  playing_no_player,
+
+  /** @brief Play completed successfully
+   *
+   * Currently this actually means it finished decoding - it might still be
+   * buffered in the speaker, RTP player, sound card, etc.
+   *
+   * It might also mean that it's a (short!) track that hasn't been played at
+   * all yet but has been fully decoded ahead of time!  (This is very confusing
+   * so might change.)
+   */
+  playing_ok,
+
+  /** @brief Track is playing, but paused */
+  playing_paused,
+
+  /** @brief Track is playing but the server is quitting */
+  playing_quitting,
+
+  /** @brief OBSOLETE
+   *
+   * Formerly this meant a track that was picked at random and has not yet been
+   * played.  This situation is now indicated by @p playing_unplayed and @p
+   * origin_random (or @p origin_adopted).
+   */
+  playing_random,
+
+  /** @brief Track was scratched */
+  playing_scratched,
+
+  /** @brief Track is now playing
+   *
+   * This refers to the actual playing track, not something being decoded ahead
+   * of time.
+   */
+  playing_started,
+
+  /** @brief Track has not been played yet */
+  playing_unplayed
+};
+
+extern const char *const playing_states[];
+
+/** @brief Possible track origins
+ *
+ * This is a newly introduced field.  The aim is ultimately to separate the
+ * concepts of the track origin and its current state.  NB that both are
+ * potentially mutable!
+ */
+enum track_origin {
+  /** @brief Track was picked at random and then adopted by a user
+   *
+   * @c submitter identifies who adopted it.
+   */
+  origin_adopted,
+
+  /** @brief Track was picked by a user
+   *
+   * @c submitter identifies who picked it
+   */
+  origin_picked,
+
+  /** @brief Track was picked at random
+   *
+   * @c submitter will be NULL
+   */
+  origin_random,
+
+  /** @brief Track was scheduled by a user
+   *
+   * @c submitter identifies who picked it
+   */
+  origin_scheduled,
+
+  /** @brief Track is a scratch
+   *
+   * @c submitter identifies who did the scratching
+   */
+  origin_scratch
 };
 
-extern const char *playing_states[];
+extern const char *const track_origins[];
 
-/* queue entries form a circular doubly-linked list */
+/** @brief One queue/recently played entry
+ *
+ * The queue and recently played list form a doubly linked list with the head
+ * and tail referred to from @ref qhead and @ref phead.
+ */
 struct queue_entry {
-  struct queue_entry *next;            /* next entry */
-  struct queue_entry *prev;            /* previous entry */
-  const char *track;                   /* path to track */
-  const char *submitter;               /* name of submitter */
-  time_t when;                         /* time submitted */
-  time_t played;                       /* when played */
-  enum playing_state state;            /* state */
-  long wstat;                          /* wait status */
-  const char *scratched;               /* scratched by */
-  const char *id;                      /* queue entry ID */
-  time_t expected;                     /* expected started time */
-  /* for playing or soon-to-be-played tracks only: */
+  /** @brief Next entry */
+  struct queue_entry *next;
+
+  /** @brief Previous entry */
+  struct queue_entry *prev;
+
+  /** @brief Path to track (a database key) */
+  const char *track;
+
+  /** @brief Submitter or NULL
+   *
+   * Adopter, if @c origin is @ref origin_adopted.
+   */
+  const char *submitter;
+
+  /** @brief When submitted */
+  time_t when;
+
+  /** @brief When played */
+  time_t played;
+
+  /** @brief Current state
+   *
+   * Currently this includes some origin information but this is being phased
+   * out. */
+  enum playing_state state;
+
+  /** @brief Where track came from */
+  enum track_origin origin;
+
+  /** @brief Wait status from player
+   *
+   * Only valid in certain states (TODO).
+   */
+  long wstat;
+
+  /** @brief Who scratched this track or NULL */
+  const char *scratched;
+
+  /** @brief Unique ID string */
+  const char *id;
+
+  /** @brief Estimated starting time */
+  time_t expected;
+
+  /** @brief Type word from plugin (playing/buffered tracks only) */
   unsigned long type;                  /* type word from plugin */
-  const struct plugin *pl;             /* plugin that's playing this track */
-  void *data;                          /* player data */
-  long sofar;                          /* how much played so far */
-  int prepared;                                /* true when connected to speaker */
+
+  /** @brief Plugin for this track (playing/buffered tracks only) */
+  const struct plugin *pl;
+
+  /** @brief Player-specific data (playing/buffered tracks only) */
+  void *data;
+
+  /** @brief How much of track has been played so far (seconds) */
+  long sofar;
+
+  /** @brief True if decoder is connected to speaker */
+  int prepared;
   /* For DISORDER_PLAYER_PAUSES only: */
-  time_t lastpaused, lastresumed;      /* when last paused/resumed, or 0 */
-  long uptopause;                      /* how much played up to last pause */
-  /* For Disobedience */
-  struct queuelike *ql;                        /* owning queue */
+
+  /** @brief When last paused or 0 */
+  time_t lastpaused;
+
+  /** @brief When last resumed or 0 */
+  time_t lastresumed;
+
+  /** @brief How much of track was played up to last pause (seconds) */
+  long uptopause;
+
+  /** @brief Owning queue (for Disobedience only) */
+  struct queuelike *ql;
 };
 
 void queue_insert_entry(struct queue_entry *b, struct queue_entry *n);
index ce87abd00c3aa73e9ac876f2ad88a0e489fcc667..3f8f714a8829f9ad969a00d51de3b4de457667d4 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 /** @file lib/random.c
index 24515892b803d73befc657713dd3dd300a1526b9..5462c19003f7aceefd232e3a1cb964bb86099c89 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 /** @file lib/random.h
index bb90f431ec851576209d01b9c2bb9b84e247747a..cde61cf75e561ae4a7b9898c78cbb2a44f5bd09c 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder
  * Copyright (C) 2004, 2005, 2007, 20008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/regsub.c
+ * @brief Regexp substitution
  */
-
 #include "common.h"
 
 #include <pcre.h>
index 2e13930514c47497f6d94221ad67c3e417730874..1a5aa4341e158ebc1afed57519be7cd05577ad0e 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder 
 * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/regsub.h
+ * @brief Regexp substitution
  */
-
 #ifndef REGSUB_H
 #define REGSUB_H
 
index 416c6a7e30a31b8a2551673972b8a3d02390a766..05a33427f21aca442dcc274491163351bf1cc227 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/rights.c
  * @brief User rights
index c51ca5ca0c4bcc0b04c472651e9b64c234aa6ddd..a69b4b5f0587cdb4dd31539a2097836592599643 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/rights.h
  * @brief User rights
index 63ade9bea7da6425cd6e87d00b8209ce2628a2d1..b923fda3c7b60f7358ff81f48bb9513a45b13290 100644 (file)
--- a/lib/rtp.h
+++ b/lib/rtp.h
@@ -2,34 +2,82 @@
  * This file is part of DisOrder.
  * Copyright (C) 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/rtp.h
+ * @brief RTP packet header format
+ *
+ * See <a href="http://www.ietf.org/rfc/rfc1889.txt">RFC1889</a>.
  */
 
 #ifndef RTP_H
 #define RTP_H
 
-/* RTP is defined in RFC1889 */
+/** @brief RTP packet header format
+ *
+ * See <a href="http://www.ietf.org/rfc/rfc1889.txt">RFC1889</a> (now obsoleted
+ * by <a href="http://www.ietf.org/rfc/rfc3550.txt">RFC3550</a>).
+ *
+ * All values in this structure are big-endian.
+ */
 struct attribute((packed)) rtp_header {
+  /** @brief Version, padding, extension and CSRC
+   *
+   * Version is bits 6 and 7; currently always 2.
+   *
+   * Padding is bit 5; if set frame includes padding octets.
+   *
+   * eXtension is bit 4; if set there is a header extension.
+   *
+   * CSRC Count is bits 0-3 and is the number of CSRC identifiers following the
+   * header.
+   */
   uint8_t vpxcc;
+
+  /** @brief Marker and payload type
+   *
+   * Marker is bit 7.  Profile-defined.
+   *
+   * Payload Type is bits 0-6.  Profile defined.  
+   */
   uint8_t mpt;
+
+  /** @brief Sequence number */
   uint16_t seq;
+
+  /** @brief Timestamp */
   uint32_t timestamp;
+
+  /** @brief Synchronization source */
   uint32_t ssrc;
 };
 
+/** @brief RTP packet header format
+ *
+ * See <a href="http://www.ietf.org/rfc/rfc1889.txt">RFC1889</a> (now obsoleted
+ * by <a href="http://www.ietf.org/rfc/rfc3550.txt">RFC3550</a>).
+ *
+ * All values in this structure are big-endian.
+ */
+struct attribute((packed)) rtp_extension {
+  /** @brief Profile-defined extension type */
+  uint16_t type;
+
+  /** @brief Length of rest of extension */
+  uint16_t length;
+};
+
 #endif /* RTP_H */
 
 /*
index 6d0a588ecc585602ff3bf23d626e10ed30461da4..caa0e3f09fca8b2a64f352c2159cfaa5ee5e9e15 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2006, 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/selection.c
  * @brief Select management for Disobedience
index 099950109e1f98dc0fedd51ab294247d9ad2f67a..a1b382cc9db29be080c621b81f88c5c4307b33e6 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2006, 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/selection.h
  * @brief Select management for Disobedience
index 2dc82d05f3f6a727ef8e8a1d41da5356cf059a82..5b9a82cb26eef9dfd0acd33ecd9a6e28b148dc68 100644 (file)
@@ -2,22 +2,26 @@
  * This file is part of DisOrder
  * Copyright (C) 2007-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/sendmail.c
+ * @brief Sending email
+ *
+ * Can send email either via a local MTA or by connecting to an SMTP TCP port.
+ * The former is preferred as there is a strong implication that the local MTA
+ * will queue for you than some random TCP SMTP server you found.
  */
-
 #include "common.h"
 
 #include <errno.h>
index 958cd79cea1f02ff8de1adafaade0edde7bf1279..945dc251dc165b8d4ebd44679d660bdddd294072 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/sendmail.h
+ * @brief Sending email
  */
 
 #ifndef SENDMAIL_H
index 047e625c6bbd3ad829a2f072b47bd16cd3f3628d..27f9509c49653419b7f19fdf8a0e3460035fe23b 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/signame.c
+ * @brief Signal names
  */
-
 #include "common.h"
 
 #include <signal.h>
@@ -134,6 +134,10 @@ static const struct sigtable {
 #undef S
 };
 
+/** @brief Map a signal name to its number
+ * @param s Signal name e.g. "SIGINT"
+ * @return Signal value or -1 if not found
+ */
 int find_signal(const char *s) {
   int n;
 
index 85e1b80dbbab26821d5049960298c4fa062e0031..040668159a4460c20fabaa10ac8bcf3f52aa38fa 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/signame.h
+ * @brief Signal names
  */
-
 #ifndef SIGNAME_H
 #define SIGNAME_H
 
index 925bb013c7cf74abf0146d1846d815fa5b05f9ec..9450feaa0eb4ec7cfc35c0471e2e6194b11a8e01 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2004, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/sink.c
  * @brief Abstract output sink type
index aab645b73d74b4699e260c7b4b40bc07716e7266..5d09c18e3d631282ca51d61d5a6ff84058e8826f 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2004, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/sink.h
  * @brief Abstract output sink type
index f738bed275443e1783ba0440e8e61f5b3d28a302..e62e3c9434a80c0698d5ab69141710cff950f812 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2004, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/snprintf.c
+ * @brief UTF-8 capable *snprintf workalikes
  */
 
 #define NO_MEMORY_ALLOCATION
index ef66ed6b89163b77a366a1c2ad165f3c9c2c46b0..487c495d60c86f420b33b6c4b0f518401f1739a6 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/speaker-protocol.c
  * @brief Speaker/server protocol support
index 55a016e036d1cddc0ea93882ebe2ca8eb46041ce..bd80e7d0249f45363d54b4a0c1eda0eeae3fd857 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/speaker-protocol.h
  * @brief Speaker/server protocol support
index 90036d45b4c71322d98bc36a865a4ba46700e9b5..d4410dcd6bdfd5edcda2cd9f67ea512224097ffc 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2006-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/split.c
+ * @brief String splitting
  */
-
 #include "common.h"
 
 #include <ctype.h>
index 78a0b69f00ffd0c534ee19f68a2a4284c97976fd..7aee4b6d4223c3684df4ea7aa0739337e0473e8a 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/split.h
+ * @brief String splitting
  */
 #ifndef SPLIT_H
 #define SPLIT_H
diff --git a/lib/strptime.c b/lib/strptime.c
new file mode 100644 (file)
index 0000000..83d010d
--- /dev/null
@@ -0,0 +1,398 @@
+/* strptime.c - partial strptime() reimplementation
+ *
+ * (c) 2008 Richard Kettlewell.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/* strptime() is here reimplemented because the FreeBSD (and older MacOS) one
+ * is broken and does not report errors properly.  See TODO remarks below for
+ * some missing bits. */
+
+#include <ctype.h>
+#include <limits.h>
+#include <string.h>
+#include <langinfo.h>
+#include "strptime.h"
+
+struct locale_item_match {
+  nl_item key;
+  int value;
+};
+
+static const struct locale_item_match days[] = {
+  { DAY_1, 0 },
+  { DAY_2, 1 },
+  { DAY_3, 2 },
+  { DAY_4, 3 },
+  { DAY_5, 4 },
+  { DAY_6, 5 },
+  { DAY_7, 6 },
+  { ABDAY_1, 0 },
+  { ABDAY_2, 1 },
+  { ABDAY_3, 2 },
+  { ABDAY_4, 3 },
+  { ABDAY_5, 4 },
+  { ABDAY_6, 5 },
+  { ABDAY_7, 6 },
+  { -1, -1 }
+};
+
+static const struct locale_item_match months[] = {
+  { MON_1, 1 },
+  { MON_2, 2 },
+  { MON_3, 3 },
+  { MON_4, 4 },
+  { MON_5, 5 },
+  { MON_6, 6 },
+  { MON_7, 7 },
+  { MON_8, 8 },
+  { MON_9, 9 },
+  { MON_10, 10 },
+  { MON_11, 11 },
+  { MON_12, 12 },
+  { ABMON_1, 1 },
+  { ABMON_2, 2 },
+  { ABMON_3, 3 },
+  { ABMON_4, 4 },
+  { ABMON_5, 5 },
+  { ABMON_6, 6 },
+  { ABMON_7, 7 },
+  { ABMON_8, 8 },
+  { ABMON_9, 9 },
+  { ABMON_10, 10 },
+  { ABMON_11, 11 },
+  { ABMON_12, 12 },
+  { -1, -1 },
+};
+
+/** @brief Match a string
+ * @param buf Start of subject
+ * @param limit End of subject
+ * @param match String to match subject against
+ * @return True if match == [buf,limit) otherwise false
+ *
+ * The match is case-independent at least in ASCII.
+ */
+static int try_match(const char *buf,
+                     const char *limit,
+                     const char *match) {
+  /* TODO this won't work well outside single-byte encodings.  A good bet is
+   * probably to convert to Unicode and then use utf32_casefold_compat() (or
+   * utf8_casefold_compat(); using compatibility matching will ensure missing
+   * accents and so on aren't a problem.
+   *
+   * en_GB and en_US will probably be in any reasonable encoding for them.
+   */
+  while(buf < limit && *match) {
+    if(tolower((unsigned char)*buf) != tolower((unsigned char)*match))
+      return 0;
+    ++buf;
+    ++match;
+  }
+  if(buf != limit || *match)
+    return 0;
+  return 1;
+}
+
+/** @brief Match from table of locale-specific strings
+ * @param buf Start of subject
+ * @param limit End of subject
+ * @param lim Table of locale lookups
+ * @return Looked up value or -1
+ *
+ * The match is case-independent.
+ */
+static int try_locale_match(const char *buf,
+                            const char *limit,
+                            const struct locale_item_match *lim) {
+  /* This is not very efficient!  A (correct) built-in implementation will
+   * presumably have more direct access to locale information. */
+  while(lim->value != -1) {
+    if(try_match(buf, limit, nl_langinfo(lim->key)))
+      return lim->value;
+    ++lim;
+  }
+  return -1;
+}
+
+static int try_numeric_match(const char *buf,
+                             const char *limit,
+                             unsigned low,
+                             unsigned high) {
+  unsigned n = 0;
+
+  while(buf < limit) {
+    int ch = (unsigned char)*buf++;
+    if(ch >= '0' && ch <= '9') {
+      if(n > INT_MAX / 10
+         || (n == INT_MAX / 10 && ch >= INT_MAX % 10 + '0'))
+        return -1;                      /* overflow */
+      n = 10 * n + ch - '0';
+    } else
+      return -1;
+  }
+  if(n < low || n > high)
+    return -1;
+  return (int)n;
+}
+
+static const char *my_strptime_guts(const char *buf,
+                                    const char *format,
+                                    struct tm *tm) {
+  int fc, mod, spec, next, value;
+  const char *limit;
+  /* nl_langinfo() is allowed to trash its last return value so we copy.
+   * (We're relying on it being usable at all in multithreaded environments
+   * though.) */
+#define USE_SUBFORMAT(ITEM, EITEM, DEF) do {            \
+  const char *s;                                        \
+  char subformat[128];                                  \
+                                                        \
+  if(mod == 'E') {                                      \
+    s = nl_langinfo(EITEM);                             \
+    if(!s || !*s)                                       \
+      s = nl_langinfo(ITEM);                            \
+  } else                                                \
+    s = nl_langinfo(ITEM);                              \
+  if(!s || !*s)                                         \
+    s = DEF;                                            \
+  if(strlen(s) >= sizeof subformat)                     \
+    s = DEF;                                            \
+  strcpy(subformat, s);                                 \
+  if(!(buf = my_strptime_guts(buf, subformat, tm)))     \
+    return NULL;                                        \
+} while(0)
+
+  while(*format) {
+    fc = (unsigned char)*format++;
+    if(fc == '%') {
+      /* Get the character defining the converstion specification */
+      spec = (unsigned char)*format++;
+      if(spec == 'E' || spec == 'O') {
+        /* Oops, there's a modifier first */
+        mod = spec;
+        spec = (unsigned char)*format++;
+      } else
+        mod = 0;
+      if(!spec)
+        return NULL;                    /* format string broken! */
+      /* See what the next directive is.  The specification is written in terms
+       * of stopping the match at a character that matches the next directive.
+       * This implementation mirrors this aspect of the specification
+       * directly. */
+      next = (unsigned char)*format;
+      if(next) {
+        limit = buf;
+        if(isspace(next)) {
+          /* Next directive is whitespace, so bound the input string (at least)
+           * by that */
+          while(*limit && !isspace((unsigned char)*limit))
+            ++limit;
+        } else if(next == '%') {
+          /* Prohibited: "The application shall ensure that there is
+           * white-space or other non-alphanumeric characters between any two
+           * conversion specifications".  In fact we let alphanumerics
+           * through.
+           *
+           * Forbidding even %% seems a bit harsh but is consistent with the
+           * specification as written.
+           */
+          return NULL;
+        } else {
+          /* Next directive is a specific character, so bound the input string
+           * (at least) by that.  This will work badly in the face of multibyte
+           * characters, but then the spec is vague about what kind of string
+           * we're dealing with anyway so you probably couldn't safely use them
+           * in the format string at least in any case. */
+          while(*limit && *limit != next)
+            ++limit;
+        }
+      } else
+        limit = buf + strlen(buf);
+      switch(spec) {
+      case 'A': case 'a':               /* day name (abbrev or full) */
+        if((value = try_locale_match(buf, limit, days)) == -1)
+          return NULL;
+        tm->tm_wday = value;
+        break;
+      case 'B': case 'b': case 'h':     /* month name (abbrev or full) */
+        if((value = try_locale_match(buf, limit, months)) == -1)
+          return NULL;
+        tm->tm_mon = value - 1;
+        break;
+      case 'c':                         /* locale date+time */
+        USE_SUBFORMAT(D_T_FMT, ERA_D_T_FMT, "%a %b %e %H:%M:%S %Y");
+        break;
+      case 'C':                         /* century number 0-99 */
+        /* TODO  */
+        return NULL;
+      case 'd': case 'e':               /* day of month 1-31 */
+        if((value = try_numeric_match(buf, limit, 1, 31)) == -1)
+          return NULL;
+        tm->tm_mday = value;
+        break;
+      case 'D':                         /* == "%m / %d / %y" */
+        if(!(buf = my_strptime_guts(buf, "%m / %d / %y", tm)))
+          return NULL;
+        break;
+      case 'H':                         /* hour 0-23 */
+        if((value = try_numeric_match(buf, limit, 0, 23)) == -1)
+          return NULL;
+        tm->tm_hour = value;
+        break;
+      case 'I':                         /* hour 1-12 */
+        /* TODO */ 
+        return NULL;
+      case 'j':                         /* day 1-366 */
+        if((value = try_numeric_match(buf, limit, 1, 366)) == -1)
+          return NULL;
+        tm->tm_yday = value - 1;
+        return NULL;
+      case 'm':                         /* month 1-12 */
+        if((value = try_numeric_match(buf, limit, 1, 12)) == -1)
+          return NULL;
+        tm->tm_mon = value - 1;
+        break;
+      case 'M':                         /* minute 0-59 */
+        if((value = try_numeric_match(buf, limit, 0, 59)) == -1)
+          return NULL;
+        tm->tm_min = value;
+        break;
+      case 'n': case 't':               /* any whitespace */
+        goto matchwhitespace;
+      case 'p':                         /* locale am/pm */
+        /* TODO */
+        return NULL;
+      case 'r':                         /* == "%I : %M : %S %p" */
+        /* TODO actually this is locale-dependent; and we don't implement %I
+         * anyway, so it's not going to work even as it stands. */
+        if(!(buf = my_strptime_guts(buf, "%I : %M : %S %p", tm)))
+          return NULL;
+        break;
+      case 'R':                         /* == "%H : %M" */
+        if(!(buf = my_strptime_guts(buf, "%H : %M", tm)))
+          return NULL;
+        break;
+      case 'S':                         /* seconds 0-60 */
+        if((value = try_numeric_match(buf, limit, 0, 60)) == -1)
+          return NULL;
+        tm->tm_sec = value;
+        break;
+      case 'U':                         /* week number from Sunday 0-53 */
+        /* TODO */
+        return NULL;
+      case 'w':                         /* day number 0-6 from Sunday */
+        if((value = try_numeric_match(buf, limit, 0, 6)) == -1)
+          return NULL;
+        tm->tm_wday = value;
+        break;
+      case 'W':                         /* week number from Monday 0-53 */
+        /* TODO */ 
+        return NULL;
+      case 'x':                         /* locale date format */
+        USE_SUBFORMAT(D_FMT, ERA_D_FMT, "%m/%d/%y");
+        break;
+      case 'X':                         /* locale time format */
+        USE_SUBFORMAT(T_FMT, ERA_T_FMT, "%H:%M:%S");
+        break;
+      case 'y':                         /* year mod 100 */
+        if((value = try_numeric_match(buf, limit, 0, INT_MAX)) == -1)
+          return NULL;
+        if(value >= 0 && value <= 68)
+          value = 2000 + value;
+        else if(value >= 69 && value <= 99)
+          value = 1900 + value;
+        tm->tm_year = value - 1900;
+        break;
+      case 'Y':                         /* year */
+        if((value = try_numeric_match(buf, limit, 1, INT_MAX)) == -1)
+          return NULL;
+        tm->tm_year = value - 1900;
+        break;
+      case '%':
+        goto matchself;
+      default:
+        /* The spec is a bit vague about what to do with invalid format
+         * strings.  We return NULL immediately and hope someone will
+         * notice. */
+        return NULL;
+      }
+      buf = limit;
+    } else if(isspace(fc)) {
+    matchwhitespace:
+      /* Any format whitespace matches any number of input whitespace
+       * characters.  The directive can formally contain more than one
+       * whitespace character; for the second and subsequent ones we'll match 0
+       * characters from the input. */
+      while(isspace((unsigned char)*buf))
+        ++buf;
+    } else {
+    matchself:
+      /* Non-% non-whitespace characters must match themselves exactly */
+      if(fc != (unsigned char)*buf++)
+        return NULL;
+    }
+  }
+  /* When we run out of format string we return a pointer to the rest of the
+   * input. */
+  return buf;
+}
+
+/** @brief Reimplementation of strptime()
+ * @param buf Input buffer
+ * @param format Format string
+ * @param tm Where to put result
+ * @return Pointer to first unparsed input character, or NULL on error
+ *
+ * Based on <a
+ * href="http://www.opengroup.org/onlinepubs/009695399/functions/strptime.html">http://www.opengroup.org/onlinepubs/009695399/functions/strptime.html</a>.
+ */
+char *my_strptime(const char *buf,
+                  const char *format,
+                  struct tm *tm) {
+  /* Whether to overwrite or update is unspecified (rather bizarrely).  This
+   * implementation does not overwrites, as xgetdate() depends on this
+   * behavior. */
+
+  if(!(buf = my_strptime_guts(buf, format, tm)))
+    return NULL;
+  /* TODO various things we could/should do: 
+   * - infer day/month from %j+year
+   * - infer day/month from %U/%W+%w/%a+year
+   * - infer hour from %p+%I
+   * - fill wday/yday from other fields
+   */
+  return (char *)buf;
+}
+
+/*
+Local Variables:
+c-basic-offset:2
+comment-column:40
+fill-column:79
+indent-tabs-mode:nil
+End:
+*/
diff --git a/lib/strptime.h b/lib/strptime.h
new file mode 100644 (file)
index 0000000..324f88d
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef STRPTIME_H
+#define STRPTIME_H
+
+#include <time.h>
+
+char *my_strptime(const char *buf,
+                  const char *format,
+                  struct tm *tm);
+
+#endif /* STRPTIME_H */
+
+/*
+Local Variables:
+c-basic-offset:2
+comment-column:40
+fill-column:79
+indent-tabs-mode:nil
+End:
+*/
index 2d0245d5e3e05a46d99078bdefc74166caf03633..0d5dc187a0111eb637b32469951a769d50b27b60 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/syscalls.c
+ * @brief Error-checking library call wrappers
  */
-
 #include "common.h"
 
 #include <unistd.h>
index f1f33836241d40e6ee38c655baea9091fdf7d338..9f8bd206fb142c17ad6840804ac4b972c0c6eba3 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/syscalls.h
+ * @brief Error-checking library call wrappers
  */
-
 #ifndef SYSCALLS_H
 #define SYSCALLS_H
 
index d37ffe36960e7fb4ab71c8c66bb70be0d4ca4b04..a646d92f3d7a6b2be3aa1e4aec211c3017c79b70 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder
  * Copyright (C) 2004, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/table.c
+ * @brief Generic binary search
  */
-
 #include "common.h"
 
 #include "table.h"
index a301db70a1280af3faae84613b5574a7d9986e5b..db237acf0ff3af38c7e51920d3c2b3931bf06d00 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/table.h
+ * @brief Generic binary search
  */
-
 #ifndef TABLE_H
 #define TABLE_H
 
index 10b02ea2080693692241ba8addf6aabd432e765d..930ad24efabc00afc8007e8337e5b2e63b50ca4a 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder.
  * Copyright (C) 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/timeval.h
+ * @brief Arithmetic on timeval structures
  */
-
 #ifndef TIMEVAL_H
 #define TIMEVAL_H
 
index 943140630f5e294974c367b5b381fd4511e0f26f..b21b5d9f83349a8f95d3ee3d1c90cee391dbe704 100644 (file)
@@ -2,22 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2005, 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-
+/** @file lib/trackdb-int.h
+ * @brief Track database internals */
 #ifndef TRACKDB_INT_H
 #define TRACKDB_INT_H
 
index 6ddb6af2d2479383287842c7baa2df0baffdbd13..5fd7c325073f091694d6cac3aec777aa31e3b599 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/trackdb-stub.c
  * @brief Track database stubs
index a364446c8c23f7461752c589f6ef5cc5c9e9b5b6..b98752f6e59a13e5b18fbbfaab1f183e3761507a 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2005-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/trackdb.c
  * @brief Track database
@@ -363,7 +361,7 @@ static DB *open_db(const char *path,
                    DBTYPE dbtype,
                    u_int32_t openflags,
                    int mode) {
-  int err;
+  int err, err2;
   DB *db;
 
   D(("open %s", path));
@@ -378,8 +376,14 @@ static DB *open_db(const char *path,
       fatal(0, "db->set_bt_compare %s: %s", path, db_strerror(err));
   if((err = db->open(db, 0, path, 0, dbtype,
                      openflags | DB_AUTO_COMMIT, mode))) {
-    if((openflags & DB_CREATE) || errno != ENOENT)
+    if((openflags & DB_CREATE) || errno != ENOENT) {
+      if((err2 = db->close(db, 0)))
+        error(0, "db->close: %s", db_strerror(err2));
+      trackdb_close();
+      trackdb_env->close(trackdb_env,0);
+      trackdb_env = 0;
       fatal(0, "db->open %s: %s", path, db_strerror(err));
+    }
     db->close(db, 0);
     db = 0;
   }
@@ -494,26 +498,20 @@ void trackdb_close(void) {
   /* sanity checks */
   assert(opened == 1);
   --opened;
-  if((err = trackdb_tracksdb->close(trackdb_tracksdb, 0)))
-    fatal(0, "error closing tracks.db: %s", db_strerror(err));
-  if((err = trackdb_searchdb->close(trackdb_searchdb, 0)))
-    fatal(0, "error closing search.db: %s", db_strerror(err));
-  if((err = trackdb_tagsdb->close(trackdb_tagsdb, 0)))
-    fatal(0, "error closing tags.db: %s", db_strerror(err));
-  if((err = trackdb_prefsdb->close(trackdb_prefsdb, 0)))
-    fatal(0, "error closing prefs.db: %s", db_strerror(err));
-  if((err = trackdb_globaldb->close(trackdb_globaldb, 0)))
-    fatal(0, "error closing global.db: %s", db_strerror(err));
-  if((err = trackdb_noticeddb->close(trackdb_noticeddb, 0)))
-    fatal(0, "error closing noticed.db: %s", db_strerror(err));
-  if((err = trackdb_scheduledb->close(trackdb_scheduledb, 0)))
-    fatal(0, "error closing schedule.db: %s", db_strerror(err));
-  if((err = trackdb_usersdb->close(trackdb_usersdb, 0)))
-    fatal(0, "error closing users.db: %s", db_strerror(err));
-  if((err = trackdb_playlistsdb->close(trackdb_playlistsdb, 0)))
-    fatal(0, "error closing playlists.db: %s", db_strerror(err));
-  trackdb_tracksdb = trackdb_searchdb = trackdb_prefsdb = 0;
-  trackdb_tagsdb = trackdb_globaldb = 0;
+#define CLOSE(N, V) do {                                        \
+  if(V && (err = V->close(V, 0)))                               \
+    fatal(0, "error closing %s: %s", N, db_strerror(err));      \
+  V = 0;                                                        \
+} while(0)
+  CLOSE("tracks.db", trackdb_tracksdb);
+  CLOSE("search.db", trackdb_searchdb);
+  CLOSE("tags.db", trackdb_tagsdb);
+  CLOSE("prefs.db", trackdb_prefsdb);
+  CLOSE("global.db", trackdb_globaldb);
+  CLOSE("noticed.db", trackdb_noticeddb);
+  CLOSE("schedule.db", trackdb_scheduledb);
+  CLOSE("users.db", trackdb_usersdb);
+  CLOSE("playlists.db", trackdb_playlistsdb);
   D(("closed databases"));
 }
 
@@ -1411,7 +1409,9 @@ void trackdb_stats_subprocess(ev_source *ev,
   pid = subprogram(ev, p[1], "disorder-stats", (char *)0);
   xclose(p[1]);
   ev_child(ev, pid, 0, stats_finished, d);
-  ev_reader_new(ev, p[0], stats_read, stats_error, d, "disorder-stats reader");
+  if(!ev_reader_new(ev, p[0], stats_read, stats_error, d,
+                    "disorder-stats reader"))
+    fatal(0, "ev_reader_new for disorder-stats reader failed");
 }
 
 /** @brief Parse a track name part preference
@@ -1767,8 +1767,9 @@ int trackdb_request_random(ev_source *ev,
   choose_callback = callback;
   choose_output.nvec = 0;
   choose_complete = 0;
-  ev_reader_new(ev, p[0], choose_readable, choose_read_error, 0,
-                "disorder-choose reader"); /* owns p[0] */
+  if(!ev_reader_new(ev, p[0], choose_readable, choose_read_error, 0,
+                    "disorder-choose reader")) /* owns p[0] */
+    fatal(0, "ev_reader_new for disorder-choose reader failed");
   ev_child(ev, choose_pid, 0, choose_exited, 0); /* owns the subprocess */
   return 0;
 }
@@ -2258,7 +2259,7 @@ static int reap_rescan(ev_source attribute((unused)) *ev,
  * @param ev Event loop or 0 to block
  * @param recheck 1 to recheck lengths, 0 to suppress check
  * @param rescanned Called on completion (if not NULL)
- * @param u Passed to @p rescanned
+ * @param ru Passed to @p rescanned
  */
 void trackdb_rescan(ev_source *ev, int recheck,
                     void (*rescanned)(void *ru),
index 97c761ee7c178041fb1cf5fd9810b452edf0ab6c..6b866516f6d135dcd2209c1b7d74e4375f72a5ef 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2005-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/trackdb.h
  * @brief Track database public interface */
index 14de98568d4ea33e2a1c369e203d1b0be10b7218..fa40c3b840a567ec722d49d9edd4b4827e55344c 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder
  * Copyright (C) 2005, 2006, 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/trackname.c
+ * @brief Track name calculation
  */
-
 #include "common.h"
 
 #include <pcre.h>
index 3aa712275378e6d9474b38f801809d57bcac0480..63b881bb836c523ad962b81f26118e4d47129c9f 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder
  * Copyright (C) 2005-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/trackname.h
+ * @brief Track name calculation
  */
-
 #ifndef TRACKNAME_H
 #define TRACKNAME_H
 
index 80c5b92f6d676393001ceb544afd8e0c3fca6e3b..d0ae4486f597927de06222858fa65863ce959a0d 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder
  * Copyright (C) 2005, 2006, 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/trackorder.c
+ * @brief Track ordering
  */
-
 #include "common.h"
 
 #include <pcre.h>
index ded4c849312f8c2f9bcdf15034ebb5271e76c330..2f81739098583802ff2f382ebfa6e57470c64531 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/tracksort.c
+ * @brief Track ordering
  */
 #include "common.h"
 
index 417ae0780a36a532c38ff0fd3856e43cc6f8f830..3adbea0876fa8e7075622ad25b32369c47649e0d 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/unicode.c
  * @brief Unicode support functions
index 982921b33bdef432293c80cad21a2b3136f0540c..b6d68136cc40d19487114e99a574e9f64b99a561 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrde
  * Copyright (C) 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/unicode.h
  * @brief Unicode support functions
index db4334d1080c4061ec6105a03138230e91b55602..b22b5bc21ebf133ea0c0c1e4baa0ba170b2e7bfd 100644 (file)
@@ -1,4 +1,10 @@
-/* Automatically generated file, see scripts/make-unidata */
+/** @file lib/unidata.c
+ * @brief Unicode tables
+ *
+ * Automatically generated file, see scripts/make-unidata
+ *
+ * DO NOT EDIT.
+ */
 #include "common.h"
 #include "unidata.h"
 #define Cc unicode_General_Category_Cc
index aa8814d2a47e4ceae1c1b4ab84e717b1a51e61ec..86f5fee78b7480dda62a58cd5f706e37e9111000 100644 (file)
@@ -1,4 +1,10 @@
-/* Automatically generated file, see scripts/make-unidata */
+/** @file lib/unidata.h
+ * @brief Unicode tables
+ *
+ * Automatically generated file, see scripts/make-unidata
+ *
+ * DO NOT EDIT.
+ */
 #ifndef UNIDATA_H
 #define UNIDATA_H
 enum unicode_General_Category {
index e05e6bf580fd6d841314167ea84292f6649f7391..e1740ac31cb389b74e83fd218cad29c9ece10b25 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/url.c
  * @brief URL support functions
index 3546e77d37eabeb7b52318e77046716c85782b49..023b5336799110991ac8ad34291204c658922ebc 100644 (file)
--- a/lib/url.h
+++ b/lib/url.h
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/url.h
  * @brief URL support functions
index 512aaa13489d235fa22b2882b1cab2c2220464d1..488caf908527f2ac181baa63fd52a5d2c714d076 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2005, 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/user.c
  * @brief Jukebox user management
index 84d0030a450b02138cd30a868d878af51879ab39..d35f273bb4ad95f3572f21917a6da71632b277cd 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/user.h
  * @brief Jukebox user management
index 316e7e03827cd0d962890a2650757499c8f14984..d152b36d6bb36637c7423e2707226a80262d6458 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder
  * Copyright (C) 2004, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/vacopy.h
+ * @brief va_copy fixup
  */
-
 #ifndef VACOPY_H
 #define VACOPY_H
 
index d9fd18b314eb0455fee12efa90ef36e92f8403b3..4d798f1b31037554a22a466a1271e8cb1f1e8bba 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/vector.c
+ * @brief Dynamic array utilities
  */
-
 #include "common.h"
 
 #include <stddef.h>
index d89376cd7a62e35296c35ac9e32923c273ab0ff4..31dfeda5e86ffee911719a8e901a1e927f781cdc 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/vector.h @brief Dynamic array template */
 
index a8e2ad1d3c98546e51a7e19dcfc075099dc09195..e4eb0052f77bd74990390204a04cf8ac05263d00 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/version.c
+ * @brief Display version string and exit
  */
-
 #include "common.h"
 
 #include "syscalls.h"
index 4930bfd782ecf8e31bcbc67f88022e4e0c6a12f5..b8ee0d5a9a6ff0226e41ed63e286587be4553dca 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file lib/version.h
+ * @brief Display version string and exit
  */
 #ifndef VERSION_H
 #define VERSION_H
index d0f3acf79111b650dea17c4d9eb25c73b0401a8c..455bb729275ea66bcfae8efb4080aff735fc132d 100644 (file)
--- a/lib/wav.c
+++ b/lib/wav.c
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/wav.c
  * @brief WAV file support
index 93bf7700478aef7264fa9e132c01fd9274615a37..d2de912b280ff9b16d8d4d9a96784bbe7ce25311 100644 (file)
--- a/lib/wav.h
+++ b/lib/wav.h
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/wav.h
  * @brief WAV file support
index 1b541e92267e9fdf2a1ab892f3fab401a1e02fb4..dec036e7674ea4f5bc650e2d0d3d904019768fab 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/wstat.c
  * @brief Convert wait status to text
index 944048dd2edc99fb64fad4f9d761b3c04a13dd5c..aebe6effc71e1d26b1797e7cca8bb0aea627fa95 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file lib/wstat.h
  * @brief Convert wait status to text
index 9d8b492e395e6940f4ce3fb281ba608e3528cfb9..ae9e183ab448518a68887a67b1afc9c48cae9cfa 100644 (file)
@@ -1,7 +1,11 @@
-/* Derived from getdate.c in glibc 2.3.6.  This is pretty much
+/** @file lib/xgetdate.c
+ * @brief Date parsing
+ *
+ * Derived from getdate.c in glibc 2.3.6.  This is pretty much
  * standard getdate() except that you supply the template in an
  * argument, rather than messing around with environment variables and
- * files.  */
+ * files.
+ */
 
 /* Convert a string representation of time to a time value.
    Copyright (C) 1997,1998,1999,2000,2001,2003 Free Software Foundation, Inc.
@@ -31,6 +35,7 @@
 #include <time.h>
 
 #include "dateparse.h"
+#include "strptime.h"
 
 #define TM_YEAR_BASE 1900
 
@@ -130,7 +135,7 @@ xgetdate_r (const char *string, struct tm *tp,
       tp->tm_isdst = -1;
       tp->tm_gmtoff = 0;
       tp->tm_zone = NULL;
-      result = strptime (string, line, tp);
+      result = my_strptime (string, line, tp);
       if (result && *result == '\0')
        break;
     }
index c56928798da39b6f527a79986ec48b5cd9648a17..2f81f20bbb02ccf247850566c2e6ed01471da897 100644 (file)
@@ -2,20 +2,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 TESTS=t-addr t-arcfour t-basen t-bits t-cache t-casefold t-charset     \
@@ -48,6 +46,7 @@ t_kvp_SOURCES=t-kvp.c test.c test.h
 t_macros_SOURCES=t-macros.c test.c test.h
 t_mime_SOURCES=t-mime.c test.c test.h
 t_printf_SOURCES=t-printf.c test.c test.h
+t_printf_CFLAGS=$(AM_CFLAGS) -Wno-format-security
 t_regsub_SOURCES=t-regsub.c test.c test.h
 t_selection_SOURCES=t-selection.c test.c test.h
 t_signame_SOURCES=t-signame.c test.c test.h
@@ -66,12 +65,12 @@ t_eventdist_SOURCES=t-eventdist.c test.c test.h
 check-report: before-check check make-coverage-reports
 before-check:
        rm -f *.gcda *.gcov
-make-coverage-reports:
-       ${GCOV} *.c | ${PYTHON} ../scripts/format-gcov-report --html . *.c
+make-coverage-reports: check
+       cd ../lib && ${GCOV} *.c | ${PYTHON} ../scripts/format-gcov-report --html . *.c
 
 EXTRA_DIST=t-macros-1.tmpl t-macros-2
 
-CLEANFILES=*.gcda *.gcov *.gcno
+CLEANFILES=*.gcda *.gcov *.gcno *.c.html index.html
 
 DISTCLEANFILES=GraphemeBreakTest.txt NormalizationTest.txt     \
               WordBreakTest.txt
index 0e495d8158a561242b012764910ca8c6440980b4..7710212f0837ed48b499b62a10e4f768cdaf6d4b 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
index c0dce36f64abbc636e91bfe2430e45ca540bff3a..3ae26fbe16ebdda23829a1416134a6752f468a46 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 #include "arcfour.h"
index 99b52f992445c70836f67b50cf4c59d4e320ef46..715490ca9e976d9d85b1797ccef925185ed20aea 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
index 80bfdf58a407832c048f4c2fa44f0c69c40f6569..6ad6f6d22d0518ca612050e384bc400ca5c1c4de 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 #include "bits.h"
index 3cdb4003401f8eb55b0bf9196b35f4b771456443..c43413bc84f1df14b35420216a0014ae59885d61 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
index 449eaffb7583e12ed37a21a4cea2a396c028b16d..b3832c46574827582eefad81c65884378a46b503 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
index de44fcbd17188608dbc1e3ec1e0c0ffa0e2a923b..109a38afa1d62287d74c3ccf28465ee3ade1350c 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 #include "cgi.h"
@@ -37,7 +35,6 @@ static void input_from(const char *s) {
 }
 
 static void test_cgi(void) {
-  struct dynstr d[1];
 
   setenv("REQUEST_METHOD", "GET", 1);
   setenv("QUERY_STRING", "foo=bar&a=b+c&c=x%7ey", 1);
@@ -114,27 +111,6 @@ static void test_cgi(void) {
   check_string(cgi_sgmlquote("\"&\""), "&#34;&#38;&#34;");
   check_string(cgi_sgmlquote("\xC2\xA3"), "&#163;");
 
-  dynstr_init(d);
-  cgi_opentag(sink_dynstr(d), "element",
-             "foo", "bar",
-             "foo", "has space",
-             "foo", "has \"quotes\"",
-             (char *)NULL);
-  dynstr_terminate(d);
-  check_string(d->vec, "<element foo=bar foo=\"has space\" foo=\"has &#34;quotes&#34;\">");
-  
-  dynstr_init(d);
-  cgi_opentag(sink_dynstr(d), "element",
-             "foo", (char *)NULL,
-             (char *)NULL);
-  dynstr_terminate(d);
-  check_string(d->vec, "<element foo>");
-  
-  dynstr_init(d);
-  cgi_closetag(sink_dynstr(d), "element");
-  dynstr_terminate(d);
-  check_string(d->vec, "</element>");
-
   check_string(cgi_makeurl("http://example.com/", (char *)NULL),
               "http://example.com/");
   check_string(cgi_makeurl("http://example.com/",
index 1ee2a46e221bba78320bceb35e4b36d60753e046..e241f32d2a1db3e11cac45f0d95d13cc5bf479cc 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 #include "charset.h"
index c8ec504c9eb2bdb8a13c8142cc1136fe74e407e0..6ac1bc88ba189154e51f52af17b318c7d785f50f 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
index 3b1e8195192f1a56bbd02e36a8cd47ca442d9cea..a0a3b0d226c0ece42baea51c7c7947a4fc53ad1d 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 #include <time.h>
@@ -48,10 +46,6 @@ static void test_dateparse(void) {
   check_date(now, "%H:%M:%S", localtime);
   /* This one needs a bodge: */
   check_date(now - now % 60, "%H:%M", localtime);
-#if __FreeBSD__
-  fprintf(stderr, "strptime() is broken on FreeBSD - skipping further tests\n");
-  ++skipped;
-#else
   /* Reject invalid formats */
   check_fatal(dateparse("12"));
   check_fatal(dateparse("12:34:56:23"));
@@ -59,7 +53,6 @@ static void test_dateparse(void) {
   check_fatal(dateparse("25:34"));
   check_fatal(dateparse("23:61"));
   check_fatal(dateparse("23:23:62"));
-#endif
 }
 
 TEST(dateparse);
index 07f2c25c1b217203fde721d80954573c3b2f7784..87c803a2a89fc63f4f8a4106248b43cef57ff9ff 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 #include "event.h"
index 1deeb0dd309056c4f486ae6cd89aeadb474c2917..6aa72ef62714cc9e6f373c99ecb4937ff8eb52ce 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 #include "eventdist.h"
index 3eff101093c7aebb5f5ffbb7493b7f2e59d25098..ad883645ca96b5e247ec8b205fe1df96b13f8a43 100644 (file)
@@ -3,20 +3,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
index ad77841c1ccbca55a9d5ed3a1528cdda31e945d3..4d8b68aaa4afa348367aaef3f397e85bcef7d35d 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
index 54d052a5dd9226adf8ceecbf31136b421a5f52ad..7a6de0ad063508b556ea26dc8fd6d554f9e39acb 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
index 966d22666234ba3d7f2c72f92960747908173e6c..a6f1b32c6f9a67518041d8871f63b01249075f22 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
index d46335093aceaf8aadc3c59feb8b2049bd616bcc..f2e359ad8055c1b23fb4e765b5d174d39c90587d 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
@@ -60,6 +58,16 @@ static void test_kvp(void) {
   check_integer(urldecode(sink_error(), "bar=foo", 7), -1);
   check_integer(urlencode(sink_error(), "wibble", 7), -1);
   check_integer(urlencode(sink_error(), " ", 1), -1);
+  k = kvp_make("wibble", "spong",
+               "blit", "blat",
+               (char *)0);
+  check_string(kvp_urlencode(k, &n),
+               "blit=blat&wibble=spong");
+  k = kvp_make("wibble", (char *)0,
+               "blit", "blat",
+               (char *)0);
+  check_string(kvp_urlencode(k, &n),
+               "blit=blat&wibble=");
 }
 
 TEST(kvp);
index a1dc0e07a6e9650eb4f1fbf9883b3b3f2e54e83d..cd2502369eaa5bf2309860cbb4b8cf31c4aff43d 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 #include "macros.h"
index 7f56c5d3ff0cea7c6095ac745ef745bedf14c0a3..c7f16e931503ba3d92801b726f031cb194512709 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
index 85d1d0179e7efb762bcb9dc36abe992ba0add4d8..7402471c3e603d75c5ca1941355620a0e09b06a7 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
index 1497db2da5b732fe842a1b305e928596360f5985..a1e2220e875e439a3a0c9aca75ecef46ecbcce48 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
@@ -52,6 +50,8 @@ static void test_regsub(void) {
                "bspong");
   check_string(regsub(re, "baaaaa", "foo-$&-bar", 0),
                "bfoo-aaaaa-bar");
+  check_string(regsub(re, "baaaaa", "foo-$&-bar$x", 0),
+               "bfoo-aaaaa-bar$x");
 
   re = pcre_compile("(a+)(b+)", PCRE_UTF8|PCRE_CASELESS, &errstr, &erroffset, 0);
   assert(re != 0);
index 0992efe7083ddda2777a67702e99471bf37ab10b..f13dcf34b82ff2d2215c7c775ca31904e5030f5f 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
index 95f06b8ec5df4615fd4d05061cb87b2f233dbbbc..c68a1d38e197f3635a65a49f182a97b3f4f58129 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
index 68816b3318d4f342b7a3b001ec20caa3f961d768..0323098bfabd32b149859525b71b8c0a67fc5822 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
index 3737d0c7d216634d2f4c4a1658d728d423d53631..135f4f1deda09dcfc4179c8e02c03899a83c0839 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
index a4ab19bdeabbf78b41554f0a5aa624e812d39e3c..03c9754ee5415c23e94a9dc7bdb25c4ed0446782 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
index 29103aee123ebcd4744b50eededd2463087c9008..c00e7a52bd215bb7e9dd16284e3ea8014e207bff 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 #include "trackname.h"
index f50454e0a304ba07d84176098a15150a14188b14..ba6bba5f6a15ad5fddc02b5d54559352c507b8e9 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
index 4bc7474dfed145b82178e102cecf0c428db4f45c..cf680ea782c1fc54b59d9b16f6f67dd8bde96880 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
@@ -48,8 +46,10 @@ static void test_url(void) {
   insist(parse_url("http://www.example.com/example%2zpath", &p) == -1);
 
   setenv("SERVER_NAME", "www.anjou.terraraq.org.uk", 1);
-  setenv("SERVER_PORT", "80", 1);
   setenv("SCRIPT_NAME", "/~richard/env.cgi", 1);
+  check_string(infer_url(1),
+               "http://www.anjou.terraraq.org.uk/~richard/env.cgi");
+  setenv("SERVER_PORT", "80", 1);
   check_string(infer_url(1),
                "http://www.anjou.terraraq.org.uk/~richard/env.cgi");
   setenv("HTTPS", "on", 1);
@@ -58,6 +58,9 @@ static void test_url(void) {
   setenv("QUERY_STRING", "foo", 1);
   check_string(infer_url(1),
                "https://www.anjou.terraraq.org.uk/~richard/env.cgi");
+  setenv("SCRIPT_NAME", "", 1);
+  check_string(infer_url(1),
+               "https://www.anjou.terraraq.org.uk/");
   setenv("REQUEST_URI", "/~richard/env%2ecgi", 1);
   check_string(infer_url(1),
                "https://www.anjou.terraraq.org.uk/~richard/env%2ecgi");
index a98f956f5bc269ea0ceebab7e03a9cb782b5aa26..709083b237b704a9dbdf230546266eae3084ccf6 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
index 137ea608334371904b497b8040fc18bbfcdc2d26..a19bf4212cb1c92711f502ace02566d9a1fa231f 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
index 30730c929110c24716b8192dc222e36d74e62576..af9468ceae72efacf51add08be5981508b0c4e73 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
index a6746cda42831f43a8072092a8e6a87ad83b979d..44007537a0f92e4f2c391fb772b504da47cbe237 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "test.h"
 
index 4fcb00848dfca78edabd75854cd57f95bbbb236e..73bfdd2a8421badb8ef5a7426bd58dd4a0d25646 100644 (file)
@@ -2,38 +2,56 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-/** @file lib/test.c @brief Library tests */
+/** @file libtests/test.c @brief Library tests */
 
 #include "test.h"
 #include "version.h"
 #include <getopt.h>
 
-long long tests, errors;
+/** @brief Count of tests */
+long long tests;
+
+/** @brief Count of errors */
+long long errors;
+
+/** @brief If set, first error will fail whole test */
 int fail_first;
+
+/** @brief Verbose mode */
 int verbose;
+
+/** @brief If set, test will return 'skipped' indicator */
 int skipped;
 
+/** @brief Count up an error
+ *
+ * If @ref fail_first is set then the test run is aborted.
+ */
 void count_error(void) {
   ++errors;
   if(fail_first)
     abort();
 }
 
+/** @brief Render a string into printable ASCII
+ * @param s String to format
+ * @return Allocated copy of formatted string
+ *
+ * Replaces any non-ASCII characters with a hex escape.
+ */
 const char *format(const char *s) {
   struct dynstr d;
   int c;
@@ -52,6 +70,12 @@ const char *format(const char *s) {
   return d.vec;
 }
 
+/** @brief Format a UTF-32 string into hex
+ * @param s String to format
+ * @return Allocated copy of formatted string
+ *
+ * Returns the hex codes of @p s separated by spaces.
+ */
 const char *format_utf32(const uint32_t *s) {
   struct dynstr d;
   uint32_t c;
@@ -66,6 +90,10 @@ const char *format_utf32(const uint32_t *s) {
   return d.vec;
 }
 
+/** @brief Convert a string of hex codes to a UTF-32 string
+ * @param s String of hex codes, separated by spaces
+ * @return Allocated string, 0-terminated
+ */
 uint32_t *ucs4parse(const char *s) {
   struct dynstr_ucs4 d;
   char *e;
@@ -81,6 +109,11 @@ uint32_t *ucs4parse(const char *s) {
   return d.vec;
 }
 
+/** @brief Format a string like asprintf()
+ * @param fmt Format string, per printf(3)
+ * @param ... Arguments
+ * @return Formatted string or null pointer on error
+ */
 const char *do_printf(const char *fmt, ...) {
   va_list ap;
   char *s;
@@ -94,8 +127,13 @@ const char *do_printf(const char *fmt, ...) {
   return s;
 }
 
+/** @brief Jump buffer for exitfn() testing */
 jmp_buf fatal_env;
 
+/** @brief exitfn() callback for testing
+ * @param rc Value to return from setjmp()
+ * Jumps to @ref fatal_env
+ */
 void test_exitfn(int rc) {
   assert(rc != 0);
   longjmp(fatal_env, rc);
@@ -122,6 +160,10 @@ static void help(void) {
   exit(0);
 }
 
+/** @brief Standard test program initialization
+ * @param argc Argument count
+ * @param argv Arguments
+ */
 void test_init(int argc, char **argv) {
   int n;
 
index 48c8956ca1aa175f2561ba9612ee3ffec1b9b476..cada395ad03dcf55c8f0fcbc73d4775d928d7d7b 100644 (file)
@@ -2,22 +2,20 @@
  * This file is part of DisOrder.
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-/** @file lib/test.h @brief Library tests */
+/** @file libtests/test.h @brief Library tests */
 
 #ifndef TEST_H
 #define TEST_H
@@ -70,7 +68,11 @@ extern int fail_first;
 extern int verbose;
 extern int skipped;
 
-/** @brief Checks that @p expr is nonzero */
+/** @brief Checks that @p expr is nonzero
+ * @param expr Expression to check
+ *
+ * If @p expr is nonzero then logs an error (and continues).
+ */
 #define insist(expr) do {                              \
   if(!(expr)) {                                                \
     count_error();                                             \
@@ -80,6 +82,15 @@ extern int skipped;
   ++tests;                                             \
 } while(0)
 
+/** @brief Check that a pair of strings match
+ * @param GOT What we actually got
+ * @param WANT What we wanted
+ *
+ * If @p GOT and @p WANT differ then logs an error (and continues).
+ *
+ * @p WANT is allowed to evaluate to a null pointer (but if it comes to
+ * anything else then must be safe to strcmp).
+ */
 #define check_string(GOT, WANT) do {                                    \
   const char *got = GOT;                                                \
   const char *want = WANT;                                              \
@@ -96,6 +107,15 @@ extern int skipped;
   ++tests;                                                              \
  } while(0)
 
+/** @brief Check that a string prefix matches
+ * @param GOT What we actually got
+ * @param WANT What we wanted
+ *
+ * If @p WANT is not a prefix of @p GOT then logs an error (and continues).
+ *
+ * @p WANT is allowed to evaluate to a null pointer (but if it comes to
+ * anything else then must be safe to strcmp).
+ */
 #define check_string_prefix(GOT, WANT) do {                             \
   const char *got = GOT;                                                \
   const char *want = WANT;                                              \
@@ -112,6 +132,12 @@ extern int skipped;
   ++tests;                                                              \
  } while(0)
 
+/** @brief Check that a pair of integers match.
+ * @param GOT What we actually got
+ * @param WANT What we wanted
+ *
+ * If @p GOT and @p WANT differ then logs an error (and continues).
+ */
 #define check_integer(GOT, WANT) do {                           \
   const intmax_t got = GOT, want = WANT;                        \
   if(got != want) {                                             \
@@ -122,6 +148,12 @@ extern int skipped;
   ++tests;                                                      \
 } while(0)
 
+/** @brief Check that a function calls fatal()
+ * @param WHAT Expression to evaluate
+ *
+ * Evaluates WHAT and if it does not call fatal(), logs an error.  In any case,
+ * continues.  Modifies exitfn() so that fatal() isn't actually fatal.
+ */
 #define check_fatal(WHAT) do {                                          \
   void (*const save_exitfn)(int) attribute((noreturn)) = exitfn;        \
                                                                         \
@@ -147,6 +179,15 @@ void test_init(int argc, char **argv);
 extern jmp_buf fatal_env;
 void test_exitfn(int) attribute((noreturn));
 
+/** @brief Common code for each test source file
+ * @param name Name of test
+ *
+ * Expands to a  @c main function which:
+ * - calls test_init()
+ * - calls test_NAME()
+ * - reports a count of errors
+ * - returns the right exit status
+ */
 #define TEST(name)                                                      \
   int main(int argc, char **argv) {                                     \
     test_init(argc, argv);                                              \
index 2655ebb6bc8c5fc12cec3085eca8a8f083f6b58d..ae3f8eb7aff711f425ab7778c14c1054582eaafa 100644 (file)
@@ -2,20 +2,18 @@
 # This file is part of DisOrder
 # Copyright (C) 2004-2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 pkglib_LTLIBRARIES=disorder-tracklength.la fs.la notify.la exec.la shell.la \
index 185ab604ac00e126dd7133e0b586f2a81f431561..f6ed8b37d4c8b1eeb6e75658a74b19bc67121826 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file plugins/exec.c
+ * @brief Plugin to play a track by executing a command
  */
-
 #include <config.h>
 
 #include <unistd.h>
index c967fdafb11d8eb7307c3bd9591c23f1e55a911f..8af8c61c1288c132e49c7163022c523c24b051ba 100644 (file)
@@ -1,3 +1,8 @@
+/** @file plugins/execraw.c
+ * @brief Plugin to play a track by executing a command (raw mode)
+ *
+ * Shares code with @ref exec.c.
+ */
 #define TYPE DISORDER_PLAYER_RAW
 #include "exec.c"
 
index eea7bf5fafadad44847c9a55c887c10995ee78e4..1099d145465d4da9bb0658451c31b74ea7eaecf6 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file plugins/fs.c
+ * @brief Plugin to find tracks in a filesystem
  */
-
 #include <config.h>
 
 #include <string.h>
index 1e40325e733cb2cf87bd9610c4611fa436a072ad..005c3e6fe10ad9dc6a924194f8503919773e5fea 100644 (file)
@@ -1,5 +1,9 @@
-/* This file is a subset of the debian source tarball of mpg321-0.2.10.3/mad.c
-   - see http://mpg321.sourceforge.net/ */
+/** @file plugins/mad.c
+ * @brief MP3 Length calculation
+ *
+ * This file is a subset of the debian source tarball of
+ * mpg321-0.2.10.3/mad.c - see http://mpg321.sourceforge.net/
+ */
 
 /*
     mpg321 - a fully free clone of mpg123.
index 969b9d375283c613516daf420f88d44b9ea12388..5d73611a95f47c32167cd0b3f846ea40f1bcd740 100644 (file)
@@ -2,27 +2,26 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file plugins/madshim.h
+ * @brief Integrate code from mpg123
  */
 
 #ifndef MADSHIM_H
 #define MADSHIM_H
 
-/* shim to integrate code from mpg123 */
-
 typedef struct {
   int num_frames;
   mad_timer_t duration;
index 15ef47c518351539c7807e6c1a915925956bd46b..a0d7c114782eb4e713b5dca200db5bef2ba86470 100644 (file)
@@ -2,20 +2,25 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file plugins/notify.c
+ * @brief Standard notify plugin
+ *
+ * The arrangements here are not very satisfactory - you wanted to be
+ * able to replace the plugin but still keep its features.  So you
+ * wanted a list of plugins really.
  */
 
 #include "common.h"
index 31297f1a5c2080f72e719bc943793da9760ad5b2..bbd7a4ec18ebad2ac9928fb2b5f28d63d47bcda8 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file plugins/shell.c
+ * @brief Plugin to execute track players via the shell.
  */
 
 #include <config.h>
index 42f9432918e1aaeffb04c36e12b1105bc0477505..86a1fc8a26667b94ef5393be51536c37342557d9 100644 (file)
@@ -2,20 +2,23 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file plugins/tracklength.c
+ * @brief Plugin to compute track lengths
+ *
+ * Currently implements MP3, OGG, FLAC and WAV.
  */
 
 #include <config.h>
diff --git a/prepare b/prepare
index f38be5b101c4f007dacfc3f1fa635fc15ae051d9..dd3de9b8628e15ca5db3890040ecd815f333f329 100755 (executable)
--- a/prepare
+++ b/prepare
@@ -3,20 +3,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2004-2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 set -e
@@ -24,7 +22,7 @@ srcdir=$(dirname $0)
 here=$(pwd)
 cd $srcdir
 rm -f COPYING
-for f in /usr/share/common-licenses/GPL-2 $HOME/doc/GPL-2; do
+for f in /usr/share/common-licenses/GPL-3 $HOME/doc/GPL-3 $HOME/Documents/GPL-3; do
   if test -e "$f"; then
     ln -s "$f" COPYING
     break
index 6925587fa858aa6312948422e38ce81271ec64d7..2ec62e18c5b8a3e870f6c80daf28915f6a81d057 100644 (file)
@@ -2,30 +2,27 @@
 # This file is part of DisOrder.
 # Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-noinst_SCRIPTS=tkdisorder
 nodist_python_PYTHON=disorder.py
 
 SEDFILES=disorder.py
 
 include ${top_srcdir}/scripts/sedfiles.make
 
-EXTRA_DIST=disorder.py.in tkdisorder
+EXTRA_DIST=disorder.py.in
 
 BUILT_SOURCES=disorder.py
 
index 47d7090337d63f0ce55fc48e0b0f1d6ad831e3b8..3e1541eaf97104d29ab3bcf46679fd6b4fb17b78 100644 (file)
@@ -1,20 +1,18 @@
 #
 # Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 """Python support for DisOrder
@@ -909,6 +907,10 @@ class client:
     """Add a scheduled event"""
     self._simple("schedule-add", str(when), priority, action, *rest)
 
+  def adopt(self, id):
+    """Adopt a randomly picked track"""
+    self._simple("adopt", id)
+
   def playlist_delete(self, playlist):
     """Delete a playlist"""
     res, details = self._simple("playlist-delete", playlist)
diff --git a/python/tkdisorder b/python/tkdisorder
deleted file mode 100755 (executable)
index 25e4b96..0000000
+++ /dev/null
@@ -1,480 +0,0 @@
-#! /usr/bin/env python
-#
-# Copyright (C) 2004, 2005 Richard Kettlewell
-#
-# 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 PROGRAM IS NO LONGER MAINTAINED.
-#
-# It worked last time I tried running it, but all client maintenance
-# effort is now devoted to the web interface and the GTK+ client
-# (Disobedience).
-
-"""Graphical user interface for DisOrder"""
-
-from Tkinter import *
-import tkFont
-import Queue
-import threading
-import disorder
-import time
-import string
-import re
-import getopt
-import sys
-
-########################################################################
-
-# Architecture:
-#
-#  The main (initial) thread of the program runs all GUI code.  The GUI is only
-#  directly modified from inside this thread.  We sometimes call this the
-#  master thread.
-#
-#  We have a background thread, MonitorStateThread, which waits for changes to
-#  the server's state which we care about.  Whenever such a change occurs it
-#  notifies all the widgets which care about it (and possibly other widgets;
-#  the current implementation is unsophisticated.)
-#
-#  Widget poll() methods usually, but NOT ALWAYS, called in the
-#  MonitorStateThread.  Other widget methods are call in the master thread.
-#
-#  We have a separate disorder.client for each thread rather than locking a
-#  single client.  MonitorStateThread also has a private disorder.client that
-#  it uses to watch for server state changes.
-
-########################################################################
-
-class Intercom:
-  # communication queue into thread containing Tk event loop
-  #
-  # Sets up a callback on the event loop (in this thread) which periodically
-  # checks the queue for elements; if any are found they are executed.
-  def __init__(self, master):
-    self.q = Queue.Queue();
-    self.master = master
-    self.poll()
-
-  def poll(self):
-    try:
-      item = self.q.get_nowait()
-      item()
-      self.master.after_idle(self.poll)
-    except Queue.Empty:
-      self.master.after(100, self.poll)
-
-  def put(self, item):
-    self.q.put(item)
-
-########################################################################
-
-class ProgressBar(Canvas):
-  # progress bar widget
-  def __init__(self, master=None, **kw):
-    Canvas.__init__(self, master, highlightthickness=0, **kw)
-    self.outer = self.create_rectangle(0, 0, 0, 0,
-                                       outline="#000000",
-                                       width=1,
-                                       fill="#ffffff")
-    self.bar = self.create_rectangle(0, 0, 0, 0,
-                                     width=1,
-                                     fill="#ff0000",
-                                     outline='#ff0000')
-    self.current = None
-    self.total = None
-    self.bind("<Configure>", lambda e: self.redisplay())
-
-  def update(self, current, total):
-    self.current = current
-    if current > total:
-      current = total
-    elif current < 0:
-      current = 0
-    self.total = total
-    self.redisplay()
-
-  def clear(self):
-    self.current = None
-    self.total = None
-    self.redisplay()
-
-  def redisplay(self):
-    w, h = self.winfo_width(), self.winfo_height()
-    if w > 0 and h > 0:
-      self.coords(self.outer, 0, 0, w - 1, h - 1)
-      if self.total:
-        bw = int((w - 2) * self.current / self.total)
-        self.itemconfig(self.bar,
-                        fill="#ff0000",
-                        outline="#ff0000")
-        self.coords(self.bar, 1, 1, bw, h - 2)
-      else:
-        self.itemconfig(self.bar,
-                        fill="#909090",
-                        outline="#909090")
-        self.coords(self.bar, 1, 1, w - 2, h - 2)
-
-# look up a track's name part, using client c.  Maintains a cache.
-part_cache = {}
-def part(c, track, context, part):
-  key = "%s-%s-%s" % (part, context, track)
-  now = time.time()
-  if not part_cache.has_key(key) or part_cache[key]['when'] < now - 3600:
-    part_cache[key] = {'when': now,
-                       'what': c.part(track, context, part)}
-  return part_cache[key]['what']
-
-class PlayingWidget(Frame):
-  # widget that always displays information about what's
-  # playing
-  def __init__(self, master=None, **kw):
-    Frame.__init__(self, master, **kw)
-    # column 0 is descriptions, column 1 is the values
-    self.columnconfigure(0,weight=0)
-    self.columnconfigure(1,weight=1)
-    self.fields = {}
-    self.field(0, 0, "artist", "Artist")
-    self.field(1, 0, "album", "Album")
-    self.field(2, 0, "title", "Title")
-    # column 1 also has the progress bar in it
-    self.p = ProgressBar(self, height=20)
-    self.p.grid(row=3, column=1, sticky=E+W)
-    # column 2 has operation buttons
-    b = Button(self, text="Quit", command=self.quit)
-    b.grid(row=0, column=2, sticky=E+W)
-    b = Button(self, text="Scratch", command=self.scratch)
-    b.grid(row=1, column=2, sticky=E+W)
-    b = Button(self, text="Recent", command=self.recent)
-    b.grid(row=2, column=2, sticky=E+W)
-    self.length = 0
-    self.update_length()
-    self.last = None
-    self.recentw = None
-    
-  def field(self, row, column, name, label):
-    # create a field
-    Label(self, text=label).grid(row=row, column=column, sticky=E)
-    self.fields[name] = Text(self, height=1, state=DISABLED)
-    self.fields[name].grid(row=row, column=column + 1, sticky=W+E);
-
-  def set(self, name, value):
-    # set a field's value
-    f = self.fields[name]
-    f.config(state=NORMAL)
-    f.delete(1.0, END)
-    f.insert(END, value)
-    f.config(state=DISABLED)
-
-  def playing(self, p):
-    # called with new what's-playing information
-    values = {}
-    if p:
-      for tpart in ['artist', 'album', 'title']:
-        values[tpart] = part(client, p['track'], 'display', tpart)
-      try:
-        self.length = client.length(p['track'])
-      except disorder.operationError:
-        self.length = 0
-      self.started = int(p['played'])
-    else:
-      self.length = 0
-    for k in self.fields.keys():
-      if k in values:
-        self.set(k, values[k])
-      else:
-        self.set(k, "")
-    self.length_bar()
-
-  def length_bar(self):
-    if self.length and self.length > 0:
-      self.p.update(time.time() - self.started, self.length)
-    else:
-      self.p.clear()
-
-  def update_length(self):
-    self.length_bar()
-    self.after(1000, self.update_length)
-
-  def poll(self, c):
-    p = c.playing()
-    if p != self.last:
-      intercom.put(lambda: self.playing(p))
-      self.last = p
-
-  def quit(self):
-    sys.exit(0)
-
-  def scratch(self):
-    client.scratch()
-
-  def recent_close(self):
-    self.recentw.destroy()
-    self.recentw = None
-
-  def recent(self):
-    if self.recentw:
-      self.recentw.deiconify()
-      self.recentw.lift()
-    else:
-      w = 80*tracklistFont.measure('A')
-      h = 40*tracklistFont.metrics("linespace")
-      self.recentw = Toplevel()
-      self.recentw.protocol("WM_DELETE_WINDOW", self.recent_close)
-      self.recentw.title("Recently Played")
-      # XXX for some reason Toplevel(width=w,height=h) doesn't seem to work
-      self.recentw.geometry("%dx%d" % (w,h))
-      w = RecentWidget(self.recentw)
-      w.pack(fill=BOTH, expand=1)
-      mst.add(w);
-
-class TrackListWidget(Frame):
-  def __init__(self, master=None, **kw):
-    Frame.__init__(self, master, **kw)
-    self.yscrollbar = Scrollbar(self)
-    self.xscrollbar = Scrollbar(self, orient=HORIZONTAL)
-    self.canvas = Canvas(self,
-                         xscrollcommand=self.xscrollbar.set,
-                         yscrollcommand=self.yscrollbar.set)
-    self.xscrollbar.config(command=self.canvas.xview)
-    self.yscrollbar.config(command=self.canvas.yview)
-    self.canvas.grid(row=0, column=0, sticky=N+S+E+W)
-    self.yscrollbar.grid(row=0, column=1, sticky=N+S)
-    self.xscrollbar.grid(row=1, column=0, sticky=E+W)
-    self.columnconfigure(0,weight=1)
-    self.rowconfigure(0,weight=1)
-    self.last = None
-    self.default_cursor = self['cursor']
-    self.configure(cursor="watch")
-
-  def queue(self, q, w_artists, w_albums, w_titles, artists, albums, titles):
-    # called with new queue state
-    # delete old contents
-    try:
-      for i in self.canvas.find_all():
-        self.canvas.delete(i)
-    except TclError:
-      # if the call was queued but not received before the window was deleted
-      # we might get an error from Tcl/Tk, which no longer knows the window,
-      # here
-      return
-    w = tracklistHFont.measure("Artist")
-    if w > w_artists:
-      w_artists = w
-    w = tracklistHFont.measure("Album")
-    if w > w_albums:
-      w_albums = w
-    w = tracklistHFont.measure("Title")
-    if w > w_titles:
-      w_titles = w
-    hheading = tracklistHFont.metrics("linespace")
-    h = tracklistFont.metrics('linespace')
-    x_artist = 8
-    x_album = x_artist + w_artists + 16
-    x_title = x_album + w_albums + 16
-    w = x_title + w_titles + 8
-    self.canvas['scrollregion'] = (0, 0, w, h * len(artists) + hheading)
-    self.canvas.create_text(x_artist, 0, text="Artist",
-                            font=tracklistHFont,
-                            anchor='nw')
-    self.canvas.create_text(x_album, 0, text="Album",
-                            font=tracklistHFont,
-                            anchor='nw')
-    self.canvas.create_text(x_title, 0, text="Title",
-                            font=tracklistHFont,
-                            anchor='nw')
-    y = hheading
-    for n in range(0,len(artists)):
-      artist = artists[n]
-      album = albums[n]
-      title = titles[n]
-      if artist != "":
-        self.canvas.create_text(x_artist, y, text=artist,
-                                font=tracklistFont,
-                                anchor='nw')
-      if album != "":
-        self.canvas.create_text(x_album, y, text=album,
-                                font=tracklistFont,
-                                anchor='nw')
-      if title != "":
-        self.canvas.create_text(x_title, y, text=title,
-                                font=tracklistFont,
-                                anchor='nw')
-      y += h
-    self.last = q
-    self.configure(cursor=self.default_cursor)
-
-  def poll(self, c):
-    q = self.getqueue(c)
-    if q != self.last:
-      # we do the track name calculation in the background thread so that
-      # the gui can still be responsive
-      artists = []
-      albums = []
-      titles = []
-      w_artists = w_albums = w_titles = 16
-      for t in q:
-        artist = part(c, t['track'], 'display', 'artist')
-        album = part(c, t['track'], 'display', 'album')
-        title = part(c, t['track'], 'display', 'title')
-        w = tracklistFont.measure(artist)
-        if w > w_artists:
-          w_artists = w
-        w = tracklistFont.measure(album)
-        if w > w_albums:
-          w_albums = w
-        w = tracklistFont.measure(title)
-        if w > w_titles:
-          w_titles = w
-        artists.append(artist)
-        albums.append(album)
-        titles.append(title)
-      intercom.put(lambda: self.queue(q, w_artists, w_albums, w_titles,
-                                      artists, albums, titles))
-      self.last = q
-
-class QueueWidget(TrackListWidget):
-  def __init__(self, master=None, **kw):
-    TrackListWidget.__init__(self, master, **kw)
-
-  def getqueue(self, c):
-    return c.queue()
-
-class RecentWidget(TrackListWidget):
-  def __init__(self, master=None, **kw):
-    TrackListWidget.__init__(self, master, **kw)
-
-  def getqueue(self, c):
-    l = c.recent()
-    l.reverse()
-    return l
-
-class MonitorStateThread:
-  # thread to pick up current server state and publish it
-  #
-  # Creates a client and monitors it in a daemon thread for state changes.
-  # Whenever one occurs, call w.poll(c) for every member w of widgets with
-  # a client owned by the thread in which the call occurs.
-  def __init__(self, widgets, masterclient=None):
-    self.logclient = disorder.client()
-    self.client = disorder.client()
-    self.clientlock = threading.Lock()
-    if not masterclient:
-      masterclient = disorder.client()
-    self.masterclient = masterclient
-    self.widgets = widgets
-    self.lock = threading.Lock()
-    # the main thread
-    self.thread = threading.Thread(target=self.run)
-    self.thread.setDaemon(True)
-    self.thread.start()
-    # spare thread for processing additions
-    self.adderq = Queue.Queue()
-    self.adder = threading.Thread(target=self.runadder)
-    self.adder.setDaemon(True)
-    self.adder.start()
-
-  def notify(self, line):
-    self.lock.acquire()
-    widgets = self.widgets
-    self.lock.release()
-    for w in widgets:
-      self.clientlock.acquire()
-      w.poll(self.client)
-      self.clientlock.release()
-    return 1
-
-  def add(self, w):
-    self.lock.acquire()
-    self.widgets.append(w)
-    self.lock.release()
-    self.adderq.put(lambda client: w.poll(client))
-
-  def remove(self, what):
-    self.lock.acquire()
-    self.widgets.remove(what)    
-    self.lock.release()
-    
-  def run(self):
-    self.notify("")
-    self.logclient.log(lambda client, line: self.notify(line))
-
-  def runadder(self):
-    while True:
-      item = self.adderq.get()
-      self.clientlock.acquire()
-      item(self.client)
-      self.clientlock.release()
-
-########################################################################
-
-def usage(s):
-  # display usage on S
-  s.write(
-    """Usage:
-
-  tkdisorder [OPTIONS]
-
-Options:
-
-  -h, --help         Display this message
-  -V, --version      Display version number
-
-tkdisorder is copyright (c) 2004, 2005 Richard Kettlewell.
-""")
-
-########################################################################
-
-try:
-  opts, rest = getopt.getopt(sys.argv[1:], "Vh", ["version", "help"])
-except getopt.GetoptError, e:
-  sys.stderr.write("ERROR: %s, try --help for help\n" % e.msg)
-  sys.exit(1)
-for o, v in opts:
-  if o in ('-V', '--version'):
-    print "%s" % disorder.version
-    sys.stdout.close()
-    sys.exit(0)
-  if o in ('h', '--help'):
-    usage(sys.stdout)
-    sys.stdout.close()
-    sys.exit(0)
-
-client = disorder.client()              # master thread's client
-
-root = Tk()
-root.title("DisOrder")
-
-tracklistFont = tkFont.Font(family='Helvetica', size=10)
-tracklistHFont = tracklistFont.copy()
-tracklistHFont.config(weight="bold")
-
-p = PlayingWidget(root)
-p.pack(fill=BOTH, expand=1)
-
-q = QueueWidget(root)
-q.pack(fill=BOTH, expand=1)
-
-intercom = Intercom(root)               # only need a single intercom
-mst = MonitorStateThread([p, q], client)
-
-root.mainloop()
-
-# Local Variables:
-# py-indent-offset:2
-# comment-column:40
-# fill-column:79
-# End:
index 81574db6ae58032cd5c0d948f22da75278f588ef..3d9e6331b53194ab64f3f1d3693fd4f23ef17a17 100644 (file)
@@ -2,20 +2,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2004-2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 dist_pkgdata_DATA=completion.bash
@@ -25,7 +23,8 @@ SEDFILES=setup teardown
 
 include ${top_srcdir}/scripts/sedfiles.make
 
-EXTRA_DIST=htmlman sedfiles.make text2c oggrename make-unidata \
-       format-gcov-report make-version-string setup.in teardown.in macro-docs
+EXTRA_DIST=htmlman sedfiles.make text2c oggrename make-unidata fix-names \
+       format-gcov-report make-version-string setup.in teardown.in macro-docs \
+       setversion
 
 CLEANFILES=$(SEDFILES)
index d18a31d6213217c0c479d1a2ff2584d4ecc601b1..2766b176820d494ccbd94a153eb04d958b1b81db 100644 (file)
@@ -2,20 +2,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2005-2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 complete -r disorder 2>/dev/null || true
@@ -34,6 +32,7 @@ complete -o default \
              tags new rtp-address adduser users edituser deluser userinfo
              setup-guest schedule-del schedule-list
              schedule-set-global schedule-unset-global schedule-play
+             adopt
              playlist-del playlist-get playlist-set playlists
              -h --help -H --help-commands --version -V --config -c
              --length --debug -d" \
index 14aabdbe2693c995f591230af699bbf5d724228b..e899cc089646b77ecb8fece72e98fda9faac2a99 100755 (executable)
@@ -3,34 +3,78 @@
 # This file is part of DisOrder
 # Copyright (C) 2005-2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 set -e
-[ -d =build ] && cd =build
+web=$HOME/public_html/web/disorder
+
 make
-make check
+make distcheck
 make dist-bzip2
+v=$(make echo-version)
 d=$(make echo-distdir)
-cp $d.tar.bz2 $HOME/work/web/disorder
+src=$d.tar.bz2
+
+# Report and execute a command remotely
+remote() {
+  local h=$1
+  shift
+  echo "$h:" "$@"
+  ssh $h "$@"
+}
+
+# Build .debs and copy to the right place
+build() {
+  local h=$1                   # build host
+  local f=$2
+  local vs=$3
+  local dist=$4
+
+  remote $h "mkdir -p _builds"
+  remote $h "rm -rf _builds/*.deb _builds/$d"
+  scp $src $h:_builds
+  remote $h "cd _builds && tar xfj $src"
+  if [ "$vs" != "" ]; then
+    remote $h "cd _builds/$d && scripts/setversion $v~$vs 'Backport to $vs' $dist"
+  fi
+  remote $h "cd _builds/$d && fakeroot debian/rules binary"
+  mkdir -p $web/$f
+  scp $h:_builds/*.deb $web/$f/.
+}
+
+# Build various debs
+
+# Ubuntu dapper; binaries suit Debian etch too
+build dekabrach etch etch oldstable
+
+# Debian lenny (32-bit)
+build leucomorph lenny "" stable
+
+# Debian lenny (64-bit)
+build araminta lenny "" stable
+
+# Update the web
+cp $src $web
 cd doc
 for f in *.[1-9].html; do
   echo $f
-  rm -f $HOME/work/web/disorder/$f
-  sed < $f > $HOME/work/web/disorder/$f 's/^@.*//'
+  rm -f $web/$f
+  sed < $f > $web/$f 's/^@.*//'
 done
-cp plumbing.svg $HOME/work/web/disorder
-cp plumbing.png $HOME/work/web/disorder
+cp plumbing.svg $web/.
+if [ -f plumbing.png ]; then
+  cp plumbing.png $web/.
+fi
+
diff --git a/scripts/fix-names b/scripts/fix-names
new file mode 100755 (executable)
index 0000000..97845d2
--- /dev/null
@@ -0,0 +1,22 @@
+#! /usr/bin/perl -w
+use strict;
+
+my $act = 1;
+
+for my $f (@ARGV) {
+    if($f =~ /^-/) {
+       if($f eq '-n') {
+           $act = 0;
+       } else {
+           die "$0: unknown option: $f\n";
+       }
+       next;
+    }
+    my $t = $f;
+    $t =~ s/[_ ]+/ /g;
+    $t =~ s/(?!(?<=\.)[A-Za-z0-9]+$)\b[a-z]/\U$&\E/g;
+    print "$f -> $t\n";
+    if($act) {
+       (rename $f, $t) or die "$0: $f -> $t: $!\n";
+    }
+}
index 0369ab63d3be84f624fcd9c291f957940f41a8e5..93ace17d31bbcc27ee6346d9c0360bf19d0ac396 100755 (executable)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2007 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 import re,sys,os,string
 
@@ -33,6 +31,9 @@ def sgmlquotechar(c):
 def sgmlquote(s):
   return string.join(map(sgmlquotechar, s),'')
 
+def line_count(f):
+  return len(open(f, "r").readlines())
+
 missing = {}
 percent = {}
 total_lines = 0
@@ -66,6 +67,10 @@ for line in sys.stdin:
       covered_lines += this_lines * this_pc / 100.0
     name = None
 
+for m in missing:
+  percent[m] = 0
+  total_lines += line_count(m)
+
 def cmp(a,b):
   if percent[a] < percent[b]: return -1 
   elif percent[a] > percent[b]: return 1
@@ -82,22 +87,35 @@ if len(keys):
 if htmldir is not None and len(keys):
   index = open(os.path.join(htmldir, "index.html"), "w")
   index.write("<html><head><title>gcov report</title>\n")
+  index.write("<style type=\"text/css\">\n");
+  index.write(".missing {\n");
+  index.write("  color: red;\n");
+  index.write("}\n");
+  index.write(".bar {\n");
+  index.write("  width: 400px;\n");
+  index.write("}\n");
+  index.write(".bar div {\n");
+  index.write("  background-color: #00ff00;\n");
+  index.write("  height: 1em;\n");
+  index.write("}\n");
+  index.write("</style>\n");
   index.write("<body><h1>gcov report</h1>\n")
-  index.write("<table><tr><th>File</th><th>Coverage</th></tr>\n")
+  index.write("<table><tr><th>File</th><th colspan=2>Coverage</th></tr>\n")
   for k in keys:
-    index.write("<tr><td><a href=\"%s.html\">%s</a><td>%d%%\n" %
-                (sgmlquote(k), sgmlquote(k), percent[k]))
+    index.write("<tr>\n")
+    if k in missing:
+      index.write("<td><span class=missing>%s</span>\n" % sgmlquote(k))
+    else:
+      index.write("<td><a href=\"%s.html\">%s</a>\n" %
+                  (sgmlquote(k), sgmlquote(k)))
+    index.write("<td>%d%%\n" % percent[k])
+    index.write("<td class=bar><div style=\"width: %d%%\"></div></td>\n"
+                % int(percent[k]))
   index.write("</table>\n")
   index.write("<p>Total coverage: %d%%</p>\n" % (100 * (covered_lines / total_lines)))
-  missing_files = missing.keys()
-  missing_files.sort()
-  if len(missing_files) > 0:
-    index.write("<p>Missing files:</p>\n")
-    index.write("<ul>\n")
-    for mf in missing_files:
-      index.write("<li><a href=\"%s\">%s</a></li>\n" % (mf, mf))
-    index.write("</lu>\n")
   for k in keys:
+    if k in missing:
+      continue
     html = open(os.path.join(htmldir, "%s.html" % k), "w")
     html.write("<html><head><title>%s</title>\n" % sgmlquote(k))
     html.write("<body><h1>%s</h1>\n" % sgmlquote(k))
index 17fc7f3b6a05e5da88989ad9410f5766428a675c..21452dce500c0df6a45e6cba9ff887befc6ecd34 100755 (executable)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder
 # Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 set -e
index e75db113760ea3584a90684e7c4e9be3e1fca76e..afbe8f5d20953457703a28aa7fe6830a58b2ed2f 100755 (executable)
@@ -2,20 +2,18 @@
 #
 # Copyright (C) 2004-2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 set -e
index 51586ea4385d6872e154466a5ca93ff91da977e1..265ee350506c322312a04fad81ce7e594fd5e95d 100755 (executable)
@@ -6,7 +6,7 @@ my $name;
 my $docs;
 while(defined($_ = <>)) {
   chomp;
-  if(!defined $name and m,^/\*! (\@?([a-z\-]+).*),) {
+  if(!defined $name and m,^/\*\$ (\@?([a-z\-]+).*),) {
     $name = $2;
     my $heading = $1;
     $docs = [$heading];
index 5611b0d0d6899f7f59d096703760ca71dfef518d..d1490cc77fac7a3c662097cf5216be06000f70b5 100755 (executable)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2007 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 #
 # Generate Unicode support tables
@@ -338,7 +336,13 @@ while(<>) {
 print STDERR "Generating unidata.h...\n";
 open(STDOUT, ">unidata.h") or die "unidata.h: $!\n";
 
-out("/* Automatically generated file, see scripts/make-unidata */\n",
+out("/** \@file lib/unidata.h\n",
+    " * \@brief Unicode tables\n",
+    " *\n",
+    " * Automatically generated file, see scripts/make-unidata\n",
+    " *\n",
+    " * DO NOT EDIT.\n",
+    " */\n",
     "#ifndef UNIDATA_H\n",
     "#define UNIDATA_H\n");
 
@@ -438,7 +442,13 @@ close STDOUT or die "unidata.h: $!\n";
 print STDERR "Generating unidata.c...\n";
 open(STDOUT, ">unidata.c") or die "unidata.c: $!\n";
 
-out("/* Automatically generated file, see scripts/make-unidata */\n",
+out("/** \@file lib/unidata.c\n",
+    " * \@brief Unicode tables\n",
+    " *\n",
+    " * Automatically generated file, see scripts/make-unidata\n",
+    " *\n",
+    " * DO NOT EDIT.\n",
+    " */\n",
     "#include \"common.h\"\n",
     "#include \"unidata.h\"\n");
 
index 10112ec88d24a4bdfc09a63c4b1f69b54acd099c..41a7115c1882462515ed7ab4203d3e4a7f799590 100755 (executable)
@@ -26,8 +26,8 @@ if(exists $ENV{CC}) {
 die "no version found\n" unless defined $version;
 output("%s (DisOrder) $version\n");
 output("Copyright (C) 2003-2008 Richard Kettlewell et al\n");
-output("License GPLv2+: GNU GPL version 2 or later:\n");
-output("        http://www.gnu.org/licenses/old-licenses/gpl-2.0.html\n");
+output("License GPLv3+: GNU GPL version 3 or later:\n");
+output("        http://www.gnu.org/licenses/gpl-3.0.html\n");
 output("This is free software: you are free to change and redistribute it.\n");
 output("There is NO WARRANTY, to the extent permitted by law.\n");
 output("WARNING: -Werror not used in this build\n") if $cc !~ /-Werror/;
index 6c18cb9625c34ee2df25ccc7fd9240e3e8dc2af6..8a7663d25b0db8e08741a12c11f4f884188d1611 100755 (executable)
@@ -2,20 +2,18 @@
 #
 # Copyright (C) 2004, 2005 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 set -e
index 8a0cec5f56a9cf19d5e394e3cd22a8cb56c96a48..9ab0c083a3e45716b105d8ee7190b533b660463d 100644 (file)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder
 # Copyright (C) 2006 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 use strict;
index 5b7a64975dacbeb5428b8f57be764ab12cd81296..5a28face2c2102b71df0856126f40283e0742e7f 100644 (file)
@@ -2,20 +2,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2004-2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 $(SEDFILES) : % : %.in Makefile
index 68d9a4a0a4271b6f5eef3774565e6a2b9988cfb0..b7fdecd22282ee5a138a02963dfa1b6cce5465f7 100755 (executable)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder
 # Copyright (C) 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 set -e
diff --git a/scripts/setversion b/scripts/setversion
new file mode 100755 (executable)
index 0000000..c3f0a37
--- /dev/null
@@ -0,0 +1,72 @@
+#! /usr/bin/perl -w
+#
+# scripts/setversion VERSION [DESCRIPTION [DISTRIBUTION]]
+#
+# Sets a new version number, including a debian/changelog entry (albeit
+# a rather terse and informal one).
+
+use strict;
+use POSIX qw(strftime uname);
+
+my $version = shift;
+my $description;
+my $distribution;
+if(@ARGV > 0) {
+    $description = shift;
+} else {
+    $description = "DisOrder $version";
+}
+if(@ARGV > 0) {
+    $distribution = shift;
+} else {
+    $distribution = "unstable";
+}
+
+my $hostname = (uname)[1];
+$hostname = (gethostbyname($hostname))[0];
+my $logname = (getpwuid($<))[0];
+my $name = (getpwuid($<))[6];
+$name =~ s/,.*//;
+my $email = "$logname\@$hostname";
+if(exists $ENV{"EMAIL"}) {
+    $email = $ENV{"EMAIL"};
+}
+my $date = strftime("%a, %d %b %Y %H:%M:%S %z", localtime);
+
+sub input {
+    my $path = shift;
+    open(C, "<$path") or die "$path: $!\n";
+    my @f = <C>;
+    close C;
+    return @f;
+}
+
+sub output {
+    my $path = shift;
+    my $contents = shift;
+    my $new = "$path.new";
+    (open(O, ">$new")
+     and (print O @$contents)
+     and (close O))
+       or die "$new: $!\n";
+    (rename $new, $path)
+       or die "$new -> $path: $!\n";
+}
+
+my @c = input("configure.ac");
+foreach(@c) {
+    if(/^AC_INIT|AM_INIT/) {
+       s/\[[0-9\.\+]+\]/[$version]/g;
+    }
+}
+output("configure.ac", \@c);
+
+@c = input("debian/changelog");
+unshift(@c,
+       "disorder ($version) $distribution; urgency=low\n",
+       "\n",
+       "  * $description\n",
+       "\n",
+       " -- $name <$email>  $date\n",
+       "\n");
+output("debian/changelog", \@c);
index 66d17e72aeeceda42eaba1ff48f96ac2df450e16..39b34f27903b1b33ad9e37e90953cd0249c2e3d7 100755 (executable)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder
 # Copyright (C) 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 set -e
 
index 937fe666c01fc9fd5d29de9d2fc043820df208c3..b7e19b9b27865e9215a8fd3b04644ea03d3b7b6d 100755 (executable)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2004-2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 my $class = "static";
 if($ARGV[0] eq '-extern') {
index 6d497a1c3058ba9535bc728260e1ea90f9114712..62ad1c43474937b9261cfd6c55458b3129e2d28d 100644 (file)
@@ -2,20 +2,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2004-2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 sbin_PROGRAMS=disorderd disorder-deadlock disorder-rescan disorder-dump \
@@ -138,3 +136,5 @@ check-decode: disorder-decode disorder-normalize
        rm -f scratch.wav config decoded.raw oggdec.raw
 
 EXTRA_DIST=README.dbversions
+
+CLEANFILES=*.gcda *.gcov *.gcno *.c.html index.html
index 174ed88cc0a76dc0f81a7f50fad45e2acefeeb76..9321770b3349fe848cc7680fbadde13f9c900944 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "common.h"
index 9d61fcb0d28e50797909e4ce4353919e6020ad3b..99a94100ef5a17040ff0f0f0330cde3ae343f72d 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #ifndef API_CLIENT_H
 #define API_CLIENT_H
index 173c82e4f183bc0fc01d796cc50484c117e96378..bfd8923bee57c5e31bc00185fe0e4dc4217c3038 100644 (file)
@@ -2,20 +2,23 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file server/api-server.c
+ * @brief Server API functions
+ *
+ * These functions are made available to server-side plugins.
  */
 
 #include "disorder-server.h"
index 11564f85cb1da0e5716bcae2efb768387e16089a..fe9686c19e1f2b09394d273b86841eb39ddc53fa 100644 (file)
@@ -2,22 +2,24 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file server/api.c
+ * @brief Generic API
+ *
+ * These functions are made available to all kinds of plugins.
  */
-
 #include "disorder-server.h"
 
 /* shared implementation of vararg functions */
index f1d06b80c6723fffb465e982a495e954397a0133..bc824752331bbdd89c7b0fc6170eda15fcbd0d6b 100644 (file)
@@ -3,22 +3,20 @@
  * Copyright (C) 2008 Richard Kettlewell
  * Copyright (C) 2008 Mark Wooding
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-/** @file choose.c
+/** @file server/choose.c
  * @brief Random track chooser
  *
  * Picks a track at random and writes it to standard output.  If for
@@ -54,7 +52,7 @@ static void help(void) {
          "  --debug, -d             Turn on debugging\n"
           "  --[no-]syslog           Enable/disable logging to syslog\n"
           "\n"
-          "Track choose for DisOrder.  Not intended to be run\n"
+          "Track chooser for DisOrder.  Not intended to be run\n"
           "directly.\n");
   xfclose(stdout);
   exit(0);
@@ -297,8 +295,10 @@ int main(int argc, char **argv) {
   if((err = trackdb_get_global_tid("prohibited-tags", global_tid, &tags)))
     fatal(0, "error getting prohibited-tags: %s", db_strerror(err));
   prohibited_tags = parsetags(tags);
-  if(trackdb_scan(0, collect_tracks_callback, 0, global_tid))
+  if(trackdb_scan(0, collect_tracks_callback, 0, global_tid)) {
+    global_tid->abort(global_tid);
     exit(1);
+  }
   trackdb_commit_transaction(global_tid);
   trackdb_close();
   trackdb_deinit();
index 5f6e2260640b69909968f39f23dd85614aedc337..c86154b747a553ecc34977761cfeb0419d54ac6a 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file server/daemonize.c
  * @brief Go into background
index 74354b714d82615ebef824846d86eedcc2d8d664..bd08eed738e0dc7ee518a2072dc87eb8d4999e0f 100644 (file)
@@ -2,20 +2,23 @@
  * This file is part of DisOrder
  * Copyright (C) 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file server/dbupgrade.c
+ * @brief Database upgrade utility
+ *
+ * Invoked by the server when necessary.
  */
 #include "disorder-server.h"
 
index 1a473018feb0129555c1a78d1706fc2a9a32b73e..3c1335133b6d994d936b53e49178a80b54ba8a3a 100644 (file)
@@ -2,22 +2,24 @@
  * This file is part of DisOrder 
  * Copyright (C) 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file server/deadlock.c
+ * @brief Deadlock monitor
+ *
+ * Spawned by the server.
  */
-
 #include "disorder-server.h"
 
 static const struct option options[] = {
index 3a1e1a9f6a891b41105875cf42defe6c2c954e55..ef999b3ab3dd327dceb0bd13bcc26eb3dd49d67e 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file server/decode.c
  * @brief General-purpose decoder for use by speaker process
@@ -38,6 +36,7 @@
 #include "wav.h"
 #include "speaker-protocol.h"
 
+
 /** @brief Encoding lookup table type */
 struct decoder {
   /** @brief Glob pattern matching file */
index 361bd4fd59235011c35290235497d1e44abc2996..4eb58e45845e9f34689104166d8272888cc7fd87 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file server/disorder-server.h
+ * @brief Definitions for server and allied utilities
  */
 
 #ifndef DISORDER_SERVER_H
@@ -41,6 +42,7 @@
 #include <sys/time.h>
 #include <sys/types.h>
 #include <sys/un.h>
+#include <sys/resource.h>
 #include <syslog.h>
 #include <time.h>
 #include <unistd.h>
@@ -120,7 +122,7 @@ void recent_write(void);
 /* write the recently played list out.  Calls @fatal@ on error. */
 
 struct queue_entry *queue_add(const char *track, const char *submitter,
-                             int where);
+                             int where, enum track_origin origin);
 #define WHERE_START 0                  /* Add to head of queue */
 #define WHERE_END 1                    /* Add to end of queue */
 #define WHERE_BEFORE_RANDOM 2          /* End, or before random track */
index e78c28fc69ea511f76f78b8d28803682b73445e8..2342c3c07e63fd67b620a667a3c224a506933eb4 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file server/disorderd.c
+ * @brief Main DisOrder server
  */
 #include "disorder-server.h"
 
@@ -98,7 +99,7 @@ static int periodic_callback(ev_source *ev_,
 }
 
 /** @brief Create a periodic action
- * @param ev Event loop
+ * @param ev_ Event loop
  * @param callback Callback function
  * @param period Interval between calls in seconds
  * @param immediate If true, call @p callback straight away
@@ -173,6 +174,7 @@ static void fix_path(void) {
 int main(int argc, char **argv) {
   int n, background = 1, logsyslog = 0;
   const char *pidfile = 0;
+  struct rlimit rl[1];
 
   set_progname(argv);
   mem_init();
@@ -207,6 +209,18 @@ int main(int argc, char **argv) {
   srand(time(0));                      /* don't start the same every time */
   /* gcrypt initialization */
   gcry_control(GCRYCTL_INIT_SECMEM, 1);
+  /* make sure we can't have more than FD_SETSIZE files open (event.c does
+   * check but this provides an additional line of defence) */
+  if(getrlimit(RLIMIT_NOFILE, rl) < 0)
+    fatal(errno, "getrlimit RLIMIT_NOFILE");
+  if(rl->rlim_cur > FD_SETSIZE) {
+    rl->rlim_cur = FD_SETSIZE;
+    if(setrlimit(RLIMIT_NOFILE, rl) < 0)
+      fatal(errno, "setrlimit to reduce RLIMIT_NOFILE to %lu",
+            (unsigned long)rl->rlim_cur);
+    info("set RLIM_NOFILE to %lu", (unsigned long)rl->rlim_cur);
+  } else
+    info("RLIM_NOFILE is %lu", (unsigned long)rl->rlim_cur);
   /* create event loop */
   ev = ev_new();
   if(ev_child_setup(ev)) fatal(0, "ev_child_setup failed");
index f8be9cd488cfc01135109814424a02736f262249..ab48e48558586db970360f022153527794776ee8 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file server/dump.c
+ * @brief Dump and restore database contents
  */
-
 #include "disorder-server.h"
 
 static const struct option options[] = {
index ddfabbb979974be1590e19c7d1b42c4c636fd761..fb8426f2428c26163970bd81198755d4f31b5060 100644 (file)
@@ -2,22 +2,25 @@
  * This file is part of DisOrder.
  * Copyright (C) 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file server/exports.c
+ * @brief Server exports
+ *
+ * Force functions to be included in the server so they can be exported
+ * to plugins.
  */
-
 #include "disorder.h"
 
 typedef void (*fptr)(void);
index 956eb6b7a973a89e50fa67e08243981da767ef2c..db5b9d517b11ee8189b565ed2358344b6edf6f22 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file server/normalize.c
  * @brief Convert "raw" format output to the configured format
index 756031de34951b1f9e887fa2444dd1198a88c8dd..93a7f48fa8996f8a8d6b456245b652f477c16fdc 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file server/play.c
+ * @brief Playing tracks
  */
 
 #include "disorder-server.h"
@@ -127,7 +128,8 @@ void speaker_setup(ev_source *ev) {
   /* Wait for the speaker to be ready */
   speaker_recv(speaker_fd, &sm);
   nonblock(speaker_fd);
-  ev_fd(ev, ev_read, speaker_fd, speaker_readable, 0, "speaker read");
+  if(ev_fd(ev, ev_read, speaker_fd, speaker_readable, 0, "speaker read") < 0)
+    fatal(0, "error registering speaker socket fd");
 }
 
 void speaker_reload(void) {
@@ -364,7 +366,8 @@ static int start(ev_source *ev,
             || write(sfd, q->id, l) < 0)
            fatal(errno, "writing to %s", addr.sun_path);
          /* Await the ack */
-         read(sfd, &l, 1);
+         if (read(sfd, &l, 1) < 0) 
+               fatal(errno, "reading ack from %s", addr.sun_path);
          /* Plumbing */
          xdup2(np[0], 0);
          xdup2(sfd, 1);
@@ -480,6 +483,7 @@ void abandon(ev_source attribute((unused)) *ev,
 }
 
 /** @brief Called with a new random track
+ * @param ev Event loop
  * @param track Track name
  */
 static void chosen_random_track(ev_source *ev,
@@ -489,8 +493,7 @@ static void chosen_random_track(ev_source *ev,
   if(!track)
     return;
   /* Add the track to the queue */
-  q = queue_add(track, 0, WHERE_END);
-  q->state = playing_random;
+  q = queue_add(track, 0, WHERE_END, origin_random);
   D(("picked %p (%s) at random", (void *)q, q->track));
   queue_write();
   /* Maybe a track can now be played */
@@ -532,9 +535,10 @@ void play(ev_source *ev) {
   }
   /* There must be at least one track in the queue. */
   q = qhead.next;
-  /* If random play is disabled but the track is a random one then don't play
-   * it.  play() will be called again when random play is re-enabled. */
-  if(!random_enabled && q->state == playing_random)
+  /* If random play is disabled but the track is a non-adopted random one
+   * then don't play it.  play() will be called again when random play is
+   * re-enabled. */
+  if(!random_enabled && q->origin == origin_random)
     return;
   D(("taken %p (%s) from queue", (void *)q, q->track));
   /* Try to start playing. */
@@ -640,8 +644,7 @@ void scratch(const char *who, const char *id) {
      * bother if playing is disabled) */
     if(playing_is_enabled() && config->scratch.n) {
       int r = rand() * (double)config->scratch.n / (RAND_MAX + 1.0);
-      q = queue_add(config->scratch.s[r], who, WHERE_START);
-      q->state = playing_isscratch;
+      q = queue_add(config->scratch.s[r], who, WHERE_START, origin_scratch);
     }
     notify_scratch(playing->track, playing->submitter, who,
                   time(0) - playing->played);
index a0c7d356268fe40b2a59d83fd5396fdbe54149d3..6695d5a9b1c814103962605b013f602c57521939 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file server/plugin.c
+ * @brief Server plugin interface
  */
-
 #include "disorder-server.h"
 
 #include <dlfcn.h>
index 952cb71609ba81ed827b8513fdf9a13c802e3763..7dfcdb1339ece9769c0700ac4da0650f6be71608 100644 (file)
@@ -2,20 +2,21 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file server/queue-ops.c
+ * @brief Track queues (server-specific code)
  */
 #include "disorder-server.h"
 
@@ -48,13 +49,14 @@ static void queue_id(struct queue_entry *q) {
 }
 
 struct queue_entry *queue_add(const char *track, const char *submitter,
-                             int where) {
+                             int where, enum track_origin origin) {
   struct queue_entry *q, *beforeme;
 
   q = xmalloc(sizeof *q);
   q->track = xstrdup(track);
   q->submitter = submitter ? xstrdup(submitter) : 0;
   q->state = playing_unplayed;
+  q->origin = origin;
   queue_id(q);
   time(&q->when);
   switch(where) {
@@ -69,7 +71,7 @@ struct queue_entry *queue_add(const char *track, const char *submitter,
      * at the end. */
     beforeme = &qhead;
     while(beforeme->prev != &qhead
-         && beforeme->prev->state == playing_random)
+         && beforeme->prev->origin == origin_random)
       beforeme = beforeme->prev;
     queue_insert_entry(beforeme->prev, q);
     break;
index 1c2c973ac0e4ecb929f720b67380e3304af32b7e..1380e24fd493709bc188011b0b9104b2c745cfd2 100644 (file)
@@ -2,22 +2,24 @@
  * This file is part of DisOrder 
  * Copyright (C) 2005-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file server/rescan.c
+ * @brief Rescanning utility
+ *
+ * Invoked by the server.
  */
-
 #include "disorder-server.h"
 
 static time_t last_report;
index 6092fb5b227e9dc95b896ae268befc1ea989e387..ec7eddce118d49b901055994372be1b13035f23a 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 /** @file server/schedule.c
@@ -97,6 +95,9 @@ static const char *const schedule_required[] = {"when", "who", "action"};
 
 /** @brief Parse a scheduled event key and data
  * @param k Pointer to key
+ * @param d Pointer to data
+ * @param idp Where to store event ID
+ * @param actiondatap Where to store parsed data
  * @param whenp Where to store timestamp
  * @return 0 on success, non-0 on error
  *
@@ -227,8 +228,9 @@ void schedule_init(ev_source *ev) {
 /******************************************************************************/
 
 /** @brief Create a scheduled event
- * @param ev Event loop
+ * @param id Event ID
  * @param actiondata Action data
+ * @param tid Containing transaction
  */
 static int schedule_add_tid(const char *id,
                            struct kvp *actiondata,
@@ -372,7 +374,7 @@ static void schedule_play(ev_source *ev,
     return;
   }
   info("scheduled event %s: %s play %s", id,  who, track);
-  q = queue_add(track, who, WHERE_START);
+  q = queue_add(track, who, WHERE_START, origin_scheduled);
   queue_write();
   if(q == qhead.next && playing)
     prepare(ev, q);
@@ -418,6 +420,7 @@ static struct {
 };
 
 /** @brief Look up a scheduled event
+ * @param id Event ID
  * @param actiondata Event description
  * @return index in schedule_actions[] on success, -1 on error
  *
index a83ee56e9d08092fbbef3608d9677a2714a5e138..88e772332513b12240193a1e643578ac4d972dc0 100644 (file)
@@ -2,29 +2,33 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 #include "disorder-server.h"
 
 /* the head of the queue is played next, so normally we add to the tail */
-struct queue_entry qhead = { &qhead, &qhead, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+struct queue_entry qhead = {
+  .next = &qhead,
+  .prev = &qhead
+};
 
 /* the head of the recent list is the oldest thing, the tail the most recently
  * played */
-struct queue_entry phead = { &phead, &phead, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+struct queue_entry phead = {
+  .next = &phead,
+  .prev = &phead
+};
 
 long pcount;
 
@@ -61,6 +65,7 @@ static void queue_do_read(struct queue_entry *head, const char *path) {
   char *buffer;
   FILE *fp;
   struct queue_entry *q;
+  int ver = 0;
 
   if(!(fp = fopen(path, "r"))) {
     if(errno == ENOENT)
@@ -69,8 +74,31 @@ static void queue_do_read(struct queue_entry *head, const char *path) {
   }
   head->next = head->prev = head;
   while(!inputline(path, fp, &buffer, '\n')) {
+    if(buffer[0] == '#') {
+      /* Version indicator */
+      ver = atoi(buffer + 1);
+      continue;
+    }
     q = xmalloc(sizeof *q);
     queue_unmarshall(q, buffer, queue_read_error, (void *)path);
+    if(ver < 1) {
+      /* Fix up origin field as best we can; will be wrong in some cases but
+       * hopefully not too horribly so. */
+      q->origin = q->submitter ? origin_picked : origin_random;
+      /* Eliminated obsolete states, since they are assumed elsewhere not to be
+       * set. */
+      switch(q->state) {
+      case playing_isscratch:
+        q->origin = origin_scratch;
+        q->state = playing_unplayed;
+        break;
+      case playing_random:
+        q->state = playing_unplayed;
+        break;
+      default:
+        break;
+      }
+    }
     if(head == &qhead
        && (!q->track
           || !q->when))
@@ -105,6 +133,9 @@ static void queue_do_write(const struct queue_entry *head, const char *path) {
 
   byte_xasprintf(&tmp, "%s.new", path);
   if(!(fp = fopen(tmp, "w"))) fatal(errno, "error opening %s", tmp);
+  /* Save version indicator */
+  if(fprintf(fp, "#1\n") < 0)
+    fatal(errno, "error writing %s", tmp);
   for(q = head->next; q != head; q = q->next)
     if(fprintf(fp, "%s\n", queue_marshall(q)) < 0)
       fatal(errno, "error writing %s", tmp);
index 64d29e0ad1ca0449e1a45513baefd025600111aa..320cbb174ec94c0f925d8e607773d03e6193fc8d 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "disorder-server.h"
@@ -239,7 +237,7 @@ static int c_play(struct conn *c, char **vec,
     sink_writes(ev_writer_sink(c->w), "550 cannot resolve track\n");
     return 1;
   }
-  q = queue_add(track, c->who, WHERE_BEFORE_RANDOM);
+  q = queue_add(track, c->who, WHERE_BEFORE_RANDOM, origin_picked);
   queue_write();
   /* If we added the first track, and something is playing, then prepare the
    * new track.  If nothing is playing then we don't bother as it wouldn't gain
@@ -1618,6 +1616,31 @@ static int c_schedule_add(struct conn *c,
   return 1;
 }
 
+static int c_adopt(struct conn *c,
+                  char **vec,
+                  int attribute((unused)) nvec) {
+  struct queue_entry *q;
+
+  if(!c->who) {
+    sink_writes(ev_writer_sink(c->w), "550 no identity\n");
+    return 1;
+  }
+  if(!(q = queue_find(vec[0]))) {
+    sink_writes(ev_writer_sink(c->w), "550 no such track on the queue\n");
+    return 1;
+  }
+  if(q->origin != origin_random) {
+    sink_writes(ev_writer_sink(c->w), "550 not a random track\n");
+    return 1;
+  }
+  q->origin = origin_adopted;
+  q->submitter = xstrdup(c->who);
+  eventlog("adopted", q->id, q->submitter, (char *)0);
+  queue_write();
+  sink_writes(ev_writer_sink(c->w), "250 OK\n");
+  return 1;
+}
+
 static int playlist_response(struct conn *c,
                              int err) {
   switch(err) {
@@ -1785,6 +1808,7 @@ static const struct command {
   rights_type rights;
 } commands[] = {
   { "adduser",        2, 3,       c_adduser,        RIGHT_ADMIN|RIGHT__LOCAL },
+  { "adopt",          1, 1,       c_adopt,          RIGHT_PLAY },
   { "allfiles",       0, 2,       c_allfiles,       RIGHT_READ },
   { "confirm",        1, 1,       c_confirm,        0 },
   { "cookie",         1, 1,       c_cookie,         0 },
@@ -2020,8 +2044,18 @@ static int listen_callback(ev_source *ev,
   c->ev = ev;
   c->w = ev_writer_new(ev, fd, writer_error, c,
                       "client writer");
+  if(!c->w) {
+    error(0, "ev_writer_new for file inbound connection (fd=%d) failed",
+          fd);
+    close(fd);
+    return 0;
+  }
   c->r = ev_reader_new(ev, fd, redirect_reader_callback, reader_error, c,
                       "client reader");
+  if(!c->r)
+    /* Main reason for failure is the FD is too big and that will already have
+     * been handled */
+    fatal(0, "ev_reader_new for file inbound connection (fd=%d) failed", fd);
   ev_tie(c->r, c->w);
   c->fd = fd;
   c->reader = reader_callback;
index 21a9a75889e0835a312475d030d26b58a06d1b6d..d10ec198b5b15845c8ddea8c8a4d7090cc3248cd 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2005, 2006, 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file server/speaker-alsa.c
  * @brief Support for @ref BACKEND_ALSA */
index 7e19e2b58a961332a61aed5a298c8cd3a359d9d7..e85d198ca0a5000e8fe7a0207ca45cafcd5b80f6 100644 (file)
@@ -3,20 +3,18 @@
  * Copyright (C) 2005, 2006, 2007 Richard Kettlewell
  * Portions (C) 2007 Mark Wooding
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file server/speaker-command.c
  * @brief Support for @ref BACKEND_COMMAND */
index df2759b09f2f149a84f17a7db12acf0394c32ef0..42c3a36083257b2bf32a71d2358b266ce31eab7c 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2007 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file server/speaker-coreaudio.c
  * @brief Support for @ref BACKEND_COREAUDIO
index 2d8d2cba95cf2278f3838529c966ef7af7d1e6a4..e8a7190413dc914f90fabaf6ceb64c590375518c 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2005-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file server/speaker-network.c
  * @brief Support for @ref BACKEND_NETWORK */
@@ -204,7 +202,7 @@ static size_t network_play(size_t frames) {
     /* Find the number of microseconds elapsed since rtp_time=0 */
     delta = tvsub_us(now, rtp_time_0);
     if(delta > UINT64_MAX / 88200)
-      fatal(0, "rtp_time=%llu now=%ld.%06ld rtp_time_0=%ld.%06ld delta=%llu (%lld)",
+      fatal(0, "rtp_time=%"PRIu64" now=%ld.%06ld rtp_time_0=%ld.%06ld delta=%"PRIu64" (%"PRId64")",
             rtp_time,
             (long)now.tv_sec, (long)now.tv_usec,
             (long)rtp_time_0.tv_sec, (long)rtp_time_0.tv_usec,
@@ -304,7 +302,7 @@ static void network_beforepoll(int *timeoutp) {
   xgettimeofday(&now, 0);
   target_us = tvsub_us(now, rtp_time_0);
   if(target_us > UINT64_MAX / 88200)
-    fatal(0, "rtp_time=%llu rtp_time_0=%ld.%06ld now=%ld.%06ld target_us=%llu (%lld)\n",
+    fatal(0, "rtp_time=%"PRIu64" rtp_time_0=%ld.%06ld now=%ld.%06ld target_us=%"PRIu64" (%"PRId64")\n",
           rtp_time,
           (long)rtp_time_0.tv_sec, (long)rtp_time_0.tv_usec,
           (long)now.tv_sec, (long)now.tv_usec,
index 95dcfe397cad023129ad9721ba48fd7807d0c582..a84d0bbcffdf3841611458e2f04b4e99d4d6e590 100644 (file)
@@ -3,20 +3,18 @@
  * Copyright (C) 2007, 2008 Richard Kettlewell
  * Portions copyright (C) 2007 Ross Younger
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file server/speaker-oss.c
  * @brief Support for @ref BACKEND_OSS */
index 3021652ec17cf1d9473dd0239f5d7956da3ea48c..340e995a84c40e35779c934e3ee0b2fe99f6d6c5 100644 (file)
@@ -3,20 +3,18 @@
  * Copyright (C) 2005-2008 Richard Kettlewell
  * Portions (C) 2007 Mark Wooding
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file server/speaker.c
  * @brief Speaker process
@@ -492,7 +490,8 @@ static void mainloop(void) {
           id[l] = 0;
           D(("id %s fd %d", id, fd));
           t = findtrack(id, 1/*create*/);
-          write(fd, "", 1);             /* write an ack */
+          if (write(fd, "", 1) < 0)             /* write an ack */
+                       error(errno, "writing ack to inbound connection");
           if(t->fd != -1) {
             error(0, "%s: already got a connection", id);
             xclose(fd);
index 228804254efe3ccd3f4bd6018515b0be43b8bb0f..0cc0cb824e23f80d49f2e65806cc89659cf94e60 100644 (file)
@@ -2,20 +2,18 @@
  * This file is part of DisOrder
  * Copyright (C) 2005-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 /** @file server/speaker.h
  * @brief Speaker process
index 2be2edd53e8a12401163f10a48f128d27a075587..a99474eff11e65ef9a9a6bfa99c401a47595e34f 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file server/state.c
+ * @brief Global server state
  */
-
 #include "disorder-server.h"
 
 static const char *current_unix;
index 2725fd5c7afd887e6d5103a7d1c8a395d622d5c8..81c92f44473570997c0084cd84f0747bb3a078a7 100644 (file)
@@ -2,20 +2,24 @@
  * This file is part of DisOrder
  * Copyright (C) 2007, 2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file server/stats.c
+ * @brief Generate server statistics
+ *
+ * This is done in a subprogram because it can be quite slow and we don't want
+ * to wedge the rest of the server for the duration.
  */
 
 #include "disorder-server.h"
index 3639c52bd43c3f9c347cc7f6f59a144caba9ffb6..ec84f682a3eb660e79ce532d08ca9cc2112ca436 100644 (file)
@@ -2,22 +2,22 @@
  * This file is part of DisOrder.
  * Copyright (C) 2004-2008 Richard Kettlewell
  *
- * This program is free software; you can redistribute it and/or modify
+ * 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
+ * the Free Software Foundation, either version 3 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.
- *
+ * 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
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+/** @file server/trackname.c
+ * @brief Utility to run the track name calculator in isolation
  */
-
 #include "disorder-server.h"
 
 static const struct option options[] = {
index 3722c39e404c2d78ce8f97292004d47d59f87998..df6c5a9d64753518ae79e7be9fd92da9c8989a5d 100644 (file)
@@ -2,20 +2,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2004, 2007, 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 pkgdata_DATA=slap.ogg scratch.ogg
index 700b695ae309bef7e5cf2ee8c9e5494736270aff..b769eaff1d88e3de4fc69894f59a0e0202fd368f 100644 (file)
@@ -2,20 +2,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2004-2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 pkgdata_DATA=about.tmpl choose.tmpl playing.tmpl recent.tmpl           \
index afdad66290489574f597a81981ddf3484cd22bce..1d63f610335ebb692ac31e25580e962d30edc396 100644 (file)
@@ -3,20 +3,18 @@
 This file is part of DisOrder.
 Copyright (C) 2004-2008 Richard Kettlewell
 
-This program is free software; you can redistribute it and/or modify
+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
+the Free Software Foundation, either version 3 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.
+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
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
 <html>
  <head>
@@ -79,10 +77,10 @@ USA
    Portions copyright &copy; 1997-2006 <a
    href="http://www.fsf.org/">Free Software Foundation, Inc</a>.</p>
 
-   <p>This program is free software; you can redistribute it and/or modify it
-   under the terms of the <a href="http://www.gnu.org/licenses/old-licenses/gpl-2.0.html">GNU
-   General Public License</a> as published by the Free Software Foundation;
-   either version 2 of the License, or (at your option) any later version.</p>
+   <p>This program is free software: you can redistribute it and/or modify it
+   under the terms of the <a href="http://www.gnu.org/licenses/gpl-3.0.html">GNU
+   General Public License</a> as published by the Free Software Foundation,
+   either version 3 of the License, or (at your option) any later version.</p>
 
    <p>This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -90,8 +88,8 @@ USA
    General Public License for more details.</p>
 
    <p>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</p>
+   with this program.  If not, see <a
+   href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>.</p>
 
   </div>
     
index 11d0e9585ef305f467c1b830001e2eb99ccd22b3..10fc031c034fc6139abfa2899045a90af9c9fba6 100644 (file)
@@ -3,20 +3,18 @@
 This file is part of DisOrder.
 Copyright (C) 2004-2008 Richard Kettlewell
 
-This program is free software; you can redistribute it and/or modify
+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
+the Free Software Foundation, either version 3 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.
+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
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
 <html>
  <head>
index 483a3e96b36fc50cea1207b1733091eccf1a09f3..66e6f6a539ecae943880faf48375310758e94300 100644 (file)
@@ -411,18 +411,16 @@ p.credits {
 This file is part of DisOrder.
 Copyright (C) 2003-2008 Richard Kettlewell
 
-This program is free software; you can redistribute it and/or modify
+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
+the Free Software Foundation, either version 3 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.
+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
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
index 715e61d30cee0bac6ef7281cf5f6e5a6f6687a2c..4c3f7be0e834f56f8978f280001a4df2de693a79 100644 (file)
@@ -3,20 +3,18 @@
 This file is part of DisOrder.
 Copyright (C) 2005, 2007, 2008 Richard Kettlewell
 
-This program is free software; you can redistribute it and/or modify
+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
+the Free Software Foundation, either version 3 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.
+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
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
 <html>
  <head>
index ecc66f2534cea7c80f196d491f5a45cfa25571f9..00c7e873fdb008f9c6d8d6ca7078a67607c21566 100644 (file)
@@ -3,20 +3,18 @@
 This file is part of DisOrder.
 Copyright (C) 2004-2008 Richard Kettlewell
 
-This program is free software; you can redistribute it and/or modify
+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
+the Free Software Foundation, either version 3 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.
+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
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
 <html>
  <head>
index c3ef332aecd6a999247c478f39525e894d8fd26e..47bc334c5a22837bcc39c26dfa661974df98ef70 100644 (file)
@@ -3,20 +3,18 @@
 This file is part of DisOrder.
 Copyright (C) 2007, 2008 Richard Kettlewell
 
-This program is free software; you can redistribute it and/or modify
+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
+the Free Software Foundation, either version 3 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.
+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
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
 <html>
  <head>
index 33d1fb27d99caf995a5863c8239e2520c1f2e03a..320e68808f6b2ebdba4443ed347cdf4d8ae0de9b 100644 (file)
@@ -1,20 +1,18 @@
 This file is part of DisOrder.
 Copyright (C) 2008 Richard Kettlewell
 
-This program is free software; you can redistribute it and/or modify
+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
+the Free Software Foundation, either version 3 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.
+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
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
 ------------------------------------------------------------------------
index 9de5ccdb17d993a191d57458015fafb24539133a..624d421755f38b69f6b940e8a4d937ca241d06a3 100644 (file)
@@ -3,20 +3,18 @@
 This file is part of DisOrder.
 Copyright (C) 2004-2008 Richard Kettlewell
 
-This program is free software; you can redistribute it and/or modify
+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
+the Free Software Foundation, either version 3 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.
+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
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
 <html>
  <head>
index 147333cdf5f2b84919f3faeb683787f24a622ec5..b8c80bd6cb88217ead3af36655852fa04d39e00f 100644 (file)
@@ -3,20 +3,18 @@
 This file is part of DisOrder.
 Copyright (C) 2004-2008 Richard Kettlewell
 
-This program is free software; you can redistribute it and/or modify
+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
+the Free Software Foundation, either version 3 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.
+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
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
 @discard{
 
index 02d8904de392e34f118166fa05225b07bfcb4e5c..262b685038ff2421ab3eb72890100d5188d554a4 100644 (file)
@@ -3,20 +3,18 @@
 This file is part of DisOrder.
 Copyright (C) 2004-2008 Richard Kettlewell
 
-This program is free software; you can redistribute it and/or modify
+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
+the Free Software Foundation, either version 3 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.
+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
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
 <html>
  <head>
index b43d01a78f31cc11ed57645a8b7b01038304aae8..347cd16a4a966eca8199ce294e432100c1b8dbe2 100644 (file)
@@ -3,20 +3,18 @@
 This file is part of DisOrder.
 Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
 
-This program is free software; you can redistribute it and/or modify
+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
+the Free Software Foundation, either version 3 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.
+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
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
 <html>
  <head>
index 1ee9af9a8dd044407c8d9de4e5d284af6725525f..be3d73b69e84219b2ae52dfd3bfe1aafd4e33720 100644 (file)
@@ -2,20 +2,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2004, 2005, 2007, 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 noinst_PROGRAMS=disorder-udplog
@@ -36,3 +34,4 @@ clean-local:
        rm -rf testroot *.log *.pyc
 
 EXTRA_DIST=dtest.py ${TESTS}
+CLEANFILES=*.gcda *.gcov *.gcno *.c.html index.html
index 7b4bf4c2b954437cac87d63103a43daadeb07158..4bea3a61fca0bd2270a4590ac8e0e411d769bdbc 100755 (executable)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 import dtest,disorder
 
index 8a9182977286011d0d67fc1ee03295f607f889d1..da4efbfe91789cfb0ce99ac9a42826c5fe0db47d 100755 (executable)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2007 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 import dtest,disorder
 
index 218e0c9023056442f3cad13539c2859e5fb185c9..f3d429a122ab1caad97d7604d0364db81ab3c0ec 100755 (executable)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2007, 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 import dtest,time,disorder,sys,re,subprocess
 
index be454354b3e2a799c19c0262be043b715d0c2442..1c62dc548f325e0f188c97d04de7e84505292b3f 100644 (file)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2007, 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
 """Utility module used by tests"""
@@ -294,6 +292,8 @@ Stop the daemon if it has not stopped already"""
     else:
         print "  daemon already stopped"
     daemon = None
+    # Wait a bit for subprocess to finish too, to try to avoid stupid races
+    time.sleep(2)
 
 def run(module=None, report=True):
     """dtest.run(MODULE)
index ff28a0ffc32001c3187f723dbd546f22e4a1dd41..b6f3d6f2c47eb43b7237ebcd153b182a3ffaf6be 100755 (executable)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2007, 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 import dtest,time,disorder,re
 
index 984c6cca89dd839d05e26f10112aada72b96a592..1edf5636c57cd833089059d466b8f5770bc08eec 100755 (executable)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2007, 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 import dtest,time,disorder,sys
 
index c298ce514656403f6133de31f13b38e3abcc2fec..abf1b38b97495e6f48aaa13714924b6016c617fa 100755 (executable)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2007, 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 import dtest,time,disorder,re,sys
 
index dae37b47d473206d825940eb4e7c55796a6e5dbe..7503ac7adc17faf1c8fe10cff7f3c08a153dd133 100755 (executable)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2007, 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 import dtest,time,disorder,re
 
index 2878e68fe62c00f3ba0e7e8a612af56f1a04a3db..cdbd24123cab4c21d2dc425ef6f183ade937b8b5 100755 (executable)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 import dtest,disorder,sys,os,unicodedata
 
index 32532f1e0bb00133472e77e7305793a14541e69c..b0ae1faf6d81fe4bd311cfb217bc63f1338e80e5 100755 (executable)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 import dtest,disorder,time,string
 
index 5e3d2008c7deb0d8231a48810905844816e7495a..7774d880df7827bcc4ec417efc0b5563d2561ced 100755 (executable)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2007, 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 import dtest,time,disorder,sys
 
index f8839c85e1f031eb5700c66764865644596b81f2..a27252c49d8d869185a4f656e821ac3718ddc30d 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  * USA
  */
-
+/** @file tests/udplog.c
+ * @brief UDP logging utility
+ *
+ * Intended for low-level debugging.
+ */
 #include "common.h"
 
 #include <getopt.h>
index d35e4f6adf1771d17477f8f3889ae7c2ad629952..019c4c97698153f7fd0409d001d6e63c1a0c0197 100755 (executable)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2007, 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 import dtest,disorder
 
index ffc1fdca7340e329279b93075ea35d23672ec4a0..f55336eefe9aa5bcef5bd56633cdb1a674dd8529 100755 (executable)
@@ -3,20 +3,18 @@
 # This file is part of DisOrder.
 # Copyright (C) 2007, 2008 Richard Kettlewell
 #
-# This program is free software; you can redistribute it and/or modify
+# 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
+# the Free Software Foundation, either version 3 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.
-#
+# 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
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 import dtest,disorder