libxl: Provide a version of bsd's queue.h as _libxl_list.h
PATCH v2 1/1 libxl: Provide a version of bsd's queue.h as _libxl_list.h
We would like some linked list macros which are (a) well known to be sane and (b) typesafe. BSD's queue.h meets these criteria.
We also provide some simple perlery to arrange to add the libxl_ namespace prefix to the macros. This will allow us to #include _libxl_list.h in our public header file without clashing with anyone else who is also using another version of queue.h.
---
Changes since v1:
- use move-if-changed to install _libxl_list.h
- mention bsd-queue.3's 4-clause BSD licence in COPYING
- explictly call the perl script from the Makefile with "perl"
- move the imported files into external/ and provide a README there
- sed out the include of sys/cdefs.h
- improved commit message
COPYING | 8 + tools/libxl/Makefile | 10 +- tools/libxl/bsd-sys-queue-h-seddery | 70 +++ tools/libxl/external/README | 13 + tools/libxl/external/bsd-queue.3 | 1044 ++++++++++++++++++++++++++++++++++ tools/libxl/external/bsd-sys-queue.h | 637 +++++++++++++++++++++ 6 files changed, 1779 insertions(+), 3 deletions(-)
COPYING +8 -0
@@ -18,6 +18,14 @@ GPLv2. See the FSF's definition of GPL compatibility: And how this applies to a range of open source licenses: http://www.gnu.org/licenses/license-list.html +Additionally, the documentation file tools/libxl/external/bsd-queue.3 +has the 4-clause BSD licence. It is present in the Xen source tree +for reference purposes for people developing Xen. It is not installed +by "make install" and is bundled in the source only for convenience of +distribution. We do not intend that we or Xen users or distributors +should make any reference to "features or use" of that manpage. + + Licensing Exceptions (the relaxed BSD-style license) ----------------------------------------------------
tools/libxl/Makefile +7 -3
@@ -42,7 +42,7 @@ LIBXL_OBJS += _libxl_types.o libxl_flask.o _libxl_types_internal.o $(LIBXL_OBJS): CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenguest) $(CFLAGS_libxenstore) $(CFLAGS_libblktapctl) -AUTOINCS= libxlu_cfg_y.h libxlu_cfg_l.h +AUTOINCS= libxlu_cfg_y.h libxlu_cfg_l.h _libxl_list.h AUTOSRCS= libxlu_cfg_y.c libxlu_cfg_l.c LIBXLU_OBJS = libxlu_cfg_y.o libxlu_cfg_l.o libxlu_cfg.o \ libxlu_disk_l.o libxlu_disk.o
@@ -55,7 +55,7 @@ $(XL_OBJS): CFLAGS += $(CFLAGS_libxenctrl) # For xentoollog.h $(XL_OBJS): CFLAGS += $(CFLAGS_libxenlight) testidl.o: CFLAGS += $(CFLAGS_libxenctrl) $(CFLAGS_libxenlight) -testidl.c: libxl_types.idl gentest.py libxl.h +testidl.c: libxl_types.idl gentest.py libxl.h $(AUTOINCS) $(PYTHON) gentest.py libxl_types.idl testidl.c.new mv testidl.c.new testidl.c
@@ -63,7 +63,7 @@ testidl.c: libxl_types.idl gentest.py libxl.h all: $(CLIENTS) libxenlight.so libxenlight.a libxlutil.so libxlutil.a \ $(AUTOSRCS) $(AUTOINCS) -$(LIBXLU_OBJS): $(AUTOINCS) +$(LIBXL_OBJS) $(LIBXLU_OBJS) $(XL_OBJS): $(AUTOINCS) %.c %.h: %.y @rm -f $*.[ch]
@@ -81,6 +81,10 @@ _libxl_paths.h: genpath rm -f [email protected] $(call move-if-changed,[email protected],$@) +_libxl_list.h: bsd-sys-queue-h-seddery external/bsd-sys-queue.h + perl ./$^ --prefix=libxl >[email protected] + $(call move-if-changed,[email protected],$@) + libxl_paths.c: _libxl_paths.h libxl.h: _libxl_types.h
tools/libxl/bsd-sys-queue-h-seddery new file +70 -0
70 lines not on this page · raw message
tools/libxl/external/README new file +13 -0
@@ -0,0 +1,13 @@ +WARNING - DO NOT EDIT THINGS IN THIS DIRECTORY (apart from this README) +----------------------------------------------------------------------- + +These files were obtained elsewhere and should only be updated by +copying new versions from the source location, as documented below: + +bsd-sys-queue.h +bsd-queue.3 + + Obtained from the FreeBSD SVN using the following commands: + svn co -r 221843 svn://svn.freebsd.org/base/head/sys/sys/ + svn co -r 221843 svn://svn.freebsd.org/base/head/share/man/man3 +
tools/libxl/external/bsd-queue.3 new file +1044 -0
1,044 lines not on this page · raw message
tools/libxl/external/bsd-sys-queue.h new file +637 -0
637 lines not on this page · raw message
Signature · 1 line
tg: (92a50a8..) t/xen/bsd-queue (depends on: t/xen/gitignore)
Quoted 37 lines · Ian Jackson
We would like some linked list macros which are (a) well known to be sane and (b) typesafe. BSD's
queue.hmeets these criteria.We also provide some simple perlery to arrange to add the
libxl_namespace prefix to the macros. This will allow us to #include_libxl_list.hin our public header file without clashing with anyone else who is also using another version ofqueue.h.Signed-off-by Ian Jackson <[email protected]>---
Changes since v1:
- use move-if-changed to install_libxl_list.h
- mention bsd-queue.3's 4-clause BSD licence in COPYING
- explictly call the perl script from theMakefilewith "perl"
- move the imported files into external/ and provide a README there
- sed out the include ofsys/cdefs.h
- improved commit messageCOPYING | 8 + tools/libxl/Makefile | 10 +- tools/libxl/bsd-sys-queue-h-seddery | 70 +++ tools/libxl/external/README | 13 + tools/libxl/external/bsd-queue.3 | 1044 ++++++++++++++++++++++++++++++++++ tools/libxl/external/bsd-sys-queue.h | 637 +++++++++++++++++++++ 6 files changed, 1779 insertions(+), 3 deletions(-)COPYING +0
-0@@ -18,6 +18,14 @@ GPLv2. See the FSF's definition of GPL compatibility:And how this applies to a range of open source licenses:
http://www.gnu.org/licenses/license-list.html
COPYING GPLv2. See the FSF's definition of GPL compatibility: · line 26
Quoted 6 lines
COPYING +6
-0+Additionally, the documentation file tools/libxl/external/bsd-queue.3 +has the 4-clause BSD licence. It is present in the Xen source tree +for reference purposes for people developing Xen. It is not installed +by "make install" and is bundled in the source only for convenience of +distribution. We do not intend that we or Xen users or distributors +should make any reference to "features or use" of that manpage.
FWIW, the advertising clause was rescinded by Berkeley about 12 years ago and can be removed from their code. OpenBSD did this in queue.3 in:
Author: Todd C. Miller <[email protected]> Date: Mon Jun 2 23:32:09 2003 +0000
Remove the advertising clause in the UCB license which Berkeley rescinded 22 July 1999. Proofed by myself and Theo.
...so you may want to grab that version for simplicity. I'm not sure why FreeBSD hasn't removed it.
-anil
Roger Pau Monné
Tested-byI've tested this one on NetBSD, and it works fine.