]> git.sur5r.net Git - bacula/bacula/commitdiff
Update copyrights
authorKern Sibbald <kern@sibbald.com>
Tue, 21 Nov 2006 16:13:58 +0000 (16:13 +0000)
committerKern Sibbald <kern@sibbald.com>
Tue, 21 Nov 2006 16:13:58 +0000 (16:13 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3670 91ce42f0-d328-0410-95d8-f526ca767f89

50 files changed:
bacula/Makefile.in
bacula/src/lib/Makefile.in
bacula/src/lib/alist.c
bacula/src/lib/alloc.c [deleted file]
bacula/src/lib/attr.c
bacula/src/lib/base64.c
bacula/src/lib/berrno.c
bacula/src/lib/bget_msg.c
bacula/src/lib/bnet.c
bacula/src/lib/bnet_server.c
bacula/src/lib/bpipe.c
bacula/src/lib/bregex.c
bacula/src/lib/bsd_queue.h [deleted file]
bacula/src/lib/bsnprintf.c
bacula/src/lib/bsys.c
bacula/src/lib/btime.c
bacula/src/lib/btimers.c
bacula/src/lib/btree.c
bacula/src/lib/cram-md5.c
bacula/src/lib/crc32.c
bacula/src/lib/crypto.c
bacula/src/lib/daemon.c
bacula/src/lib/dlist.c
bacula/src/lib/edit.c
bacula/src/lib/events.c [deleted file]
bacula/src/lib/hmac.c
bacula/src/lib/htable.c
bacula/src/lib/htable.h
bacula/src/lib/jcr.c
bacula/src/lib/lex.c
bacula/src/lib/lib.h
bacula/src/lib/md5.c
bacula/src/lib/mem_pool.c
bacula/src/lib/message.c
bacula/src/lib/openssl.c
bacula/src/lib/parse_conf.c
bacula/src/lib/pythonlib.c
bacula/src/lib/queue.c
bacula/src/lib/res.c
bacula/src/lib/runscript.c
bacula/src/lib/rwlock.c
bacula/src/lib/scan.c
bacula/src/lib/semlock.c [deleted file]
bacula/src/lib/semlock.h [deleted file]
bacula/src/lib/serial.c
bacula/src/lib/signal.c
bacula/src/lib/smartall.c
bacula/src/lib/tls.c
bacula/src/lib/watchdog.c
bacula/src/lib/workq.c

index 4187ecb951b0bb1df09622722e031a99aadf255b..b39b5598e41ac37d69d0bf3b4acb86d28865639b 100755 (executable)
@@ -195,7 +195,7 @@ clean:
        @$(RMF) *~ 1 2 3 core core.* config.guess console.log console.sum
        @$(RMF) examples/1 examples/2 examples/devices/1 examples/devices/2
        @$(RMF) -r autom4te.cache
-       @find . -name .#* -exec $(RMF) {} \;
+       @find . -name ".#*" -exec $(RMF) {} \;
 
 
 # clean for distribution
index ad6c837fe0ab72c111a8eabbc7408ce320abe6bb..74fc4cef70821c5df3883fcf03cf7e75911ed125 100644 (file)
@@ -22,7 +22,7 @@ DEBUG=@DEBUG@
 first_rule: all
 dummy:
 
-LIBSRCS = alloc.c attr.c base64.c berrno.c bsys.c bget_msg.c \
+LIBSRCS = attr.c base64.c berrno.c bsys.c bget_msg.c \
          bnet.c bnet_server.c runscript.c \
          bpipe.c bsnprintf.c btime.c \
          cram-md5.c crc32.c crypto.c daemon.c edit.c fnmatch.c \
@@ -30,12 +30,12 @@ LIBSRCS = alloc.c attr.c base64.c berrno.c bsys.c bget_msg.c \
          md5.c message.c mem_pool.c openssl.c parse_conf.c \
          queue.c bregex.c \
          res.c rwlock.c scan.c serial.c sha1.c \
-         semlock.c signal.c smartall.c tls.c tree.c \
+         signal.c smartall.c tls.c tree.c \
          util.c var.c watchdog.c workq.c btimers.c \
          address_conf.c pythonlib.c
 
 
-LIBOBJS = alloc.o attr.o base64.o berrno.o bsys.o bget_msg.o \
+LIBOBJS = attr.o base64.o berrno.o bsys.o bget_msg.o \
          bnet.o bnet_server.o runscript.o \
          bpipe.o bsnprintf.o btime.o \
          cram-md5.o crc32.o crypto.o daemon.o edit.o enh_fnmatch.o fnmatch.o \
@@ -43,7 +43,7 @@ LIBOBJS = alloc.o attr.o base64.o berrno.o bsys.o bget_msg.o \
          md5.o message.o mem_pool.o openssl.o parse_conf.o \
          queue.o bregex.o \
          res.o rwlock.o scan.o serial.o sha1.o \
-         semlock.o signal.o smartall.o tls.o tree.o \
+         signal.o smartall.o tls.o tree.o \
          util.o var.o watchdog.o workq.o btimers.o \
          address_conf.o pythonlib.o
 
index 70a7895b234870580f3861fa3664dfe891f4625e..7f6f5b8aa952903b8089253735c30c06acbfada6 100644 (file)
  *
  */
 /*
-   Copyright (C) 2003-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2003-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #include "bacula.h"
 
diff --git a/bacula/src/lib/alloc.c b/bacula/src/lib/alloc.c
deleted file mode 100644 (file)
index ae48a61..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
-
-        Error checking memory allocator
-
-     Version $Id$
-*/
-
-/*
-   Copyright (C) 2000-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
-
-#ifdef NEEDED
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifdef TESTERR
-#undef NULL
-#define NULL  buf
-#endif
-
-/*LINTLIBRARY*/
-
-#define V        (void)
-
-#ifdef SMARTALLOC
-
-extern void *sm_malloc();
-
-/*  SM_ALLOC  --  Allocate buffer and signal on error  */
-
-void *sm_alloc(char *fname, int lineno, unsigned int nbytes)
-{
-   void *buf;
-
-   if ((buf = sm_malloc(fname, lineno, nbytes)) != NULL) {
-      return buf;
-   }
-   V fprintf(stderr, "\nBoom!!!  Memory capacity exceeded.\n");
-   V fprintf(stderr, "  Requested %u bytes at line %d of %s.\n",
-      nbytes, lineno, fname);
-   abort();
-   /*NOTREACHED*/
-}
-#else
-
-/*  ALLOC  --  Allocate buffer and signal on error  */
-
-void *alloc(unsigned int nbytes)
-{
-   void *buf;
-
-   if ((buf = malloc(nbytes)) != NULL) {
-      return buf;
-   }
-   V fprintf(stderr, "\nBoom!!!  Memory capacity exceeded.\n");
-   V fprintf(stderr, "  Requested %u bytes.\n", nbytes);
-   abort();
-   /*NOTREACHED*/
-}
-#endif
-#endif
index ac509288cd641fd6c447cb882b27e45f3fbb3470..ae6ca36454adf6606879035ebcc2d7eb5faa6939 100644 (file)
@@ -6,19 +6,32 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2003-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2003-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #include "bacula.h"
 #include "jcr.h"
index 4b1a505a83f3a23d6dde150709aa86bf83960be1..55ce65392cc9dc27fc525944a6c1e7b939427d88 100644 (file)
@@ -6,19 +6,32 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 
 #include "bacula.h"
index 2a7109f953d085217ac35fa6ded1b4723b268a59..4f673635bf5aef120bb7a0ac4e227315385b04f6 100644 (file)
  *
  */
 /*
-   Copyright (C) 2004-2006 Kern Sibbald
+   Bacula® - The Network Backup Solution
 
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
+   Copyright (C) 2004-2006 Free Software Foundation Europe e.V.
 
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
 
- */
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #include "bacula.h"
 
index 9a5005b4fbe7fd876e170f26dfb7e7fb2d0abe25..b33808f9dd38fe7de4b8c458ea43cddcc738d5d9 100644 (file)
@@ -8,19 +8,32 @@
  *
  */
 /*
-   Copyright (C) 2001-2006 Kern Sibbald
+   Bacula® - The Network Backup Solution
 
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
+   Copyright (C) 2001-2006 Free Software Foundation Europe e.V.
 
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
 
- */
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #include "bacula.h"                   /* pull in global headers */
 
index 89f75df245b70cc5c4855a3f872396fcf96f2f83..3c2d88be5f0bf14bba9d80a11850272bf8e046f1 100644 (file)
@@ -9,19 +9,32 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 
 #include "bacula.h"
index d0d5957a4b6e27164a77326c5a4eb4bdced8b668..d7ade4a9cd87fadcffe9adbeb4c6c91f7b822e94 100644 (file)
@@ -1,17 +1,3 @@
-/*
-   Copyright (C) 2000-2005 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
  /*
   * Originally written by Kern Sibbald for inclusion in apcupsd,
   *  but heavily modified for Bacula
@@ -19,6 +5,35 @@
   *   Version $Id$
   */
 
+/*
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
+
+
 #include "bacula.h"
 #include <netinet/in.h>
 #include <sys/socket.h>
index e20a3dea733a0b3f6da3e8bb2101dc6d6c1239f2..aecb3b0c513505cd8b287d26eac994946adcf8d9 100644 (file)
@@ -6,19 +6,32 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2002-2006 Kern Sibbald
+   Bacula® - The Network Backup Solution
 
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
+   Copyright (C) 2002-2006 Free Software Foundation Europe e.V.
 
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
 
- */
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 
 #include "bacula.h"
index 5daefa04f322f85699659d973d0c794bb9369211..aa8b80244d66c3a4ae31031f83a1563c38e47c89 100644 (file)
  * This file modified to work with Bacula and C++ by
  *    Kern Sibbald, April 2006
  */
+/*
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2006-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
+
 
 #include "bacula.h"
 #include "bregex.h"
diff --git a/bacula/src/lib/bsd_queue.h b/bacula/src/lib/bsd_queue.h
deleted file mode 100644 (file)
index b8c1614..0000000
+++ /dev/null
@@ -1,550 +0,0 @@
-/*      $OpenBSD: queue.h,v 1.22 2001/06/23 04:39:35 angelos Exp $      */
-/*      $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $       */
-
-/*
- *      University of California, Berkeley "advertising clause" removed as per
- *      authorisation given by William Hoskins, Director, Office of Technology
- *      Licensing, University of California, Berkeley, on the 22nd day of July
- *      1999.
- */
-
-/*
- * Copyright (c) 1991, 1993
- *      The Regents of the University of California.  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. Neither the name of the University nor the names of its contributors
- *    may 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.
- *
- *      @(#)queue.h     8.5 (Berkeley) 8/20/94
- */
-
-#ifndef _LOCAL_SYS_QUEUE_H_
-#define _LOCAL_SYS_QUEUE_H_
-
-/*
- * This file defines five types of data structures: singly-linked lists,
- * lists, simple queues, tail queues, and circular queues.
- *
- *
- * A singly-linked list is headed by a single forward pointer. The elements
- * are singly linked for minimum space and pointer manipulation overhead at
- * the expense of O(n) removal for arbitrary elements. New elements can be
- * added to the list after an existing element or at the head of the list.
- * Elements being removed from the head of the list should use the explicit
- * macro for this purpose for optimum efficiency. A singly-linked list may
- * only be traversed in the forward direction.  Singly-linked lists are ideal
- * for applications with large datasets and few or no removals or for
- * implementing a LIFO queue.
- *
- * A list is headed by a single forward pointer (or an array of forward
- * pointers for a hash table header). The elements are doubly linked
- * so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before
- * or after an existing element or at the head of the list. A list
- * may only be traversed in the forward direction.
- *
- * A simple queue is headed by a pair of pointers, one the head of the
- * list and the other to the tail of the list. The elements are singly
- * linked to save space, so elements can only be removed from the
- * head of the list. New elements can be added to the list before or after
- * an existing element, at the head of the list, or at the end of the
- * list. A simple queue may only be traversed in the forward direction.
- *
- * A tail queue is headed by a pair of pointers, one to the head of the
- * list and the other to the tail of the list. The elements are doubly
- * linked so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before or
- * after an existing element, at the head of the list, or at the end of
- * the list. A tail queue may be traversed in either direction.
- *
- * A circle queue is headed by a pair of pointers, one to the head of the
- * list and the other to the tail of the list. The elements are doubly
- * linked so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before or after
- * an existing element, at the head of the list, or at the end of the list.
- * A circle queue may be traversed in either direction, but has a more
- * complex end of list detection.
- *
- * For details on the use of these macros, see the queue(3) manual page.
- */
-
-/*
- * Singly-linked List definitions.
- */
-#define SLIST_HEAD(name, type)                                          \
-struct name {                                                           \
-       struct type *slh_first; /* first element */                     \
-}
-
-#define SLIST_HEAD_INITIALIZER(head)                                    \
-       { NULL }
-
-/* Conflicts with winnt.h */
-#define bSLIST_ENTRY(type)                                               \
-struct {                                                                \
-       struct type *sle_next;  /* next element */                      \
-}
-
-/*
- * Singly-linked List access methods.
- */
-#define SLIST_FIRST(head)       ((head)->slh_first)
-#define SLIST_END(head)         NULL
-#define SLIST_EMPTY(head)       (SLIST_FIRST(head) == SLIST_END(head))
-#define SLIST_NEXT(elm, field)  ((elm)->field.sle_next)
-
-#define SLIST_FOREACH(var, head, field)                                 \
-       for((var) = SLIST_FIRST(head);                                  \
-           (var) != SLIST_END(head);                                   \
-           (var) = SLIST_NEXT(var, field))
-
-#define SLIST_FOREACH_SAFE(var, head, field, tvar)                      \
-       for((var) = SLIST_FIRST(head);                                  \
-           (var) != SLIST_END(head) &&                                 \
-           ((tvar) = SLIST_NEXT(var, field), 1);                       \
-           (var) = (tvar))
-
-/*
- * Singly-linked List functions.
- */
-#define SLIST_INIT(head) {                                              \
-       SLIST_FIRST(head) = SLIST_END(head);                            \
-}
-
-#define SLIST_INSERT_AFTER(slistelm, elm, field) do {                   \
-       (elm)->field.sle_next = (slistelm)->field.sle_next;             \
-       (slistelm)->field.sle_next = (elm);                             \
-} while (0)
-
-#define SLIST_INSERT_HEAD(head, elm, field) do {                        \
-       (elm)->field.sle_next = (head)->slh_first;                      \
-       (head)->slh_first = (elm);                                      \
-} while (0)
-
-#define SLIST_REMOVE_HEAD(head, field) do {                             \
-       (head)->slh_first = (head)->slh_first->field.sle_next;          \
-} while (0)
-
-#define SLIST_REMOVE(head, elm, type, field) do {                       \
-       if ((head)->slh_first == (elm)) {                               \
-               SLIST_REMOVE_HEAD((head), field);                       \
-       }                                                               \
-       else {                                                          \
-               struct type *curelm = (head)->slh_first;                \
-               while( curelm->field.sle_next != (elm) )                \
-                       curelm = curelm->field.sle_next;                \
-               curelm->field.sle_next =                                \
-                   curelm->field.sle_next->field.sle_next;             \
-       }                                                               \
-} while (0)
-
-/*
- * List definitions.
- */
-#define LIST_HEAD(name, type)                                           \
-struct name {                                                           \
-       struct type *lh_first;  /* first element */                     \
-}
-
-#define LIST_HEAD_INITIALIZER(head)                                     \
-       { NULL }
-
-#define LIST_ENTRY(type)                                                \
-struct {                                                                \
-       struct type *le_next;   /* next element */                      \
-       struct type **le_prev;  /* address of previous next element */  \
-}
-
-/*
- * List access methods
- */
-#define LIST_FIRST(head)                ((head)->lh_first)
-#define LIST_END(head)                  NULL
-#define LIST_EMPTY(head)                (LIST_FIRST(head) == LIST_END(head))
-#define LIST_NEXT(elm, field)           ((elm)->field.le_next)
-
-#define LIST_FOREACH(var, head, field)                                  \
-       for((var) = LIST_FIRST(head);                                   \
-           (var)!= LIST_END(head);                                     \
-           (var) = LIST_NEXT(var, field))
-
-#define LIST_FOREACH_SAFE(var, head, field, tvar)                       \
-       for((var) = LIST_FIRST(head);                                   \
-           (var)!= LIST_END(head) &&                                   \
-           ((tvar) = LIST_NEXT(var, field), 1);                        \
-           (var) = (tvar))
-
-
-/*
- * List functions.
- */
-#define LIST_INIT(head) do {                                            \
-       LIST_FIRST(head) = LIST_END(head);                              \
-} while (0)
-
-#define LIST_INSERT_AFTER(listelm, elm, field) do {                     \
-       if (((elm)->field.le_next = (listelm)->field.le_next) != NULL)  \
-               (listelm)->field.le_next->field.le_prev =               \
-                   &(elm)->field.le_next;                              \
-       (listelm)->field.le_next = (elm);                               \
-       (elm)->field.le_prev = &(listelm)->field.le_next;               \
-} while (0)
-
-#define LIST_INSERT_BEFORE(listelm, elm, field) do {                    \
-       (elm)->field.le_prev = (listelm)->field.le_prev;                \
-       (elm)->field.le_next = (listelm);                               \
-       *(listelm)->field.le_prev = (elm);                              \
-       (listelm)->field.le_prev = &(elm)->field.le_next;               \
-} while (0)
-
-#define LIST_INSERT_HEAD(head, elm, field) do {                         \
-       if (((elm)->field.le_next = (head)->lh_first) != NULL)          \
-               (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
-       (head)->lh_first = (elm);                                       \
-       (elm)->field.le_prev = &(head)->lh_first;                       \
-} while (0)
-
-#define LIST_REMOVE(elm, field) do {                                    \
-       if ((elm)->field.le_next != NULL)                               \
-               (elm)->field.le_next->field.le_prev =                   \
-                   (elm)->field.le_prev;                               \
-       *(elm)->field.le_prev = (elm)->field.le_next;                   \
-} while (0)
-
-#define LIST_REPLACE(elm, elm2, field) do {                             \
-       if (((elm2)->field.le_next = (elm)->field.le_next) != NULL)     \
-               (elm2)->field.le_next->field.le_prev =                  \
-                   &(elm2)->field.le_next;                             \
-       (elm2)->field.le_prev = (elm)->field.le_prev;                   \
-       *(elm2)->field.le_prev = (elm2);                                \
-} while (0)
-
-/*
- * Simple queue definitions.
- */
-#define SIMPLEQ_HEAD(name, type)                                        \
-struct name {                                                           \
-       struct type *sqh_first; /* first element */                     \
-       struct type **sqh_last; /* addr of last next element */         \
-}
-
-#define SIMPLEQ_HEAD_INITIALIZER(head)                                  \
-       { NULL, &(head).sqh_first }
-
-#define SIMPLEQ_ENTRY(type)                                             \
-struct {                                                                \
-       struct type *sqe_next;  /* next element */                      \
-}
-
-/*
- * Simple queue access methods.
- */
-#define SIMPLEQ_FIRST(head)         ((head)->sqh_first)
-#define SIMPLEQ_END(head)           NULL
-#define SIMPLEQ_EMPTY(head)         (SIMPLEQ_FIRST(head) == SIMPLEQ_END(head))
-#define SIMPLEQ_NEXT(elm, field)    ((elm)->field.sqe_next)
-
-#define SIMPLEQ_FOREACH(var, head, field)                               \
-       for((var) = SIMPLEQ_FIRST(head);                                \
-           (var) != SIMPLEQ_END(head);                                 \
-           (var) = SIMPLEQ_NEXT(var, field))
-
-#define SIMPLEQ_FOREACH_SAFE(var, head, field, tvar)                    \
-       for((var) = SIMPLEQ_FIRST(head);                                \
-           (var) != SIMPLEQ_END(head) &&                               \
-           ((tvar) = SIMPLEQ_NEXT(var, field), 1);                     \
-           (var) = (tvar))
-
-/*
- * Simple queue functions.
- */
-#define SIMPLEQ_INIT(head) do {                                         \
-       (head)->sqh_first = NULL;                                       \
-       (head)->sqh_last = &(head)->sqh_first;                          \
-} while (0)
-
-#define SIMPLEQ_INSERT_HEAD(head, elm, field) do {                      \
-       if (((elm)->field.sqe_next = (head)->sqh_first) == NULL)        \
-               (head)->sqh_last = &(elm)->field.sqe_next;              \
-       (head)->sqh_first = (elm);                                      \
-} while (0)
-
-#define SIMPLEQ_INSERT_TAIL(head, elm, field) do {                      \
-       (elm)->field.sqe_next = NULL;                                   \
-       *(head)->sqh_last = (elm);                                      \
-       (head)->sqh_last = &(elm)->field.sqe_next;                      \
-} while (0)
-
-#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do {            \
-       if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
-               (head)->sqh_last = &(elm)->field.sqe_next;              \
-       (listelm)->field.sqe_next = (elm);                              \
-} while (0)
-
-#define SIMPLEQ_REMOVE_HEAD(head, elm, field) do {                      \
-       if (((head)->sqh_first = (elm)->field.sqe_next) == NULL)        \
-               (head)->sqh_last = &(head)->sqh_first;                  \
-} while (0)
-
-/*
- * Tail queue definitions.
- */
-#define TAILQ_HEAD(name, type)                                          \
-struct name {                                                           \
-       struct type *tqh_first; /* first element */                     \
-       struct type **tqh_last; /* addr of last next element */         \
-}
-
-#define TAILQ_HEAD_INITIALIZER(head)                                    \
-       { NULL, &(head).tqh_first }
-
-#define TAILQ_ENTRY(type)                                               \
-struct {                                                                \
-       struct type *tqe_next;  /* next element */                      \
-       struct type **tqe_prev; /* address of previous next element */  \
-}
-
-/*
- * tail queue access methods
- */
-#define TAILQ_FIRST(head)               ((head)->tqh_first)
-#define TAILQ_END(head)                 NULL
-#define TAILQ_NEXT(elm, field)          ((elm)->field.tqe_next)
-#define TAILQ_LAST(head, headname)                                      \
-       (*(((struct headname *)((head)->tqh_last))->tqh_last))
-/* XXX */
-#define TAILQ_PREV(elm, headname, field)                                \
-       (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
-#define TAILQ_EMPTY(head)                                               \
-       (TAILQ_FIRST(head) == TAILQ_END(head))
-
-#define TAILQ_FOREACH(var, head, field)                                 \
-       for((var) = TAILQ_FIRST(head);                                  \
-           (var) != TAILQ_END(head);                                   \
-           (var) = TAILQ_NEXT(var, field))
-
-#define TAILQ_FOREACH_SAFE(var, head, field, tvar)                      \
-       for((var) = TAILQ_FIRST(head);                                  \
-           (var) != TAILQ_END(head) &&                                 \
-           ((tvar) = TAILQ_NEXT(var, field), 1);                       \
-           (var) = (tvar))
-
-#define TAILQ_FOREACH_REVERSE(var, head, field, headname)               \
-       for((var) = TAILQ_LAST(head, headname);                         \
-           (var) != TAILQ_END(head);                                   \
-           (var) = TAILQ_PREV(var, headname, field))
-
-#define TAILQ_FOREACH_REVERSE_SAFE(var, head, field, headname, tvar)    \
-       for((var) = TAILQ_LAST(head, headname);                         \
-           (var) != TAILQ_END(head) &&                                 \
-           ((tvar) = TAILQ_PREV(var, headname, field), 1);             \
-           (var) = (tvar))
-
-/*
- * Tail queue functions.
- */
-#define TAILQ_INIT(head) do {                                           \
-       (head)->tqh_first = NULL;                                       \
-       (head)->tqh_last = &(head)->tqh_first;                          \
-} while (0)
-
-#define TAILQ_INSERT_HEAD(head, elm, field) do {                        \
-       if (((elm)->field.tqe_next = (head)->tqh_first) != NULL)        \
-               (head)->tqh_first->field.tqe_prev =                     \
-                   &(elm)->field.tqe_next;                             \
-       else                                                            \
-               (head)->tqh_last = &(elm)->field.tqe_next;              \
-       (head)->tqh_first = (elm);                                      \
-       (elm)->field.tqe_prev = &(head)->tqh_first;                     \
-} while (0)
-
-#define TAILQ_INSERT_TAIL(head, elm, field) do {                        \
-       (elm)->field.tqe_next = NULL;                                   \
-       (elm)->field.tqe_prev = (head)->tqh_last;                       \
-       *(head)->tqh_last = (elm);                                      \
-       (head)->tqh_last = &(elm)->field.tqe_next;                      \
-} while (0)
-
-#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do {              \
-       if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
-               (elm)->field.tqe_next->field.tqe_prev =                 \
-                   &(elm)->field.tqe_next;                             \
-       else                                                            \
-               (head)->tqh_last = &(elm)->field.tqe_next;              \
-       (listelm)->field.tqe_next = (elm);                              \
-       (elm)->field.tqe_prev = &(listelm)->field.tqe_next;             \
-} while (0)
-
-#define TAILQ_INSERT_BEFORE(listelm, elm, field) do {                   \
-       (elm)->field.tqe_prev = (listelm)->field.tqe_prev;              \
-       (elm)->field.tqe_next = (listelm);                              \
-       *(listelm)->field.tqe_prev = (elm);                             \
-       (listelm)->field.tqe_prev = &(elm)->field.tqe_next;             \
-} while (0)
-
-#define TAILQ_REMOVE(head, elm, field) do {                             \
-       if (((elm)->field.tqe_next) != NULL)                            \
-               (elm)->field.tqe_next->field.tqe_prev =                 \
-                   (elm)->field.tqe_prev;                              \
-       else                                                            \
-               (head)->tqh_last = (elm)->field.tqe_prev;               \
-       *(elm)->field.tqe_prev = (elm)->field.tqe_next;                 \
-} while (0)
-
-#define TAILQ_REPLACE(head, elm, elm2, field) do {                      \
-       if (((elm2)->field.tqe_next = (elm)->field.tqe_next) != NULL)   \
-               (elm2)->field.tqe_next->field.tqe_prev =                \
-                   &(elm2)->field.tqe_next;                            \
-       else                                                            \
-               (head)->tqh_last = &(elm2)->field.tqe_next;             \
-       (elm2)->field.tqe_prev = (elm)->field.tqe_prev;                 \
-       *(elm2)->field.tqe_prev = (elm2);                               \
-} while (0)
-
-/*
- * Circular queue definitions.
- */
-#define CIRCLEQ_HEAD(name, type)                                        \
-struct name {                                                           \
-       struct type *cqh_first;         /* first element */             \
-       struct type *cqh_last;          /* last element */              \
-}
-
-#define CIRCLEQ_HEAD_INITIALIZER(head)                                  \
-       { CIRCLEQ_END(&head), CIRCLEQ_END(&head) }
-
-#define CIRCLEQ_ENTRY(type)                                             \
-struct {                                                                \
-       struct type *cqe_next;          /* next element */              \
-       struct type *cqe_prev;          /* previous element */          \
-}
-
-/*
- * Circular queue access methods
- */
-#define CIRCLEQ_FIRST(head)             ((head)->cqh_first)
-#define CIRCLEQ_LAST(head)              ((head)->cqh_last)
-#define CIRCLEQ_END(head)               ((void *)(head))
-#define CIRCLEQ_NEXT(elm, field)        ((elm)->field.cqe_next)
-#define CIRCLEQ_PREV(elm, field)        ((elm)->field.cqe_prev)
-#define CIRCLEQ_EMPTY(head)                                             \
-       (CIRCLEQ_FIRST(head) == CIRCLEQ_END(head))
-
-#define CIRCLEQ_FOREACH(var, head, field)                               \
-       for((var) = CIRCLEQ_FIRST(head);                                \
-           (var) != CIRCLEQ_END(head);                                 \
-           (var) = CIRCLEQ_NEXT(var, field))
-
-#define CIRCLEQ_FOREACH_SAFE(var, head, field, tvar)                    \
-       for((var) = CIRCLEQ_FIRST(head);                                \
-           (var) != CIRCLEQ_END(head) &&                               \
-           ((tvar) = CIRCLEQ_NEXT(var, field), 1);                     \
-           (var) = (tvar))
-
-#define CIRCLEQ_FOREACH_REVERSE(var, head, field)                       \
-       for((var) = CIRCLEQ_LAST(head);                                 \
-           (var) != CIRCLEQ_END(head);                                 \
-           (var) = CIRCLEQ_PREV(var, field))
-
-#define CIRCLEQ_FOREACH_REVERSE_SAFE(var, head, field, tvar)            \
-       for((var) = CIRCLEQ_LAST(head);                                 \
-           (var) != CIRCLEQ_END(head) &&                               \
-           ((tvar) = CIRCLEQ_PREV(var, field), 1);                     \
-           (var) = (tvar))
-
-/*
- * Circular queue functions.
- */
-#define CIRCLEQ_INIT(head) do {                                         \
-       (head)->cqh_first = CIRCLEQ_END(head);                          \
-       (head)->cqh_last = CIRCLEQ_END(head);                           \
-} while (0)
-
-#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do {            \
-       (elm)->field.cqe_next = (listelm)->field.cqe_next;              \
-       (elm)->field.cqe_prev = (listelm);                              \
-       if ((listelm)->field.cqe_next == CIRCLEQ_END(head))             \
-               (head)->cqh_last = (elm);                               \
-       else                                                            \
-               (listelm)->field.cqe_next->field.cqe_prev = (elm);      \
-       (listelm)->field.cqe_next = (elm);                              \
-} while (0)
-
-#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do {           \
-       (elm)->field.cqe_next = (listelm);                              \
-       (elm)->field.cqe_prev = (listelm)->field.cqe_prev;              \
-       if ((listelm)->field.cqe_prev == CIRCLEQ_END(head))             \
-               (head)->cqh_first = (elm);                              \
-       else                                                            \
-               (listelm)->field.cqe_prev->field.cqe_next = (elm);      \
-       (listelm)->field.cqe_prev = (elm);                              \
-} while (0)
-
-#define CIRCLEQ_INSERT_HEAD(head, elm, field) do {                      \
-       (elm)->field.cqe_next = (head)->cqh_first;                      \
-       (elm)->field.cqe_prev = CIRCLEQ_END(head);                      \
-       if ((head)->cqh_last == CIRCLEQ_END(head))                      \
-               (head)->cqh_last = (elm);                               \
-       else                                                            \
-               (head)->cqh_first->field.cqe_prev = (elm);              \
-       (head)->cqh_first = (elm);                                      \
-} while (0)
-
-#define CIRCLEQ_INSERT_TAIL(head, elm, field) do {                      \
-       (elm)->field.cqe_next = CIRCLEQ_END(head);                      \
-       (elm)->field.cqe_prev = (head)->cqh_last;                       \
-       if ((head)->cqh_first == CIRCLEQ_END(head))                     \
-               (head)->cqh_first = (elm);                              \
-       else                                                            \
-               (head)->cqh_last->field.cqe_next = (elm);               \
-       (head)->cqh_last = (elm);                                       \
-} while (0)
-
-#define CIRCLEQ_REMOVE(head, elm, field) do {                           \
-       if ((elm)->field.cqe_next == CIRCLEQ_END(head))                 \
-               (head)->cqh_last = (elm)->field.cqe_prev;               \
-       else                                                            \
-               (elm)->field.cqe_next->field.cqe_prev =                 \
-                   (elm)->field.cqe_prev;                              \
-       if ((elm)->field.cqe_prev == CIRCLEQ_END(head))                 \
-               (head)->cqh_first = (elm)->field.cqe_next;              \
-       else                                                            \
-               (elm)->field.cqe_prev->field.cqe_next =                 \
-                   (elm)->field.cqe_next;                              \
-} while (0)
-
-#define CIRCLEQ_REPLACE(head, elm, elm2, field) do {                    \
-       if (((elm2)->field.cqe_next = (elm)->field.cqe_next) ==         \
-           CIRCLEQ_END(head))                                          \
-               (head).cqh_last = (elm2);                               \
-       else                                                            \
-               (elm2)->field.cqe_next->field.cqe_prev = (elm2);        \
-       if (((elm2)->field.cqe_prev = (elm)->field.cqe_prev) ==         \
-           CIRCLEQ_END(head))                                          \
-               (head).cqh_first = (elm2);                              \
-       else                                                            \
-               (elm2)->field.cqe_prev->field.cqe_next = (elm2);        \
-} while (0)
-
-#endif  /* !_LOCAL_SYS_QUEUE_H_ */
index 2cc90fabfd4e56e8c533e951dc20810cddea2c65..1d1d2553c2352291380f79d58fd4ba4397e04d38 100644 (file)
  *
  *   Version $Id$
  */
