From dfb6248c115de3effd5b34efa8da74411fb7d80c Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 21 Nov 2006 16:13:58 +0000 Subject: [PATCH] Update copyrights git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3670 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/Makefile.in | 2 +- bacula/src/lib/Makefile.in | 8 +- bacula/src/lib/alist.c | 39 ++- bacula/src/lib/alloc.c | 73 ----- bacula/src/lib/attr.c | 39 ++- bacula/src/lib/base64.c | 39 ++- bacula/src/lib/berrno.c | 33 ++- bacula/src/lib/bget_msg.c | 33 ++- bacula/src/lib/bnet.c | 39 ++- bacula/src/lib/bnet_server.c | 43 ++- bacula/src/lib/bpipe.c | 33 ++- bacula/src/lib/bregex.c | 28 ++ bacula/src/lib/bsd_queue.h | 550 ----------------------------------- bacula/src/lib/bsnprintf.c | 28 ++ bacula/src/lib/bsys.c | 34 ++- bacula/src/lib/btime.c | 43 ++- bacula/src/lib/btimers.c | 39 ++- bacula/src/lib/btree.c | 39 ++- bacula/src/lib/cram-md5.c | 33 ++- bacula/src/lib/crc32.c | 52 ++-- bacula/src/lib/crypto.c | 41 ++- bacula/src/lib/daemon.c | 33 ++- bacula/src/lib/dlist.c | 39 ++- bacula/src/lib/edit.c | 39 ++- bacula/src/lib/events.c | 173 ----------- bacula/src/lib/hmac.c | 86 +++--- bacula/src/lib/htable.c | 39 ++- bacula/src/lib/htable.h | 2 +- bacula/src/lib/jcr.c | 39 ++- bacula/src/lib/lex.c | 40 ++- bacula/src/lib/lib.h | 1 - bacula/src/lib/md5.c | 29 ++ bacula/src/lib/mem_pool.c | 40 ++- bacula/src/lib/message.c | 40 ++- bacula/src/lib/openssl.c | 41 ++- bacula/src/lib/parse_conf.c | 39 ++- bacula/src/lib/pythonlib.c | 39 ++- bacula/src/lib/queue.c | 113 +++---- bacula/src/lib/res.c | 39 ++- bacula/src/lib/runscript.c | 39 ++- bacula/src/lib/rwlock.c | 39 ++- bacula/src/lib/scan.c | 39 ++- bacula/src/lib/semlock.c | 522 --------------------------------- bacula/src/lib/semlock.h | 69 ----- bacula/src/lib/serial.c | 39 ++- bacula/src/lib/signal.c | 33 ++- bacula/src/lib/smartall.c | 40 ++- bacula/src/lib/tls.c | 41 ++- bacula/src/lib/watchdog.c | 2 +- bacula/src/lib/workq.c | 2 +- 50 files changed, 1070 insertions(+), 1934 deletions(-) delete mode 100644 bacula/src/lib/alloc.c delete mode 100644 bacula/src/lib/bsd_queue.h delete mode 100644 bacula/src/lib/events.c delete mode 100644 bacula/src/lib/semlock.c delete mode 100644 bacula/src/lib/semlock.h diff --git a/bacula/Makefile.in b/bacula/Makefile.in index 4187ecb951..b39b5598e4 100755 --- a/bacula/Makefile.in +++ b/bacula/Makefile.in @@ -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 diff --git a/bacula/src/lib/Makefile.in b/bacula/src/lib/Makefile.in index ad6c837fe0..74fc4cef70 100644 --- a/bacula/src/lib/Makefile.in +++ b/bacula/src/lib/Makefile.in @@ -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 diff --git a/bacula/src/lib/alist.c b/bacula/src/lib/alist.c index 70a7895b23..7f6f5b8aa9 100644 --- a/bacula/src/lib/alist.c +++ b/bacula/src/lib/alist.c @@ -11,19 +11,32 @@ * */ /* - 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 index ae48a615a1..0000000000 --- a/bacula/src/lib/alloc.c +++ /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 -#include - -#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 diff --git a/bacula/src/lib/attr.c b/bacula/src/lib/attr.c index ac509288cd..ae6ca36454 100644 --- a/bacula/src/lib/attr.c +++ b/bacula/src/lib/attr.c @@ -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" diff --git a/bacula/src/lib/base64.c b/bacula/src/lib/base64.c index 4b1a505a83..55ce65392c 100644 --- a/bacula/src/lib/base64.c +++ b/bacula/src/lib/base64.c @@ -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" diff --git a/bacula/src/lib/berrno.c b/bacula/src/lib/berrno.c index 2a7109f953..4f673635bf 100644 --- a/bacula/src/lib/berrno.c +++ b/bacula/src/lib/berrno.c @@ -12,19 +12,32 @@ * */ /* - 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" diff --git a/bacula/src/lib/bget_msg.c b/bacula/src/lib/bget_msg.c index 9a5005b4fb..b33808f9dd 100644 --- a/bacula/src/lib/bget_msg.c +++ b/bacula/src/lib/bget_msg.c @@ -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 */ diff --git a/bacula/src/lib/bnet.c b/bacula/src/lib/bnet.c index 89f75df245..3c2d88be5f 100644 --- a/bacula/src/lib/bnet.c +++ b/bacula/src/lib/bnet.c @@ -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" diff --git a/bacula/src/lib/bnet_server.c b/bacula/src/lib/bnet_server.c index d0d5957a4b..d7ade4a9cd 100644 --- a/bacula/src/lib/bnet_server.c +++ b/bacula/src/lib/bnet_server.c @@ -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 #include diff --git a/bacula/src/lib/bpipe.c b/bacula/src/lib/bpipe.c index e20a3dea73..aecb3b0c51 100644 --- a/bacula/src/lib/bpipe.c +++ b/bacula/src/lib/bpipe.c @@ -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" diff --git a/bacula/src/lib/bregex.c b/bacula/src/lib/bregex.c index 5daefa04f3..aa8b80244d 100644 --- a/bacula/src/lib/bregex.c +++ b/bacula/src/lib/bregex.c @@ -31,6 +31,34 @@ * 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 index b8c1614ef6..0000000000 --- a/bacula/src/lib/bsd_queue.h +++ /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_ */ diff --git a/bacula/src/lib/bsnprintf.c b/bacula/src/lib/bsnprintf.c index 2cc90fabfd..1d1d2553c2 100644 --- a/bacula/src/lib/bsnprintf.c +++ b/bacula/src/lib/bsnprintf.c @@ -13,6 +13,34 @@ * * 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" diff --git a/bacula/src/lib/bsys.c b/bacula/src/lib/bsys.c index 9dd7c96c3a..c35dde9770 100644 --- a/bacula/src/lib/bsys.c +++ b/bacula/src/lib/bsys.c @@ -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; } - diff --git a/bacula/src/lib/btime.c b/bacula/src/lib/btime.c index 0c9facb30d..f2777ea8c6 100644 --- a/bacula/src/lib/btime.c +++ b/bacula/src/lib/btime.c @@ -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 diff --git a/bacula/src/lib/btimers.c b/bacula/src/lib/btimers.c index 143dc46369..85d1d3a2ba 100644 --- a/bacula/src/lib/btimers.c +++ b/bacula/src/lib/btimers.c @@ -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" diff --git a/bacula/src/lib/btree.c b/bacula/src/lib/btree.c index 5b822ba9cf..c17fe143a2 100644 --- a/bacula/src/lib/btree.c +++ b/bacula/src/lib/btree.c @@ -12,19 +12,32 @@ * */ /* - 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" diff --git a/bacula/src/lib/cram-md5.c b/bacula/src/lib/cram-md5.c index fd0446e161..22e999812e 100644 --- a/bacula/src/lib/cram-md5.c +++ b/bacula/src/lib/cram-md5.c @@ -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" diff --git a/bacula/src/lib/crc32.c b/bacula/src/lib/crc32.c index 8b379a727f..d571009aa0 100644 --- a/bacula/src/lib/crc32.c +++ b/bacula/src/lib/crc32.c @@ -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]); diff --git a/bacula/src/lib/crypto.c b/bacula/src/lib/crypto.c index af206985dc..f1ad9c816f 100644 --- a/bacula/src/lib/crypto.c +++ b/bacula/src/lib/crypto.c @@ -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, @@ -19,19 +17,32 @@ * license please contact Landon Fuller . */ /* - 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" diff --git a/bacula/src/lib/daemon.c b/bacula/src/lib/daemon.c index 540c5f711e..9deea049f0 100644 --- a/bacula/src/lib/daemon.c +++ b/bacula/src/lib/daemon.c @@ -13,19 +13,32 @@ * */ /* - 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" diff --git a/bacula/src/lib/dlist.c b/bacula/src/lib/dlist.c index f3d59b1ce6..5cb8be2a7f 100644 --- a/bacula/src/lib/dlist.c +++ b/bacula/src/lib/dlist.c @@ -10,19 +10,32 @@ * */ /* - 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/edit.c b/bacula/src/lib/edit.c index bc07ad74ee..81cfe9f6d5 100644 --- a/bacula/src/lib/edit.c +++ b/bacula/src/lib/edit.c @@ -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 diff --git a/bacula/src/lib/events.c b/bacula/src/lib/events.c deleted file mode 100644 index c89c413f02..0000000000 --- a/bacula/src/lib/events.c +++ /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) /* 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 0 && (buf[len-1] == '\n' || buf[len-1] == '\r')) - buf[--len] = 0; - SendDlgItemMessage(hwnd, idlist, LB_ADDSTRING, 0, (LONG)buf); - } - return; -} - -#endif /* HAVE_WIN32 */ diff --git a/bacula/src/lib/hmac.c b/bacula/src/lib/hmac.c index 7dade4c136..b68b9bf0f7 100644 --- a/bacula/src/lib/hmac.c +++ b/bacula/src/lib/hmac.c @@ -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" @@ -34,11 +42,11 @@ 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 */ diff --git a/bacula/src/lib/htable.c b/bacula/src/lib/htable.c index 6bbf800e24..ff3cde7fa0 100644 --- a/bacula/src/lib/htable.c +++ b/bacula/src/lib/htable.c @@ -23,19 +23,32 @@ * */ /* - 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" diff --git a/bacula/src/lib/htable.h b/bacula/src/lib/htable.h index 9702a6f43d..09346319ab 100644 --- a/bacula/src/lib/htable.h +++ b/bacula/src/lib/htable.h @@ -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. diff --git a/bacula/src/lib/jcr.c b/bacula/src/lib/jcr.c index 815a51a292..8f65f71f7f 100755 --- a/bacula/src/lib/jcr.c +++ b/bacula/src/lib/jcr.c @@ -23,19 +23,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 "jcr.h" diff --git a/bacula/src/lib/lex.c b/bacula/src/lib/lex.c index 2fa93a7d13..8eb6df75db 100644 --- a/bacula/src/lib/lex.c +++ b/bacula/src/lib/lex.c @@ -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" diff --git a/bacula/src/lib/lib.h b/bacula/src/lib/lib.h index 398990a406..671e066b41 100644 --- a/bacula/src/lib/lib.h +++ b/bacula/src/lib/lib.h @@ -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" diff --git a/bacula/src/lib/md5.c b/bacula/src/lib/md5.c index 4a0867c4be..d6135367f3 100644 --- a/bacula/src/lib/md5.c +++ b/bacula/src/lib/md5.c @@ -21,6 +21,35 @@ 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 diff --git a/bacula/src/lib/mem_pool.c b/bacula/src/lib/mem_pool.c index 61dc1bf52d..686c164e66 100644 --- a/bacula/src/lib/mem_pool.c +++ b/bacula/src/lib/mem_pool.c @@ -19,21 +19,33 @@ * * 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" diff --git a/bacula/src/lib/message.c b/bacula/src/lib/message.c index 0774179bc2..f786d781a7 100755 --- a/bacula/src/lib/message.c +++ b/bacula/src/lib/message.c @@ -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" diff --git a/bacula/src/lib/openssl.c b/bacula/src/lib/openssl.c index 2cf1a3fd1a..2aa83c4e35 100644 --- a/bacula/src/lib/openssl.c +++ b/bacula/src/lib/openssl.c @@ -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, @@ -19,19 +17,32 @@ * license please contact Landon Fuller . */ /* - 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" diff --git a/bacula/src/lib/parse_conf.c b/bacula/src/lib/parse_conf.c index 71b988353f..a76aacc396 100755 --- a/bacula/src/lib/parse_conf.c +++ b/bacula/src/lib/parse_conf.c @@ -33,19 +33,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" diff --git a/bacula/src/lib/pythonlib.c b/bacula/src/lib/pythonlib.c index cc432cfdc9..c2a458a5c7 100644 --- a/bacula/src/lib/pythonlib.c +++ b/bacula/src/lib/pythonlib.c @@ -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" diff --git a/bacula/src/lib/queue.c b/bacula/src/lib/queue.c index 1f3473bc76..1224fb9ad5 100644 --- a/bacula/src/lib/queue.c +++ b/bacula/src/lib/queue.c @@ -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 } diff --git a/bacula/src/lib/res.c b/bacula/src/lib/res.c index 670b61fe59..c33d514c52 100644 --- a/bacula/src/lib/res.c +++ b/bacula/src/lib/res.c @@ -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" diff --git a/bacula/src/lib/runscript.c b/bacula/src/lib/runscript.c index e19d246f26..e01c1da5e2 100644 --- a/bacula/src/lib/runscript.c +++ b/bacula/src/lib/runscript.c @@ -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" diff --git a/bacula/src/lib/rwlock.c b/bacula/src/lib/rwlock.c index fc70892cfd..c2cd3e5c69 100644 --- a/bacula/src/lib/rwlock.c +++ b/bacula/src/lib/rwlock.c @@ -13,19 +13,32 @@ * */ /* - 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" diff --git a/bacula/src/lib/scan.c b/bacula/src/lib/scan.c index 5e9403fd54..d4b4fab169 100644 --- a/bacula/src/lib/scan.c +++ b/bacula/src/lib/scan.c @@ -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 index 41273819e7..0000000000 --- a/bacula/src/lib/semlock.c +++ /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 -#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 index 64c0de9a85..0000000000 --- a/bacula/src/lib/semlock.h +++ /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 */ diff --git a/bacula/src/lib/serial.c b/bacula/src/lib/serial.c index 93855b6de7..8f5da389f5 100644 --- a/bacula/src/lib/serial.c +++ b/bacula/src/lib/serial.c @@ -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" diff --git a/bacula/src/lib/signal.c b/bacula/src/lib/signal.c index fd55deeeee..50bfcc21b9 100644 --- a/bacula/src/lib/signal.c +++ b/bacula/src/lib/signal.c @@ -13,26 +13,33 @@ * 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" diff --git a/bacula/src/lib/smartall.c b/bacula/src/lib/smartall.c index 6261fffc6c..9ecb0039f8 100644 --- a/bacula/src/lib/smartall.c +++ b/bacula/src/lib/smartall.c @@ -17,21 +17,33 @@ 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 */ diff --git a/bacula/src/lib/tls.c b/bacula/src/lib/tls.c index 0f5c3d2084..c0e64f4bec 100644 --- a/bacula/src/lib/tls.c +++ b/bacula/src/lib/tls.c @@ -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. * @@ -22,19 +20,32 @@ * Landon Fuller . */ /* - 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" diff --git a/bacula/src/lib/watchdog.c b/bacula/src/lib/watchdog.c index 8cf8176725..9420782eb0 100755 --- a/bacula/src/lib/watchdog.c +++ b/bacula/src/lib/watchdog.c @@ -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. diff --git a/bacula/src/lib/workq.c b/bacula/src/lib/workq.c index 63f438a48e..d28f9adeb0 100755 --- a/bacula/src/lib/workq.c +++ b/bacula/src/lib/workq.c @@ -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. -- 2.39.5