aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libsbutil')
-rw-r--r--libsbutil/get_sandbox_debug_log.c24
-rw-r--r--libsbutil/get_sandbox_lib.c21
-rw-r--r--libsbutil/get_sandbox_log.c24
-rw-r--r--libsbutil/get_sandbox_rc.c22
-rw-r--r--libsbutil/get_tmp_dir.c24
-rw-r--r--libsbutil/include/rcscripts/core/services.h18
-rw-r--r--libsbutil/include/rcscripts/rccore.h18
-rw-r--r--libsbutil/include/rcscripts/rcdefines.h.in18
-rw-r--r--libsbutil/include/rcscripts/rctypes.h18
-rw-r--r--libsbutil/include/rcscripts/rcutil.h17
-rw-r--r--libsbutil/include/rcscripts/util/config.h18
-rw-r--r--libsbutil/include/rcscripts/util/debug.h18
-rw-r--r--libsbutil/include/rcscripts/util/dynbuf.h19
-rw-r--r--libsbutil/include/rcscripts/util/file.h18
-rw-r--r--libsbutil/include/rcscripts/util/list.h78
-rw-r--r--libsbutil/include/rcscripts/util/simple-regex.h18
-rw-r--r--libsbutil/include/rcscripts/util/str_list.h18
-rw-r--r--libsbutil/include/rcscripts/util/string.h18
-rw-r--r--libsbutil/is_env_off.c23
-rw-r--r--libsbutil/is_env_on.c23
-rw-r--r--libsbutil/sb_close.c21
-rw-r--r--libsbutil/sb_open.c23
-rw-r--r--libsbutil/sb_read.c21
-rw-r--r--libsbutil/sb_write.c23
-rw-r--r--libsbutil/sbutil.h20
-rw-r--r--libsbutil/src/config.c19
-rw-r--r--libsbutil/src/debug.c19
-rw-r--r--libsbutil/src/dynbuf.c19
-rw-r--r--libsbutil/src/file.c23
-rw-r--r--libsbutil/src/simple-regex.c21
-rw-r--r--libsbutil/src/string.c19
31 files changed, 107 insertions, 576 deletions
diff --git a/libsbutil/get_sandbox_debug_log.c b/libsbutil/get_sandbox_debug_log.c
index 6a9bac2..2f7442a 100644
--- a/libsbutil/get_sandbox_debug_log.c
+++ b/libsbutil/get_sandbox_debug_log.c
@@ -3,30 +3,13 @@
*
* Util functions.
*
- * Copyright 1999-2006 Gentoo Foundation
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Copyright 1999-2008 Gentoo Foundation
+ * Licensed under the GPL-2
*
* Some parts might have Copyright:
- *
* Copyright (C) 2002 Brad House <brad@mainstreetsoftworks.com>
- *
- * $Header$
*/
-
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@@ -43,7 +26,7 @@ void get_sandbox_debug_log(char *path)
save_errno();
sandbox_debug_log_env = getenv(ENV_SANDBOX_DEBUG_LOG);
-
+
/* THIS CHUNK BREAK THINGS BY DOING THIS:
* SANDBOX_DEBUG_LOG=/tmp/sandbox-app-admin/superadduser-1.0.7-11063.log
*/
@@ -59,4 +42,3 @@ void get_sandbox_debug_log(char *path)
restore_errno();
}
-
diff --git a/libsbutil/get_sandbox_lib.c b/libsbutil/get_sandbox_lib.c
index 8e9b391..375282c 100644
--- a/libsbutil/get_sandbox_lib.c
+++ b/libsbutil/get_sandbox_lib.c
@@ -3,30 +3,13 @@
*
* Util functions.
*
- * Copyright 1999-2006 Gentoo Foundation
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Copyright 1999-2008 Gentoo Foundation
+ * Licensed under the GPL-2
*
* Some parts might have Copyright:
- *
* Copyright (C) 2002 Brad House <brad@mainstreetsoftworks.com>
- *
- * $Header$
*/
-
#include <errno.h>
#include <stdio.h>
diff --git a/libsbutil/get_sandbox_log.c b/libsbutil/get_sandbox_log.c
index 74f4400..77f1208 100644
--- a/libsbutil/get_sandbox_log.c
+++ b/libsbutil/get_sandbox_log.c
@@ -3,30 +3,13 @@
*
* Util functions.
*
- * Copyright 1999-2006 Gentoo Foundation
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Copyright 1999-2008 Gentoo Foundation
+ * Licensed under the GPL-2
*
* Some parts might have Copyright:
- *
* Copyright (C) 2002 Brad House <brad@mainstreetsoftworks.com>
- *
- * $Header$
*/
-
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@@ -43,7 +26,7 @@ void get_sandbox_log(char *path)
save_errno();
sandbox_log_env = getenv(ENV_SANDBOX_LOG);
-
+
/* THIS CHUNK BREAK THINGS BY DOING THIS:
* SANDBOX_LOG=/tmp/sandbox-app-admin/superadduser-1.0.7-11063.log
*/
@@ -59,4 +42,3 @@ void get_sandbox_log(char *path)
restore_errno();
}
-
diff --git a/libsbutil/get_sandbox_rc.c b/libsbutil/get_sandbox_rc.c
index 9771850..cdbdb73 100644
--- a/libsbutil/get_sandbox_rc.c
+++ b/libsbutil/get_sandbox_rc.c
@@ -3,30 +3,13 @@
*
* Util functions.
*
- * Copyright 1999-2006 Gentoo Foundation
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Copyright 1999-2008 Gentoo Foundation
+ * Licensed under the GPL-2
*
* Some parts might have Copyright:
- *
* Copyright (C) 2002 Brad House <brad@mainstreetsoftworks.com>
- *
- * $Header$
*/
-
#include <errno.h>
#include <stdio.h>
@@ -38,4 +21,3 @@ void get_sandbox_rc(char *path)
snprintf(path, SB_PATH_MAX, "%s/%s", SANDBOX_BASHRC_PATH, BASHRC_NAME);
restore_errno();
}
-
diff --git a/libsbutil/get_tmp_dir.c b/libsbutil/get_tmp_dir.c
index d804d96..75ee40f 100644
--- a/libsbutil/get_tmp_dir.c
+++ b/libsbutil/get_tmp_dir.c
@@ -3,30 +3,13 @@
*
* Util functions.
*
- * Copyright 1999-2006 Gentoo Foundation
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Copyright 1999-2008 Gentoo Foundation
+ * Licensed under the GPL-2
*
* Some parts might have Copyright:
- *
* Copyright (C) 2002 Brad House <brad@mainstreetsoftworks.com>
- *
- * $Header$
*/
-
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
@@ -46,7 +29,6 @@ int get_tmp_dir(char *path)
/* Reset errno in case realpath set it */
restore_errno();
-
+
return 0;
}
-
diff --git a/libsbutil/include/rcscripts/core/services.h b/libsbutil/include/rcscripts/core/services.h
index 4245bab..38b67bc 100644
--- a/libsbutil/include/rcscripts/core/services.h
+++ b/libsbutil/include/rcscripts/core/services.h
@@ -3,23 +3,9 @@
*
* Functions dealing with services.
*
+ * Copyright 1999-2008 Gentoo Foundation
* Copyright 2004-2007 Martin Schlemmer <azarah@nosferatu.za.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Licensed under the GPL-2
*/
#ifndef __RC_SERVICES_H__
diff --git a/libsbutil/include/rcscripts/rccore.h b/libsbutil/include/rcscripts/rccore.h
index 9b6a3ef..aa7a54e 100644
--- a/libsbutil/include/rcscripts/rccore.h
+++ b/libsbutil/include/rcscripts/rccore.h
@@ -3,23 +3,9 @@
*
* Core includes.
*
+ * Copyright 1999-2008 Gentoo Foundation
* Copyright 2004-2007 Martin Schlemmer <azarah@nosferatu.za.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Licensed under the GPL-2
*/
#ifndef __RCCORE_H__
diff --git a/libsbutil/include/rcscripts/rcdefines.h.in b/libsbutil/include/rcscripts/rcdefines.h.in
index 9815873..7c604db 100644
--- a/libsbutil/include/rcscripts/rcdefines.h.in
+++ b/libsbutil/include/rcscripts/rcdefines.h.in
@@ -3,23 +3,9 @@
*
* Core defines.
*
+ * Copyright 1999-2008 Gentoo Foundation
* Copyright 2004-2007 Martin Schlemmer <azarah@nosferatu.za.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Licensed under the GPL-2
*/
#ifndef __RCDEFINES_H__
diff --git a/libsbutil/include/rcscripts/rctypes.h b/libsbutil/include/rcscripts/rctypes.h
index 4ce2118..26400b5 100644
--- a/libsbutil/include/rcscripts/rctypes.h
+++ b/libsbutil/include/rcscripts/rctypes.h
@@ -3,23 +3,9 @@
*
* Misc types and macro's.
*
+ * Copyright 1999-2008 Gentoo Foundation
* Copyright 2004-2007 Martin Schlemmer <azarah@nosferatu.za.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Licensed under the GPL-2
*/
#ifndef __RCTYPES_H__
diff --git a/libsbutil/include/rcscripts/rcutil.h b/libsbutil/include/rcscripts/rcutil.h
index 58fbe97..516d41e 100644
--- a/libsbutil/include/rcscripts/rcutil.h
+++ b/libsbutil/include/rcscripts/rcutil.h
@@ -3,23 +3,8 @@
*
* Util defines.
*
+ * Copyright 1999-2008 Gentoo Foundation
* Copyright 2004-2007 Martin Schlemmer <azarah@nosferatu.za.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
*/
#ifndef __RCUTIL_H__
diff --git a/libsbutil/include/rcscripts/util/config.h b/libsbutil/include/rcscripts/util/config.h
index b45ac47..ad392f4 100644
--- a/libsbutil/include/rcscripts/util/config.h
+++ b/libsbutil/include/rcscripts/util/config.h
@@ -3,23 +3,9 @@
*
* Miscellaneous config related macro's and functions.
*
+ * Copyright 1999-2008 Gentoo Foundation
* Copyright 2004-2007 Martin Schlemmer <azarah@nosferatu.za.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Licensed under the GPL-2
*/
#ifndef __RC_CONFIG_H__
diff --git a/libsbutil/include/rcscripts/util/debug.h b/libsbutil/include/rcscripts/util/debug.h
index 522ee25..b177c4f 100644
--- a/libsbutil/include/rcscripts/util/debug.h
+++ b/libsbutil/include/rcscripts/util/debug.h
@@ -3,23 +3,9 @@
*
* Simle debugging/logging macro's and functions.
*
+ * Copyright 1999-2008 Gentoo Foundation
* Copyright 2004-2007 Martin Schlemmer <azarah@nosferatu.za.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Licensed under the GPL-2
*/
#ifndef __RC_DEBUG_H__
diff --git a/libsbutil/include/rcscripts/util/dynbuf.h b/libsbutil/include/rcscripts/util/dynbuf.h
index 1349014..359c3b4 100644
--- a/libsbutil/include/rcscripts/util/dynbuf.h
+++ b/libsbutil/include/rcscripts/util/dynbuf.h
@@ -3,23 +3,9 @@
*
* Dynamic allocated buffers.
*
+ * Copyright 1999-2008 Gentoo Foundation
* Copyright 2004-2007 Martin Schlemmer <azarah@nosferatu.za.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Licensed under the GPL-2
*/
#ifndef __RC_DYNBUF_H__
@@ -64,4 +50,3 @@ inline bool __rc_check_arg_dynbuf (rc_dynbuf_t *dynbuf, const char *file,
__rc_check_arg_dynbuf (_dynbuf, __FILE__, __func__, __LINE__)
#endif /* __RC_DYNBUF_H__ */
-
diff --git a/libsbutil/include/rcscripts/util/file.h b/libsbutil/include/rcscripts/util/file.h
index 7ace060..519ee18 100644
--- a/libsbutil/include/rcscripts/util/file.h
+++ b/libsbutil/include/rcscripts/util/file.h
@@ -3,23 +3,9 @@
*
* Miscellaneous file related macro's and functions.
*
+ * Copyright 1999-2008 Gentoo Foundation
* Copyright 2004-2007 Martin Schlemmer <azarah@nosferatu.za.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Licensed under the GPL-2
*/
#ifndef __RC_FILE_H__
diff --git a/libsbutil/include/rcscripts/util/list.h b/libsbutil/include/rcscripts/util/list.h
index e4c7a74..a1d988b 100644
--- a/libsbutil/include/rcscripts/util/list.h
+++ b/libsbutil/include/rcscripts/util/list.h
@@ -1,11 +1,9 @@
-/*
+/*
* Copied from the Linux kernel source tree, version 2.6.0-test1.
*
* Licensed under the GPL v2 as per the whole kernel source tree.
*
* Ripped out the rcu stuff, as it's not needed.
- *
- * $Header$
*/
#ifndef __LINUX_LIST_H__
@@ -61,7 +59,7 @@ struct list_head {
} while (0)
/*
- * Insert a new entry between two known consecutive entries.
+ * Insert a new entry between two known consecutive entries.
*
* This is only for internal list manipulation where we know
* the prev/next entries already!
@@ -135,7 +133,7 @@ static inline void list_del(struct list_head *entry)
static inline void list_del_init(struct list_head *entry)
{
__list_del(entry->prev, entry->next);
- INIT_LIST_HEAD(entry);
+ INIT_LIST_HEAD(entry);
}
/**
@@ -250,7 +248,7 @@ static inline void list_splice_init(struct list_head *list,
#define list_for_each_prev(pos, head) \
for (pos = (head)->prev, prefetch(pos->prev); pos != (head); \
pos = pos->prev, prefetch(pos->prev))
-
+
/**
* list_for_each_safe - iterate over a list safe against removal of list entry
* @pos: the &struct list_head to use as a loop counter.
@@ -301,44 +299,44 @@ static inline void list_splice_init(struct list_head *list,
&pos->member != (head); \
pos = n, n = list_entry(n->member.next, typeof(*n), member))
-/*
- * Double linked lists with a single pointer list head.
- * Mostly useful for hash tables where the two pointer list head is
+/*
+ * Double linked lists with a single pointer list head.
+ * Mostly useful for hash tables where the two pointer list head is
* too wasteful.
* You lose the ability to access the tail in O(1).
- */
+ */
-struct hlist_head {
- struct hlist_node *first;
-};
+struct hlist_head {
+ struct hlist_node *first;
+};
-struct hlist_node {
- struct hlist_node *next, **pprev;
-};
+struct hlist_node {
+ struct hlist_node *next, **pprev;
+};
-#define HLIST_HEAD_INIT { .first = NULL }
+#define HLIST_HEAD_INIT { .first = NULL }
#define HLIST_HEAD(name) struct hlist_head name = { .first = NULL }
-#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL)
+#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL)
#define INIT_HLIST_NODE(ptr) ((ptr)->next = NULL, (ptr)->pprev = NULL)
-static __inline__ int hlist_unhashed(struct hlist_node *h)
-{
+static __inline__ int hlist_unhashed(struct hlist_node *h)
+{
return !h->pprev;
-}
+}
-static __inline__ int hlist_empty(struct hlist_head *h)
-{
+static __inline__ int hlist_empty(struct hlist_head *h)
+{
return !h->first;
-}
+}
-static __inline__ void __hlist_del(struct hlist_node *n)
+static __inline__ void __hlist_del(struct hlist_node *n)
{
struct hlist_node *next = n->next;
struct hlist_node **pprev = n->pprev;
- *pprev = next;
- if (next)
+ *pprev = next;
+ if (next)
next->pprev = pprev;
-}
+}
static __inline__ void hlist_del(struct hlist_node *n)
{
@@ -347,30 +345,30 @@ static __inline__ void hlist_del(struct hlist_node *n)
n->pprev = LIST_POISON2;
}
-static __inline__ void hlist_del_init(struct hlist_node *n)
+static __inline__ void hlist_del_init(struct hlist_node *n)
{
if (n->pprev) {
__hlist_del(n);
INIT_HLIST_NODE(n);
}
-}
+}
-static __inline__ void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
-{
+static __inline__ void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
+{
struct hlist_node *first = h->first;
- n->next = first;
- if (first)
+ n->next = first;
+ if (first)
first->pprev = &n->next;
- h->first = n;
- n->pprev = &h->first;
-}
+ h->first = n;
+ n->pprev = &h->first;
+}
/* next must be != NULL */
static __inline__ void hlist_add_before(struct hlist_node *n, struct hlist_node *next)
{
n->pprev = next->pprev;
- n->next = next;
- next->pprev = &n->next;
+ n->next = next;
+ next->pprev = &n->next;
*(n->pprev) = n;
}
@@ -387,7 +385,7 @@ static __inline__ void hlist_add_after(struct hlist_node *n,
/* Cannot easily do prefetch unfortunately */
#define hlist_for_each(pos, head) \
for (pos = (head)->first; pos && ({ prefetch(pos->next); 1; }); \
- pos = pos->next)
+ pos = pos->next)
#define hlist_for_each_safe(pos, n, head) \
for (pos = (head)->first; n = pos ? pos->next : 0, pos; \
diff --git a/libsbutil/include/rcscripts/util/simple-regex.h b/libsbutil/include/rcscripts/util/simple-regex.h
index 56da8b0..f0a6ad7 100644
--- a/libsbutil/include/rcscripts/util/simple-regex.h
+++ b/libsbutil/include/rcscripts/util/simple-regex.h
@@ -3,23 +3,9 @@
*
* Simle regex library.
*
+ * Copyright 1999-2008 Gentoo Foundation
* Copyright 2004-2007 Martin Schlemmer <azarah@nosferatu.za.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Licensed under the GPL-2
*/
#ifndef __RC_SIMPLE_REGEX_H__
diff --git a/libsbutil/include/rcscripts/util/str_list.h b/libsbutil/include/rcscripts/util/str_list.h
index f0c9355..068f902 100644
--- a/libsbutil/include/rcscripts/util/str_list.h
+++ b/libsbutil/include/rcscripts/util/str_list.h
@@ -3,23 +3,9 @@
*
* String list macros.
*
+ * Copyright 1999-2008 Gentoo Foundation
* Copyright 2004-2007 Martin Schlemmer <azarah@nosferatu.za.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Licensed under the GPL-2
*/
#ifndef __RC_STR_LIST_H__
diff --git a/libsbutil/include/rcscripts/util/string.h b/libsbutil/include/rcscripts/util/string.h
index 9753d7a..25546e7 100644
--- a/libsbutil/include/rcscripts/util/string.h
+++ b/libsbutil/include/rcscripts/util/string.h
@@ -3,23 +3,9 @@
*
* Miscellaneous string related macro's and functions.
*
+ * Copyright 1999-2008 Gentoo Foundation
* Copyright 2004-2007 Martin Schlemmer <azarah@nosferatu.za.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Licensed under the GPL-2
*/
#ifndef __RC_STRING_H__
diff --git a/libsbutil/is_env_off.c b/libsbutil/is_env_off.c
index b29e487..e8cd977 100644
--- a/libsbutil/is_env_off.c
+++ b/libsbutil/is_env_off.c
@@ -3,26 +3,10 @@
*
* Util functions.
*
- * Copyright 1999-2006 Gentoo Foundation
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Copyright 1999-2008 Gentoo Foundation
+ * Licensed under the GPL-2
*/
-
#include <errno.h>
#include <stdlib.h>
#include <string.h>
@@ -36,7 +20,6 @@ bool is_env_off (const char *env)
(0 == strncasecmp(getenv(env), "false", 5)) ||
(0 == strncasecmp(getenv(env), "no", 2))))
return TRUE;
-
+
return FALSE;
}
-
diff --git a/libsbutil/is_env_on.c b/libsbutil/is_env_on.c
index 0cfd174..9736779 100644
--- a/libsbutil/is_env_on.c
+++ b/libsbutil/is_env_on.c
@@ -3,26 +3,10 @@
*
* Util functions.
*
- * Copyright 1999-2006 Gentoo Foundation
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Copyright 1999-2008 Gentoo Foundation
+ * Licensed under the GPL-2
*/
-
#include <errno.h>
#include <stdlib.h>
#include <string.h>
@@ -36,7 +20,6 @@ bool is_env_on (const char *env)
(0 == strncasecmp(getenv(env), "true", 4)) ||
(0 == strncasecmp(getenv(env), "yes", 3))))
return TRUE;
-
+
return FALSE;
}
-
diff --git a/libsbutil/sb_close.c b/libsbutil/sb_close.c
index 76045f1..3d9c023 100644
--- a/libsbutil/sb_close.c
+++ b/libsbutil/sb_close.c
@@ -3,26 +3,10 @@
*
* IO functions.
*
- * Copyright 1999-2006 Gentoo Foundation
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Copyright 1999-2008 Gentoo Foundation
+ * Licensed under the GPL-2
*/
-
#include <errno.h>
#include <stdio.h>
#include <sys/stat.h>
@@ -50,4 +34,3 @@ int sb_close(int fd)
return res;
}
-
diff --git a/libsbutil/sb_open.c b/libsbutil/sb_open.c
index 1e5240f..2d9c403 100644
--- a/libsbutil/sb_open.c
+++ b/libsbutil/sb_open.c
@@ -3,26 +3,10 @@
*
* IO functions.
*
- * Copyright 1999-2006 Gentoo Foundation
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Copyright 1999-2008 Gentoo Foundation
+ * Licensed under the GPL-2
*/
-
#include <errno.h>
#include <stdio.h>
#include <sys/stat.h>
@@ -55,7 +39,7 @@ int sb_open(const char *path, int flags, mode_t mode)
do {
fd = sbio_open(path, flags, mode);
} while ((-1 == fd) && (EINTR == errno));
-
+
if ((-1 != fd) && (0 != errno))
/* Do not trigger debugging */
errno = 0;
@@ -65,4 +49,3 @@ int sb_open(const char *path, int flags, mode_t mode)
return fd;
}
-
diff --git a/libsbutil/sb_read.c b/libsbutil/sb_read.c
index c7bc74e..43fe3c7 100644
--- a/libsbutil/sb_read.c
+++ b/libsbutil/sb_read.c
@@ -3,26 +3,10 @@
*
* IO functions.
*
- * Copyright 1999-2006 Gentoo Foundation
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Copyright 1999-2008 Gentoo Foundation
+ * Licensed under the GPL-2
*/
-
#include <errno.h>
#include <stdio.h>
#include <sys/stat.h>
@@ -67,4 +51,3 @@ size_t sb_read(int fd, void *buf, size_t count)
return accum;
}
-
diff --git a/libsbutil/sb_write.c b/libsbutil/sb_write.c
index 53597e0..32f52f1 100644
--- a/libsbutil/sb_write.c
+++ b/libsbutil/sb_write.c
@@ -3,26 +3,10 @@
*
* IO functions.
*
- * Copyright 1999-2006 Gentoo Foundation
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Copyright 1999-2008 Gentoo Foundation
+ * Licensed under the GPL-2
*/
-
#include <errno.h>
#include <stdio.h>
#include <sys/stat.h>
@@ -58,7 +42,6 @@ size_t sb_write(int fd, const void *buf, size_t count)
accum += n;
} while (accum < count);
-
+
return accum;
}
-
diff --git a/libsbutil/sbutil.h b/libsbutil/sbutil.h
index 09a12a3..068f77b 100644
--- a/libsbutil/sbutil.h
+++ b/libsbutil/sbutil.h
@@ -3,27 +3,11 @@
*
* Util defines.
*
- * Copyright 1999-2006 Gentoo Foundation
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Copyright 1999-2008 Gentoo Foundation
+ * Licensed under the GPL-2
*
* Some parts might have Copyright:
- *
* Copyright (C) 2002 Brad House <brad@mainstreetsoftworks.com>
- *
- * $Header$
*/
#ifndef __SBUTIL_H__
diff --git a/libsbutil/src/config.c b/libsbutil/src/config.c
index 0778ad3..3f4e6e1 100644
--- a/libsbutil/src/config.c
+++ b/libsbutil/src/config.c
@@ -3,23 +3,9 @@
*
* Miscellaneous macro's and functions.
*
+ * Copyright 1999-2008 Gentoo Foundation
* Copyright 2004-2007 Martin Schlemmer <azarah@nosferatu.za.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Licensed under the GPL-2
*/
#include <errno.h>
@@ -241,4 +227,3 @@ error:
return list;
}
-
diff --git a/libsbutil/src/debug.c b/libsbutil/src/debug.c
index 7c096d6..1d84b74 100644
--- a/libsbutil/src/debug.c
+++ b/libsbutil/src/debug.c
@@ -3,23 +3,9 @@
*
* Simle debugging/logging macro's and functions.
*
+ * Copyright 1999-2008 Gentoo Foundation
* Copyright 2004-2007 Martin Schlemmer <azarah@nosferatu.za.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Licensed under the GPL-2
*/
#include <errno.h>
@@ -332,4 +318,3 @@ __xstrndup (const char *str, size_t size, const char *file,
return new_ptr;
}
-
diff --git a/libsbutil/src/dynbuf.c b/libsbutil/src/dynbuf.c
index 29d0dfb..16bbdcc 100644
--- a/libsbutil/src/dynbuf.c
+++ b/libsbutil/src/dynbuf.c
@@ -3,23 +3,9 @@
*
* Dynamic allocated buffers.
*
+ * Copyright 1999-2008 Gentoo Foundation
* Copyright 2004-2007 Martin Schlemmer <azarah@nosferatu.za.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Licensed under the GPL-2
*/
#include <stdarg.h>
@@ -485,4 +471,3 @@ __rc_check_arg_dynbuf (rc_dynbuf_t *dynbuf, const char *file, const char *func,
return TRUE;
}
-
diff --git a/libsbutil/src/file.c b/libsbutil/src/file.c
index b712d62..c94cae1 100644
--- a/libsbutil/src/file.c
+++ b/libsbutil/src/file.c
@@ -3,23 +3,9 @@
*
* Miscellaneous file related macro's and functions.
*
+ * Copyright 1999-2008 Gentoo Foundation
* Copyright 2004-2007 Martin Schlemmer <azarah@nosferatu.za.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Licensed under the GPL-2
*/
#include <errno.h>
@@ -417,12 +403,12 @@ error:
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation version 2 of the 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.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
@@ -485,4 +471,3 @@ rc_file_unmap (char *buf, size_t bufsize)
{
munmap (buf, bufsize);
}
-
diff --git a/libsbutil/src/simple-regex.c b/libsbutil/src/simple-regex.c
index 25f9eb9..0e0020b 100644
--- a/libsbutil/src/simple-regex.c
+++ b/libsbutil/src/simple-regex.c
@@ -3,23 +3,9 @@
*
* Simle regex library.
*
+ * Copyright 1999-2008 Gentoo Foundation
* Copyright 2004-2007 Martin Schlemmer <azarah@nosferatu.za.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Licensed under the GPL-2
*/
/*
@@ -50,7 +36,7 @@
* not be consistant with other practices, but I personally do not feel it is
* a critical error for these types of functions, and there are debugging you
* can enable to verify that there are no such issues.
- *
+ *
* - __somefunction() is usually a helper function for somefunction(). I guess
* recursion might be an alternative, but I try to avoid it.
*
@@ -867,4 +853,3 @@ error:
return -1;
}
-
diff --git a/libsbutil/src/string.c b/libsbutil/src/string.c
index 32b52e0..3e23417 100644
--- a/libsbutil/src/string.c
+++ b/libsbutil/src/string.c
@@ -3,23 +3,9 @@
*
* Miscellaneous macro's and functions.
*
+ * Copyright 1999-2008 Gentoo Foundation
* Copyright 2004-2007 Martin Schlemmer <azarah@nosferatu.za.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation version 2 of the 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.,
- * 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Header$
+ * Licensed under the GPL-2
*/
#include <string.h>
@@ -105,4 +91,3 @@ rc_basename (const char *path)
new_path = strrchr (path, '/');
return new_path ? new_path + 1 : (char *) path;
}
-