+/*
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2005-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
+
 
 
 #include "bacula.h"
index 9dd7c96c3a8bf5460c5a6e14f75f6c3f65728487..c35dde977061e5309dcd36e1e6cd5c0520597b86 100644 (file)
@@ -8,19 +8,32 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2006 Kern Sibbald
+   Bacula® - The Network Backup Solution
 
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
 
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
 
- */
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 
 #include "bacula.h"
@@ -764,4 +777,3 @@ char *escape_filename(const char *file_path)
    return escaped_path;
 }
 
-
index 0c9facb30d25041581e723365a501dcc7f490b0b..f2777ea8c61b05515c922f9dc3014fdec8bc37e7 100644 (file)
@@ -1,22 +1,37 @@
 /*
- * Bacula time and date routines -- John Walker
+ * Bacula floating point time and date routines -- John Walker
+ *
+ * Later double precision integer time/date routines -- Kern Sibbald
  *
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 
 /* Concerning times. There are a number of differnt time standards
index 143dc46369629edea778aff8eb7d7ae7c18850c4..85d1d3a2bada79270569babc039b358f9b896a86 100644 (file)
@@ -5,19 +5,32 @@
  *
 */
 /*
-   Copyright (C) 2004-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2004-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #include "bacula.h"
 #include "jcr.h"
index 5b822ba9cfbb7373fc3871a940f2ffccc1a4485c..c17fe143a2f623830e49438e89e0ef0f30e34b5c 100644 (file)
  *
  */
 /*
-   Copyright (C) 2005 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2005-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #include "bacula.h"
 #include "btree.h"
index fd0446e161506630e0080f58cbe335e8332c95e5..22e999812e42236c5c037301892ef92144f37a60 100644 (file)
@@ -8,19 +8,32 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2006 Kern Sibbald
+   Bacula® - The Network Backup Solution
 
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
+   Copyright (C) 2001-2006 Free Software Foundation Europe e.V.
 
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
 
- */
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #include "bacula.h"
 
index 8b379a727fc356a4707d12e453cbb1f34749620c..d571009aa08d803c98d3a9cf6d88b7d17834f0df 100644 (file)
@@ -7,24 +7,32 @@
  *
  */
 /*
-   Copyright (C) 2001-2004 Kern Sibbald and John Walker
+   Bacula® - The Network Backup Solution
 
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
 
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
 
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-   MA 02111-1307, USA.
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
 
- */
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #ifdef GENERATE_STATIC_CRC_TABLE
 /*
@@ -45,17 +53,17 @@ main()
    for (i = 0; i < 256; i++) {
       crc = (unsigned long)i;
       for (j = 0; j < 8; j++) {
-        if (crc & 1) {
-           crc = 0xedb88320L ^ (crc >> 1);
-        } else {
-           crc = crc >> 1;
-        }
+         if (crc & 1) {
+            crc = 0xedb88320L ^ (crc >> 1);
+         } else {
+            crc = crc >> 1;
+         }
       }
       buf[k++] = crc;
       if (k == 5) {
-        k = 0;
-        printf("  0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x,\n",
-           buf[0], buf[1], buf[2], buf[3], buf[4]);
+         k = 0;
+         printf("  0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x,\n",
+            buf[0], buf[1], buf[2], buf[3], buf[4]);
       }
    }
    printf("  0x%08x\n", buf[0]);
index af206985dc53493558904b4c873cc89ae105fda8..f1ad9c816f549feef47d85c890bac20645430663 100644 (file)
@@ -5,8 +5,6 @@
  *
  * Version $Id$
  *
- * Copyright (C) 2005 Kern Sibbald
- *
  * This file was contributed to the Bacula project by Landon Fuller.
  *
  * Landon Fuller has been granted a perpetual, worldwide, non-exclusive,
  * license please contact Landon Fuller <landonf@opendarwin.org>.
  */
 /*
-   Copyright (C) 2005-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2005-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 
 #include "bacula.h"
index 540c5f711e9cb99fbb4b8d64bd522598ea786e54..9deea049f0181d883ad80a2258d6f78bfba8d047 100644 (file)
  *
  */
 /*
-   Copyright (C) 2000-2005 Kern Sibbald
+   Bacula® - The Network Backup Solution
 
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
 
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
 
- */
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 
 #include "bacula.h"
index f3d59b1ce613fd1c17edeb530f7d6978ac8b0692..5cb8be2a7f98d40560c8d5c3c4f13c2e4641aa04 100644 (file)
  *
  */
 /*
-   Copyright (C) 2003-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2003-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #include "bacula.h"
 
index bc07ad74ee1e84da320df3692910aaa9e78f3f3e..81cfe9f6d58c94f1d7da5985cdedfd1761c1749e 100644 (file)
@@ -6,19 +6,32 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2002-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2002-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #include "bacula.h"
 #include <math.h>
diff --git a/bacula/src/lib/events.c b/bacula/src/lib/events.c
deleted file mode 100644 (file)
index c89c413..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- *  Bacula Event File handling
- *
- *    Kern Sibbald, August MMI
- *
- *   Version $Id$
- *
- */
-/*
-   Copyright (C) 2001-2004 Kern Sibbald and John Walker
-
-   This program is free software; you can redistribute it and/or
-   modify 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.
-
- */
-
-#include "bacula.h"
-
-#ifdef IMPLEMENTED
-void log_event(UPSINFO *ups, int level, char *fmt, ...)
-{
-    va_list  arg_ptr;
-    char msg[2*MAXSTRING];
-    char datetime[MAX_TIME_LENGTH];
-    int event_fd = ups->event_fd;
-
-    event_fd = ups->event_fd;
-
-    /*****FIXME***** use pool memory */
-    va_start(arg_ptr, fmt);
-    vsprintf(msg, fmt, arg_ptr);
-    va_end(arg_ptr);
-
-    syslog(level, "%s", msg);         /* log the event */
-
-    /* Write out to our temp file. LOG_INFO is DATA logging, so
-       do not write it to our temp events file. */
-    if (event_fd >= 0 && level != LOG_INFO) {
-       int lm;
-       time_t nowtime;
-       struct tm tm;
-
-       time(&nowtime);
-       localtime_r(&nowtime, &tm);
-       strftime(datetime, sizeof(datetime), "%a %b %d %X %Z %Y  ", &tm);
-       write(event_fd, datetime, strlen(datetime));
-       lm = strlen(msg);
-       if (msg[lm-1] != '\n')
-          msg[lm++] = '\n';
-       write(event_fd, msg, lm);
-    }
-}
-
-
-#define NLE   10                     /* number of events to send and keep */
-#define MAXLE 50                     /* truncate file when this many events */
-
-/*
- * If the EVENTS file exceeds MAXLE records, truncate it.
- *
- * Returns:
- *
- *  0 if file not truncated
- *  1 if file truncated
- */
-int truncate_events_file(UPSINFO *ups)
-{
-    char *le[NLE], *buf;
-    int i, j;
-    int nrec = 0;
-    int tlen = 0;
-    int trunc = FALSE;
-    FILE *events_file;
-    int stat = 0;
-
-    if ((events_file = fopen(ups->eventfile, "r+")) == NULL)
-       return 0;
-    for (i=0; i<NLE; i++)
-       le[i] = NULL;
-    for (i=0; i<NLE; i++)
-       if ((le[i] = malloc(MAXSTRING)) == NULL)
-           goto bailout;
-    i = 0;
-    while (fgets(le[i], MAXSTRING, events_file) != NULL) {
-       nrec++;
-       i++;
-       if (i >= NLE)                  /* wrap */
-           i = 0;
-    }
-    if (nrec > MAXLE)
-       trunc = TRUE;                  /* file too large, truncate it */
-    if (nrec > NLE) {
-       nrec = NLE;                    /* number of records to output */
-       i -= (i/NLE)*NLE;              /* first record to output */
-    } else
-       i = 0;
-    /* get total length to output */
-    for (j=0; j < nrec; j++)
-       tlen += strlen(le[j]);
-    if ((buf = malloc(tlen+1)) == NULL)
-       goto bailout;
-    *buf = 0;
-    /* Put records in single buffer in correct order */
-    for (j=0; j < nrec; j++) {
-       strcat(buf, le[i++]);
-       if (i >= NLE)
-           i = 0;
-    }
-    if (trunc) {
-       ftruncate(fileno(events_file), 0L);
-       rewind(events_file);
-       fwrite(buf, tlen, 1, events_file); /* write last NLE records to file */
-       stat = 1;                          /* we truncated it */
-    }
-
-    free(buf);
-
-bailout:
-
-   fclose(events_file);
-   for (i=0; i<NLE; i++)
-       if (le[i] != NULL)
-          free(le[i]);
-   return stat;
-}
-
-#endif /* IMPLEMENTED */
-
-#if defined(HAVE_WIN32)
-
-extern UPSINFO myUPS;
-extern int shm_OK;
-
-/*
- * Fill the Events list box with the last events
- *
- */
-void FillEventsBox(HWND hwnd, int idlist)
-{
-    char buf[1000];
-    int len;
-    FILE *events_file;
-
-    if (!shm_OK || myUPS.eventfile[0] == 0 ||
-       (events_file = fopen(myUPS.eventfile, "r")) == NULL) {
-       SendDlgItemMessage(hwnd, idlist, LB_ADDSTRING, 0,
-          (LONG)_("Events not available"));
-       return;
-    }
-
-    while (fgets(buf, sizeof(buf), events_file) != NULL) {
-       len = strlen(buf);
-       /* strip trailing cr/lfs */
-       while (len > 0 && (buf[len-1] == '\n' || buf[len-1] == '\r'))
-           buf[--len] = 0;
-       SendDlgItemMessage(hwnd, idlist, LB_ADDSTRING, 0, (LONG)buf);
-    }
-    return;
-}
-
-#endif /* HAVE_WIN32 */
index 7dade4c1367feeecefad52c8ce4769eadc913cca..b68b9bf0f7244b41d0a9fdc8ec2d4c0bd4401fe9 100644 (file)
@@ -8,24 +8,32 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Bacula® - The Network Backup Solution
 
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
+   Copyright (C) 2001-2006 Free Software Foundation Europe e.V.
 
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU Lesser General 
+   Public License as published by the Free Software Foundation plus 
+   additions that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Lesser General Public
-   License along with this library; 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, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
 
- */
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #include "bacula.h"
 
 
 void
 hmac_md5(
-    uint8_t*  text,           /* pointer to data stream */
-    int   text_len,           /* length of data stream */
-    uint8_t*  key,            /* pointer to authentication key */
-    int   key_len,            /* length of authentication key */
-    uint8_t  *hmac)           /* returned hmac-md5 */
+    uint8_t*  text,            /* pointer to data stream */
+    int   text_len,            /* length of data stream */
+    uint8_t*  key,             /* pointer to authentication key */
+    int   key_len,             /* length of authentication key */
+    uint8_t  *hmac)            /* returned hmac-md5 */
 {
    MD5Context md5c;
    uint8_t k_ipad[PAD_LEN];    /* inner padding - key XORd with ipad */
@@ -82,39 +90,39 @@ hmac_md5(
    }
 
    /* perform inner MD5 */
-   MD5Init(&md5c);                   /* start inner hash */
+   MD5Init(&md5c);                    /* start inner hash */
    MD5Update(&md5c, k_ipad, PAD_LEN); /* hash inner pad */
    MD5Update(&md5c, text, text_len);  /* hash text */
-   MD5Final(hmac, &md5c);            /* store inner hash */
+   MD5Final(hmac, &md5c);             /* store inner hash */
 
    /* perform outer MD5 */
-   MD5Init(&md5c);                   /* start outer hash */
+   MD5Init(&md5c);                    /* start outer hash */
    MD5Update(&md5c, k_opad, PAD_LEN); /* hash outer pad */
    MD5Update(&md5c, hmac, SIG_LEN);   /* hash inner hash */
-   MD5Final(hmac, &md5c);            /* store results */
+   MD5Final(hmac, &md5c);             /* store results */
 }
 /*
 Test Vectors (Trailing '\0' of a character string not included in test):
 
-  key =        0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
-  key_len =    16 bytes
+  key =         0x0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b
+  key_len =     16 bytes
   data =        "Hi There"
-  data_len =   8  bytes
-  digest =     0x9294727a3638bb1c13f48ef8158bfc9d
+  data_len =    8  bytes
+  digest =      0x9294727a3638bb1c13f48ef8158bfc9d
 
   key =         "Jefe"
   data =        "what do ya want for nothing?"
-  data_len =   28 bytes
-  digest =     0x750c783e6ab0b503eaa86e310a5db738
-
-  key =        0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
-
-  key_len      16 bytes
-  data =       0xDDDDDDDDDDDDDDDDDDDD...
-               ..DDDDDDDDDDDDDDDDDDDD...
-               ..DDDDDDDDDDDDDDDDDDDD...
-               ..DDDDDDDDDDDDDDDDDDDD...
-               ..DDDDDDDDDDDDDDDDDDDD
-  data_len =   50 bytes
-  digest =     0x56be34521d144c88dbb8c733f0e8b3f6
+  data_len =    28 bytes
+  digest =      0x750c783e6ab0b503eaa86e310a5db738
+
+  key =         0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+
+  key_len       16 bytes
+  data =        0xDDDDDDDDDDDDDDDDDDDD...
+                ..DDDDDDDDDDDDDDDDDDDD...
+                ..DDDDDDDDDDDDDDDDDDDD...
+                ..DDDDDDDDDDDDDDDDDDDD...
+                ..DDDDDDDDDDDDDDDDDDDD
+  data_len =    50 bytes
+  digest =      0x56be34521d144c88dbb8c733f0e8b3f6
 */
index 6bbf800e24d1955c90157b75bf863aba81ba3a35..ff3cde7fa0fd805eb9e24dff85c93c46e7352563 100644 (file)
  *
  */
 /*
-   Copyright (C) 2003-2005 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2003-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #include "bacula.h"
 
index 9702a6f43d59f5c61c0a2d603b6bb4a85b351e09..09346319ab54068c1006b00399601e5a9ca53f24 100644 (file)
@@ -7,7 +7,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2003-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2004-2006 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
index 815a51a292bb52360b240f1d6e77d727ea551c86..8f65f71f7f403c6cf4428087f75486a6d76b10ac 100755 (executable)
  *
  */
 /*
-   Copyright (C) 2000-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #include "bacula.h"
 #include "jcr.h"
index 2fa93a7d13e5ea0fd4413d4b960f124c30265be7..8eb6df75dbbe3543eb221a2b932122b041a1ffa1 100644 (file)
@@ -7,20 +7,32 @@
  *
  */
 /*
-   Copyright (C) 2000-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
-
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #include "bacula.h"
 #include "lex.h"
index 398990a406fdf3c039bd1e5e5663136954966109..671e066b419b5517905fb2dafa33c7c8acb65a33 100644 (file)
@@ -44,7 +44,6 @@
 #include "crypto.h"
 #include "mem_pool.h"
 #include "rwlock.h"
-#include "semlock.h"
 #include "queue.h"
 #include "serial.h"
 #include "message.h"
index 4a0867c4be060a55d49f3a83f3bb2edb91770b10..d6135367f35def852e87a781d55eb61601f15d18 100644 (file)
    prototypes) to maintain the tradition that Netfone will compile
    with Sun's original "cc". */
 
+/*
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
+
+
 #include "bacula.h"
 
 #ifndef HAVE_BIGENDIAN
index 61dc1bf52d3404c1e1c06ac4fe6590b81204f702..686c164e66de160c9e32d1dcc1e148c7d2822f38 100644 (file)
  *
  *   Version $Id$
  */
-
 /*
-   Copyright (C) 2000-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #include "bacula.h"
 
index 0774179bc2d73be321dd4ef72c1ef88f06099603..f786d781a79624abeb5fe1bf8320c095d4c3eb01 100755 (executable)
@@ -7,20 +7,32 @@
  *
  */
 /*
-   Copyright (C) 2000-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
-
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 
 #include "bacula.h"
index 2cf1a3fd1aad45a348a01c7e1ea96494ef2331a7..2aa83c4e35088f551c0288bcd8cfd08059bffea6 100644 (file)
@@ -5,8 +5,6 @@
  *
  * Version $Id$
  *
- * Copyright (C) 2005 Kern Sibbald
- *
  * This file was contributed to the Bacula project by Landon Fuller.
  *
  * Landon Fuller has been granted a perpetual, worldwide, non-exclusive,
  * license please contact Landon Fuller <landonf@opendarwin.org>.
  */
 /*
-   Copyright (C) 2005-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2005-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 
 #include "bacula.h"
index 71b988353ffa5a2c4cd5a135debe1029e105de65..a76aacc39603207c06981cfb27a74bed5f3483aa 100755 (executable)
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 
 #include "bacula.h"
index cc432cfdc9d8198affb2de6a1d82bdcdc5da6da4..c2a458a5c7b6854b58cf7ef64d5835f6628c3cf2 100644 (file)
@@ -8,19 +8,32 @@
  *
  */
 /*
-   Copyright (C) 2004-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2004-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #include "bacula.h"
 #include "jcr.h"
index 1f3473bc76406d17e33a949a42ecdcc75b6dd760..1224fb9ad5b00230a97a3da9b8ea2aa9bfd0fc7a 100644 (file)
@@ -1,36 +1,43 @@
 /*
 
-                        Q U E U E
-                    Queue Handling Routines
+                         Q U E U E
+                     Queue Handling Routines
 
-       Taken from smartall written by John Walker.
+        Taken from smartall written by John Walker.
 
-                 http://www.fourmilab.ch/smartall/
+                  http://www.fourmilab.ch/smartall/
 
 
-       Version $Id$
+        Version $Id$
 
 */
-
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
 
-   This program is free software; you can redistribute it and/or
-   modify 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.
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
 
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.
 
-   You should have received a copy of the GNU General Public
-   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, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
 
- */
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 
 #include "bacula.h"
@@ -39,8 +46,8 @@
 
 #ifdef REALLY_NEEDED
 struct b_queue {
-       struct b_queue *qnext,       /* Next item in queue */
-                    *qprev;       /* Previous item in queue */
+        struct b_queue *qnext,       /* Next item in queue */
+                     *qprev;       /* Previous item in queue */
 };
 #endif
 
@@ -55,56 +62,56 @@ struct b_queue {
  *   rest of the structure may be anything.
  *
  *   NOTE!!!! The casting here is REALLY painful, but this avoids
- *           doing ugly casting every where else in the code.
+ *            doing ugly casting every where else in the code.
  */
 
 
 /*  Queue manipulation functions.  */
 
 
-/*  QINSERT  --  Insert object at end of queue */
+/*  QINSERT  --  Insert object at end of queue  */
 
 void qinsert(BQUEUE *qhead, BQUEUE *object)
 {
 #define qh ((BQUEUE *)qhead)
 #define obj ((BQUEUE *)object)
 
-       ASSERT(qh->qprev->qnext == qh);
-       ASSERT(qh->qnext->qprev == qh);
+        ASSERT(qh->qprev->qnext == qh);
+        ASSERT(qh->qnext->qprev == qh);
 
-       obj->qnext = qh;
-       obj->qprev = qh->qprev;
-       qh->qprev = obj;
-       obj->qprev->qnext = obj;
+        obj->qnext = qh;
+        obj->qprev = qh->qprev;
+        qh->qprev = obj;
+        obj->qprev->qnext = obj;
 #undef qh
 #undef obj
 }
 
 
 /*  QREMOVE  --  Remove next object from the queue given
-                the queue head (or any item).
+                 the queue head (or any item).
      Returns NULL if queue is empty  */
 
 BQUEUE *qremove(BQUEUE *qhead)
 {
 #define qh ((BQUEUE *)qhead)
-       BQUEUE *object;
+        BQUEUE *object;
 
-       ASSERT(qh->qprev->qnext == qh);
-       ASSERT(qh->qnext->qprev == qh);
+        ASSERT(qh->qprev->qnext == qh);
+        ASSERT(qh->qnext->qprev == qh);
 
-       if ((object = qh->qnext) == qh)
-          return NULL;
-       qh->qnext = object->qnext;
-       object->qnext->qprev = qh;
-       return object;
+        if ((object = qh->qnext) == qh)
+           return NULL;
+        qh->qnext = object->qnext;
+        object->qnext->qprev = qh;
+        return object;
 #undef qh
 }
 
-/*  QNEXT   --  Return next item from the queue
- *              returns NULL at the end of the queue.
- *              If qitem is NULL, the first item from
- *              the queue is returned.
+/*  QNEXT   --   Return next item from the queue
+ *               returns NULL at the end of the queue.
+ *               If qitem is NULL, the first item from
+ *               the queue is returned.
  */
 
 BQUEUE *qnext(BQUEUE *qhead, BQUEUE *qitem)
@@ -112,31 +119,31 @@ BQUEUE *qnext(BQUEUE *qhead, BQUEUE *qitem)
 #define qh ((BQUEUE *)qhead)
 #define qi ((BQUEUE *)qitem)
 
-       BQUEUE *object;
+        BQUEUE *object;
 
-       if (qi == NULL)
-          qitem = qhead;
-       ASSERT(qi->qprev->qnext == qi);
-       ASSERT(qi->qnext->qprev == qi);
+        if (qi == NULL)
+           qitem = qhead;
+        ASSERT(qi->qprev->qnext == qi);
+        ASSERT(qi->qnext->qprev == qi);
 
-       if ((object = qi->qnext) == qh)
-          return NULL;
-       return object;
+        if ((object = qi->qnext) == qh)
+           return NULL;
+        return object;
 #undef qh
 #undef qi
 }
 
 
 /*  QDCHAIN  --  Dequeue an item from the middle of a queue.  Passed
-                the queue item, returns the (now dechained) queue item. */
+                 the queue item, returns the (now dechained) queue item. */
 
 BQUEUE *qdchain(BQUEUE *qitem)
 {
 #define qi ((BQUEUE *)qitem)
 
-       ASSERT(qi->qprev->qnext == qi);
-       ASSERT(qi->qnext->qprev == qi);
+        ASSERT(qi->qprev->qnext == qi);
+        ASSERT(qi->qnext->qprev == qi);
 
-       return qremove(qi->qprev);
+        return qremove(qi->qprev);
 #undef qi
 }
index 670b61fe59466592e5b1accf263f7f1b0567d9c7..c33d514c52ca77ceb992d7978e78046ab6c1a612 100644 (file)
@@ -7,19 +7,32 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #include "bacula.h"
 
index e19d246f267400ee902172aba0d62ae14d8381f3..e01c1da5e246ba91bd2ffed5bdbbb85352b68c6d 100644 (file)
@@ -7,19 +7,32 @@
  *
  */
 /*
-   Copyright (C) 2000-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2006-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 
 #include "bacula.h"
index fc70892cfd516ab164b0c8232ae3182e2f6f21f3..c2cd3e5c69085090402974891ea3093322a33b6b 100644 (file)
  *
  */
 /*
-   Copyright (C) 2001-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2001-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #include "bacula.h"
 
index 5e9403fd54a5f59889bd99b52d8c319f8e6cb2d8..d4b4fab1694b1f54e05c48bf05b14799f22a1a0f 100644 (file)
@@ -6,19 +6,32 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2005 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 
 #include "bacula.h"
diff --git a/bacula/src/lib/semlock.c b/bacula/src/lib/semlock.c
deleted file mode 100644 (file)
index 4127381..0000000
+++ /dev/null
@@ -1,522 +0,0 @@
-/*
- * Bacula Semaphore code. This code permits setting up
- *  a semaphore that lets through a specified number
- *  of callers simultaneously. Once the number of callers
- *  exceed the limit, they block.
- *
- *  Kern Sibbald, March MMIII
- *
- *   Derived from rwlock.h which was in turn derived from code in
- *     "Programming with POSIX Threads" By David R. Butenhof
- &
- *   Version $Id$
- *
- */
-/*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
-
-   This program is free software; you can redistribute it and/or
-   modify 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.
-
- */
-
-#include "bacula.h"
-
-/*
- * Initialize a semaphore
- *
- *  Returns: 0 on success
- *          errno on failure
- */
-int sem_init(semlock_t *sem, int max_active)
-{
-   int stat;
-
-   sem->active = sem->waiting = 0;
-   sem->max_active = max_active;
-   if ((stat = pthread_mutex_init(&sem->mutex, NULL)) != 0) {
-      return stat;
-   }
-   if ((stat = pthread_cond_init(&sem->wait, NULL)) != 0) {
-      pthread_mutex_destroy(&sem->mutex);
-      return stat;
-   }
-   sem->valid = SEMLOCK_VALID;
-   return 0;
-}
-
-/*
- * Destroy a semaphore
- *
- * Returns: 0 on success
- *         errno on failure
- */
-int sem_destroy(semlock_t *sem)
-{
-   int stat, stat1;
-
-  if (sem->valid != SEMLOCK_VALID) {
-     return EINVAL;
-  }
-  if ((stat = pthread_mutex_lock(&sem->mutex)) != 0) {
-     return stat;
-  }
-
-  /*
-   * If any threads are active, report EBUSY
-   */
-  if (sem->active > 0) {
-     pthread_mutex_unlock(&sem->mutex);
-     return EBUSY;
-  }
-
-  /*
-   * If any threads are waiting, report EBUSY
-   */
-  if (sem->waiting > 0) {
-     pthread_mutex_unlock(&sem->mutex);
-     return EBUSY;
-  }
-
-  sem->valid = 0;
-  if ((stat = pthread_mutex_unlock(&sem->mutex)) != 0) {
-     return stat;
-  }
-  stat = pthread_mutex_destroy(&sem->mutex);
-  stat1 = pthread_cond_destroy(&sem->wait);
-  return (stat != 0 ? stat : stat1);
-}
-
-/*
- * Handle cleanup when the wait lock condition variable
- *    wait is released.
- */
-static void sem_release(void *arg)
-{
-   semlock_t *sem = (semlock_t *)arg;
-
-   sem->waiting--;
-   pthread_mutex_unlock(&sem->mutex);
-}
-
-
-/*
- * Lock semaphore, wait until locked (or error).
- */
-int sem_lock(semlock_t *sem)
-{
-   int stat;
-
-   if (sem->valid != SEMLOCK_VALID) {
-      return EINVAL;
-   }
-   if ((stat = pthread_mutex_lock(&sem->mutex)) != 0) {
-      return stat;
-   }
-   if (sem->active >= sem->max_active) {
-      sem->waiting++;                /* indicate that we are waiting */
-      pthread_cleanup_push(sem_release, (void *)sem);
-      while (sem->active >= sem->max_active) {
-        if ((stat = pthread_cond_wait(&sem->wait, &sem->mutex)) != 0) {
-           break;                    /* error, bail out */
-        }
-      }
-      pthread_cleanup_pop(0);
-      sem->waiting--;                /* we are no longer waiting */
-   }
-   if (stat == 0) {
-      sem->active++;                 /* we are running */
-   }
-   pthread_mutex_unlock(&sem->mutex);
-   return stat;
-}
-
-/*
- * Attempt to lock semaphore, don't wait
- */
-int sem_trylock(semlock_t *sem)
-{
-   int stat, stat1;
-
-   if (sem->valid != SEMLOCK_VALID) {
-      return EINVAL;
-   }
-   if ((stat = pthread_mutex_lock(&sem->mutex)) != 0) {
-      return stat;
-   }
-
-   if (sem->active >= sem->max_active) {
-      stat = EBUSY;
-   } else {
-      sem->active++;                /* we are running */
-   }
-   stat1 = pthread_mutex_unlock(&sem->mutex);
-   return (stat == 0 ? stat1 : stat);
-}
-
-/*
- * Unlock semaphore
- *  Start any waiting callers
- */
-int sem_unlock(semlock_t *sem)
-{
-   int stat, stat1;
-
-   if (sem->valid != SEMLOCK_VALID) {
-      return EINVAL;
-   }
-   if ((stat = pthread_mutex_lock(&sem->mutex)) != 0) {
-      return stat;
-   }
-   sem->active--;
-   if (sem->active < 0) {
-      Emsg0(M_ABORT, 0, _("sem_unlock by non-owner.\n"));
-   }
-   if (sem->active >= sem->max_active) {
-      stat = 0;                      /* caller(s) still active */
-   } else {
-      /* No more active, awaken someone */
-      if (sem->waiting > 0) {        /* if someone waiting */
-        stat = pthread_cond_broadcast(&sem->wait);
-      }
-   }
-   stat1 = pthread_mutex_unlock(&sem->mutex);
-   return (stat == 0 ? stat1 : stat);
-}
-
-#ifdef TEST_SEMLOCK
-
-#define THREADS     5
-#define DATASIZE   15
-#define ITERATIONS 10000
-
-/*
- * Keep statics for each thread.
- */
-typedef struct thread_tag {
-   int thread_num;
-   pthread_t thread_id;
-   int writes;
-   int reads;
-   int interval;
-} thread_t;
-
-/*
- * Semaphore lock and shared data.
- */
-typedef struct data_tag {
-   semlock_t lock;
-   int data;
-   int writes;
-} data_t;
-
-thread_t threads[THREADS];
-data_t data[DATASIZE];
-
-/*
- * Thread start routine that uses semaphores locks.
- */
-void *thread_routine(void *arg)
-{
-   thread_t *self = (thread_t *)arg;
-   int repeats = 0;
-   int iteration;
-   int element = 0;
-   int status;
-
-   for (iteration=0; iteration < ITERATIONS; iteration++) {
-      /*
-       * Each "self->interval" iterations, perform an
-       * update operation (write lock instead of read
-       * lock).
-       */
-      if ((iteration % self->interval) == 0) {
-        status = sem_writelock(&data[element].lock);
-        if (status != 0) {
-           Emsg1(M_ABORT, 0, _("Write lock failed. ERR=%s\n"), strerror(status));
-        }
-        data[element].data = self->thread_num;
-        data[element].writes++;
-        self->writes++;
-        status = sem_writeunlock(&data[element].lock);
-        if (status != 0) {
-           Emsg1(M_ABORT, 0, _("Write unlock failed. ERR=%s\n"), strerror(status));
-        }
-      } else {
-        /*
-         * Look at the current data element to see whether
-         * the current thread last updated it. Count the
-         * times to report later.
-         */
-         status = sem_readlock(&data[element].lock);
-         if (status != 0) {
-            Emsg1(M_ABORT, 0, _("Read lock failed. ERR=%s\n"), strerror(status));
-         }
-         self->reads++;
-         if (data[element].data == self->thread_num)
-            repeats++;
-         status = sem_readunlock(&data[element].lock);
-         if (status != 0) {
-            Emsg1(M_ABORT, 0, _("Read unlock failed. ERR=%s\n"), strerror(status));
-         }
-      }
-      element++;
-      if (element >= DATASIZE) {
-        element = 0;
-      }
-   }
-   if (repeats > 0) {
-      Pmsg2(000, _("Thread %d found unchanged elements %d times\n"),
-        self->thread_num, repeats);
-   }
-   return NULL;
-}
-
-int main (int argc, char *argv[])
-{
-    int count;
-    int data_count;
-    int status;
-    unsigned int seed = 1;
-    int thread_writes = 0;
-    int data_writes = 0;
-
-#ifdef sun
-    /*
-     * On Solaris 2.5, threads are not timesliced. To ensure
-     * that our threads can run concurrently, we need to
-     * increase the concurrency level to THREADS.
-     */
-    thr_setconcurrency (THREADS);
-#endif
-
-    /*
-     * Initialize the shared data.
-     */
-    for (data_count = 0; data_count < DATASIZE; data_count++) {
-       data[data_count].data = 0;
-       data[data_count].writes = 0;
-       status = sem_init (&data[data_count].lock);
-       if (status != 0) {
-          Emsg1(M_ABORT, 0, _("Init rwlock failed. ERR=%s\n"), strerror(status));
-       }
-    }
-
-    /*
-     * Create THREADS threads to access shared data.
-     */
-    for (count = 0; count < THREADS; count++) {
-       threads[count].thread_num = count + 1;
-       threads[count].writes = 0;
-       threads[count].reads = 0;
-       threads[count].interval = rand_r (&seed) % 71;
-       status = pthread_create(&threads[count].thread_id,
-           NULL, thread_routine, (void*)&threads[count]);
-       if (status != 0) {
-          Emsg1(M_ABORT, 0, _("Create thread failed. ERR=%s\n"), strerror(status));
-       }
-    }
-
-    /*
-     * Wait for all threads to complete, and collect
-     * statistics.
-     */
-    for (count = 0; count < THREADS; count++) {
-       status = pthread_join (threads[count].thread_id, NULL);
-       if (status != 0) {
-          Emsg1(M_ABORT, 0, _("Join thread failed. ERR=%s\n"), strerror(status));
-       }
-       thread_writes += threads[count].writes;
-       printf (_("%02d: interval %d, writes %d, reads %d\n"),
-           count, threads[count].interval,
-           threads[count].writes, threads[count].reads);
-    }
-
-    /*
-     * Collect statistics for the data.
-     */
-    for (data_count = 0; data_count < DATASIZE; data_count++) {
-       data_writes += data[data_count].writes;
-       printf (_("data %02d: value %d, %d writes\n"),
-           data_count, data[data_count].data, data[data_count].writes);
-       sem_destroy (&data[data_count].lock);
-    }
-
-    printf (_("Total: %d thread writes, %d data writes\n"),
-       thread_writes, data_writes);
-    return 0;
-}
-
-#endif
-
-#ifdef TEST_SEM_TRY_LOCK
-/*
- * semlock_try_main.c
- *
- * Demonstrate use of non-blocking read-write locks.
- *
- * Special notes: On a Solaris system, call thr_setconcurrency()
- * to allow interleaved thread execution, since threads are not
- * timesliced.
- */
-#include <pthread.h>
-#include "semlock.h"
-#include "errors.h"
-
-#define THREADS        5
-#define ITERATIONS     1000
-#define DATASIZE       15
-
-/*
- * Keep statistics for each thread.
- */
-typedef struct thread_tag {
-    int        thread_num;
-    pthread_t  thread_id;
-    int        r_collisions;
-    int        w_collisions;
-    int        updates;
-    int        interval;
-} thread_t;
-
-/*
- * Read-write lock and shared data
- */
-typedef struct data_tag {
-    semlock_t   lock;
-    int        data;
-    int        updates;
-} data_t;
-
-thread_t threads[THREADS];
-data_t data[DATASIZE];
-
-/*
- * Thread start routine that uses read-write locks
- */
-void *thread_routine (void *arg)
-{
-    thread_t *self = (thread_t*)arg;
-    int iteration;
-    int element;
-    int status;
-
-    element = 0;                       /* Current data element */
-
-    for (iteration = 0; iteration < ITERATIONS; iteration++) {
-       if ((iteration % self->interval) == 0) {
-           status = sem_writetrylock (&data[element].lock);
-           if (status == EBUSY)
-               self->w_collisions++;
-           else if (status == 0) {
-               data[element].data++;
-               data[element].updates++;
-               self->updates++;
-               sem_writeunlock (&data[element].lock);
-           } else
-               err_abort (status, _("Try write lock"));
-       } else {
-           status = sem_readtrylock (&data[element].lock);
-           if (status == EBUSY)
-               self->r_collisions++;
-           else if (status != 0) {
-               err_abort (status, _("Try read lock"));
-           } else {
-               if (data[element].data != data[element].updates)
-                   printf ("%d: data[%d] %d != %d\n",
-                       self->thread_num, element,
-                       data[element].data, data[element].updates);
-               sem_readunlock (&data[element].lock);
-           }
-       }
-
-       element++;
-       if (element >= DATASIZE)
-           element = 0;
-    }
-    return NULL;
-}
-
-int main (int argc, char *argv[])
-{
-    int count, data_count;
-    unsigned int seed = 1;
-    int thread_updates = 0, data_updates = 0;
-    int status;
-
-#ifdef sun
-    /*
-     * On Solaris 2.5, threads are not timesliced. To ensure
-     * that our threads can run concurrently, we need to
-     * increase the concurrency level to THREADS.
-     */
-    DPRINTF (("Setting concurrency level to %d\n", THREADS));
-    thr_setconcurrency (THREADS);
-#endif
-
-    /*
-     * Initialize the shared data.
-     */
-    for (data_count = 0; data_count < DATASIZE; data_count++) {
-       data[data_count].data = 0;
-       data[data_count].updates = 0;
-       sem_init (&data[data_count].lock);
-    }
-
-    /*
-     * Create THREADS threads to access shared data.
-     */
-    for (count = 0; count < THREADS; count++) {
-       threads[count].thread_num = count;
-       threads[count].r_collisions = 0;
-       threads[count].w_collisions = 0;
-       threads[count].updates = 0;
-       threads[count].interval = rand_r (&seed) % ITERATIONS;
-       status = pthread_create (&threads[count].thread_id,
-           NULL, thread_routine, (void*)&threads[count]);
-       if (status != 0)
-           err_abort (status, _("Create thread"));
-    }
-
-    /*
-     * Wait for all threads to complete, and collect
-     * statistics.
-     */
-    for (count = 0; count < THREADS; count++) {
-       status = pthread_join(threads[count].thread_id, NULL);
-       if (status != 0)
-           err_abort(status, _("Join thread"));
-       thread_updates += threads[count].updates;
-       printf (_("%02d: interval %d, updates %d, "
-               "r_collisions %d, w_collisions %d\n"),
-           count, threads[count].interval,
-           threads[count].updates,
-           threads[count].r_collisions, threads[count].w_collisions);
-    }
-
-    /*
-     * Collect statistics for the data.
-     */
-    for (data_count = 0; data_count < DATASIZE; data_count++) {
-       data_updates += data[data_count].updates;
-       printf (_("data %02d: value %d, %d updates\n"),
-           data_count, data[data_count].data, data[data_count].updates);
-       sem_destroy(&data[data_count].lock);
-    }
-
-    return 0;
-}
-
-#endif
diff --git a/bacula/src/lib/semlock.h b/bacula/src/lib/semlock.h
deleted file mode 100644 (file)
index 64c0de9..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Bacula Semaphore code. This code permits setting up
- *  a semaphore that lets through a specified number
- *  of callers simultaneously. Once the number of callers
- *  exceed the limit, they block.
- *
- *  Kern Sibbald, March MMIII
- *
- *   Derived from rwlock.h which was in turn derived from code in
- *     "Programming with POSIX Threads" By David R. Butenhof
- *
- *   Version $Id$
- */
-/*
-   Bacula® - The Network Backup Solution
-
-   Copyright (C) 2003-2006 Free Software Foundation Europe e.V.
-
-   The main author of Bacula is Kern Sibbald, with contributions from
-   many others, a complete list can be found in the file AUTHORS.
-   This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version two of the GNU General Public
-   License as published by the Free Software Foundation plus additions
-   that are listed in the file LICENSE.
-
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-   02110-1301, USA.
-
-   Bacula® is a registered trademark o John Walker.
-   The licensor of Bacula is the Free Software Foundation Europe
-   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
-   Switzerland, email:ftf@fsfeurope.org.
-*/
-
-#ifndef __SEMLOCK_H
-#define __SEMLOCK_H 1
-
-typedef struct s_semlock_tag {
-   pthread_mutex_t   mutex;           /* main lock */
-   pthread_cond_t    wait;            /* wait for available slot */
-   int               valid;           /* set when valid */
-   int               waiting;         /* number of callers waiting */
-   int               max_active;      /* maximum active callers */
-   int               active;          /* number of active callers */
-} semlock_t;
-
-#define SEMLOCK_VALID  0xfacade
-
-#define SEM_INIIALIZER \
-   {PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, \
-    PTHREAD_COND_INITIALIZER, SEMLOCK_VALID, 0, 0, 0, 0}
-
-/*
- * semaphore lock prototypes
- */
-extern int sem_init(semlock_t *sem, int max_active);
-extern int sem_destroy(semlock_t *sem);
-extern int sem_lock(semlock_t *sem);
-extern int sem_trylock(semlock_t *sem);
-extern int sem_unlock(semlock_t *sem);
-
-#endif /* __SEMLOCK_H */
index 93855b6de753d01177bc95ca6b51c7b185a25ff9..8f5da389f5ab00f52fe2438bb55ca64c586eee4c 100644 (file)
@@ -7,19 +7,32 @@
      Version $Id$
 */
 /*
-   Copyright (C) 2000-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 
 #include "bacula.h"
index fd55deeeee967288b9166bd59b80e127307c3812..50bfcc21b93439d95075e1e682827d13dfa420c1 100644 (file)
  * tweek their signals after calling this routine.
  *
  */
-
 /*
-   Copyright (C) 2000-2004 Kern Sibbald and John Walker
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
 
-   This program is free software; you can redistribute it and/or
-   modify 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.
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
 
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.
 
-   You should have received a copy of the GNU General Public
-   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, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
 
- */
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #ifndef HAVE_WIN32
 #include "bacula.h"
index 6261fffc6c121563508ea293a0ba20ed8e765829..9ecb0039f83c74346e4904fd163482f449e8b229 100644 (file)
          Version $Id$
 
 */
-
 /*
-   Copyright (C) 2000-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 #include "bacula.h"
 /* Use the real routines here */
index 0f5c3d2084ad38109a153c86bc94fb2b76fc564d..c0e64f4bec276aaa3afe50ed607d842b82bcd506 100644 (file)
@@ -5,8 +5,6 @@
  *
  * Version $Id$
  *
- * Copyright (C) 2005 Kern Sibbald
- *
  * This file was contributed to the Bacula project by Landon Fuller
  * and Three Rings Design, Inc.
  *
  * Landon Fuller <landonf@threerings.net>.
  */
 /*
-   Copyright (C) 2005-2006 Kern Sibbald
-
-   This program is free software; you can redistribute it and/or
-   modify it under the terms of the GNU General Public License
-   version 2 as amended with additional clauses defined in the
-   file LICENSE in the main source directory.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
-   the file LICENSE for additional details.
-
- */
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2005-2006 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
 
 
 #include "bacula.h"
index 8cf81767250959200c2f4ed8e2c3c9f3187eb7f5..9420782eb0a010af6778fa65199f9c3fe864380c 100755 (executable)
@@ -9,7 +9,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2002-2006 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
index 63f438a48ecfbbbd7f3ab56dd79dfd10b02ce590..d28f9adeb0557fc956fea60986487e8f5519eda7 100755 (executable)
@@ -30,7 +30,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+   Copyright (C) 2001-2006 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.