From daa493a178f70e66a7a30636109e50dbf48825e9 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Tue, 21 Aug 2012 18:04:19 +0900 Subject: [PATCH] upload tizen2.0 source --- COPYING | 3 +- ChangeLog | 391 +++++++ INSTALL | 291 +++++ Makefile.am | 0 NEWS | 0 README | 0 autogen.sh | 12 - configure.ac | 60 +- debian/README.source | 73 -- debian/changelog | 197 ---- debian/compat | 1 - debian/control | 67 -- debian/copyright | 24 - debian/libsm-dev.install | 5 - debian/libsm6.install | 1 - ...01-sm.pc-don-t-export-a-dependency-on-ice.patch | 26 - debian/patches/series | 1 - debian/rules | 112 -- debian/watch | 2 - debian/xsfbs/repack.sh | 32 - debian/xsfbs/xsfbs.mk | 293 ----- debian/xsfbs/xsfbs.sh | 853 -------------- doc/Makefile.am | 63 +- doc/SMlib.xml | 736 ++++++------ doc/xsmp.xml | 1229 ++++++++++++-------- docbook.am | 105 ++ include/X11/SM/SM.h | 0 include/X11/SM/SMlib.h | 6 +- include/X11/SM/SMproto.h | 0 packaging/libSM.spec | 74 +- sm.pc.in | 4 +- src/Makefile.am | 5 +- src/SMlibint.h | 10 +- src/sm_auth.c | 0 src/sm_client.c | 32 +- src/sm_error.c | 8 +- src/sm_genid.c | 154 ++- src/sm_manager.c | 14 +- src/sm_misc.c | 32 +- src/sm_process.c | 14 +- 40 files changed, 2075 insertions(+), 2855 deletions(-) mode change 100755 => 100644 COPYING mode change 100755 => 100644 ChangeLog create mode 100644 INSTALL mode change 100755 => 100644 Makefile.am delete mode 100644 NEWS mode change 100755 => 100644 README delete mode 100644 autogen.sh mode change 100755 => 100644 configure.ac delete mode 100644 debian/README.source delete mode 100755 debian/changelog delete mode 100644 debian/compat delete mode 100755 debian/control delete mode 100644 debian/copyright delete mode 100755 debian/libsm-dev.install delete mode 100644 debian/libsm6.install delete mode 100644 debian/patches/0001-sm.pc-don-t-export-a-dependency-on-ice.patch delete mode 100644 debian/patches/series delete mode 100755 debian/rules delete mode 100644 debian/watch delete mode 100644 debian/xsfbs/repack.sh delete mode 100644 debian/xsfbs/xsfbs.mk delete mode 100644 debian/xsfbs/xsfbs.sh mode change 100755 => 100644 doc/Makefile.am mode change 100755 => 100644 doc/SMlib.xml mode change 100755 => 100644 doc/xsmp.xml create mode 100644 docbook.am mode change 100755 => 100644 include/X11/SM/SM.h mode change 100755 => 100644 include/X11/SM/SMlib.h mode change 100755 => 100644 include/X11/SM/SMproto.h mode change 100755 => 100644 src/Makefile.am mode change 100755 => 100644 src/SMlibint.h mode change 100755 => 100644 src/sm_auth.c mode change 100755 => 100644 src/sm_error.c mode change 100755 => 100644 src/sm_genid.c mode change 100755 => 100644 src/sm_manager.c mode change 100755 => 100644 src/sm_misc.c mode change 100755 => 100644 src/sm_process.c diff --git a/COPYING b/COPYING old mode 100755 new mode 100644 index 0975602..11e2436 --- a/COPYING +++ b/COPYING @@ -1,4 +1,4 @@ -Copyright 2002 Sun Microsystems, Inc. All rights reserved. +Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -19,6 +19,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + Copyright 1993, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its diff --git a/ChangeLog b/ChangeLog old mode 100755 new mode 100644 index fbac5dc..6195413 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,394 @@ +commit b3d1f4896cab54717acd691b62b7fa3122a5fd8c +Author: Alan Coopersmith +Date: Fri Mar 2 20:53:41 2012 -0800 + + libSM 1.2.1 + + Signed-off-by: Alan Coopersmith + +commit 6475d9eff0bfbb6446eff205fd52c5ba82c5819c +Author: Matt Dew +Date: Wed Jan 11 20:33:41 2012 -0700 + + informaltable cleanup + + On certain tables, add top and bottom borders to table + header and a bottom border to the table. This matches + what those tables in the old pdfs looked like. + + the prevents tables from + splitting across pages. Useful for tiny tables. + + Converting the colwidth to a floating point, + IE, 1* -> 1.0* cleans up these build errors: + WARNING: table-layout="fixed" and column-width unspecified + => falling back to proportional-column-width(1) + + Signed-off-by: Matt Dew + +commit 3ca545c7835b71b63f8c5a8f758b08418a65a5bb +Author: Alan Coopersmith +Date: Mon Dec 5 20:04:51 2011 -0800 + + unifdef -ULynx + + Signed-off-by: Alan Coopersmith + Reviewed-by: Mark Kettenis + Reviewed-by: James Cloos + +commit 4af9e4a71f7c07da86ef1940cba69e92b11ba337 +Author: Alan Coopersmith +Date: Sat Nov 19 11:33:30 2011 -0800 + + SmsInitialize: Mark vendor & release args as const char * + + Needed to fix gcc -Wwrite-strings arguments in callers such as xsm. + + Signed-off-by: Alan Coopersmith + Reviewed-by: James Cloos + +commit e77dd2e4bc8227ebdab70b4233cb33ed690fa264 +Author: Alan Coopersmith +Date: Sat Nov 19 10:33:15 2011 -0800 + + Remove a bunch of unnecessary casts with malloc & free calls + + With modern compilers and headers, they cause more problems than they + solve and just hide real issues. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Mark Kettenis + Reviewed-by: James Cloos + +commit 46f3ef4460aa2c1c2cba22897694a1cea572d506 +Author: Alan Coopersmith +Date: Sat Nov 19 10:23:24 2011 -0800 + + Replace malloc(strlen) + strcpy sets with strdup calls + + Signed-off-by: Alan Coopersmith + Reviewed-by: Mark Kettenis + Reviewed-by: James Cloos + +commit fb3ef5844d392f70cc6bd9b0d8770ca17bde1428 +Author: Alan Coopersmith +Date: Sat Nov 19 10:13:02 2011 -0800 + + Reindent IPv4 code to match IPv6 code + + Takes care of the other block of code confusingly sharing indent levels + + Signed-off-by: Alan Coopersmith + Reviewed-by: James Cloos + +commit 638496507882f0afe506fe294f68ad5290ef95db +Author: Alan Coopersmith +Date: Sat Nov 19 10:07:32 2011 -0800 + + Move variable declarations to get rid of unnecessary scope brackets + + Gets rid of one of the multiple levels of bracketing that confusingly + shared the same indent level. + + Signed-off-by: Alan Coopersmith + Reviewed-by: James Cloos + +commit 9f350d75a4553d8e2bc365f8de4110bb79ec7b32 +Author: Alan Coopersmith +Date: Sat Nov 19 10:01:50 2011 -0800 + + Move and rename temp[4] definition to reduce confusion with temp[256] + + Both variables were locals in different scope levels of the same + function, leading to both confusing code and gcc -Wshadow warnings: + + sm_genid.c: In function 'SmsGenerateClientID': + sm_genid.c:160:10: warning: declaration of 'temp' shadows a previous local + + Signed-off-by: Alan Coopersmith + Reviewed-by: James Cloos + +commit 079de6fd4bd0423e20e472d7342f919eebce0517 +Author: Alan Coopersmith +Date: Sat Nov 19 09:52:17 2011 -0800 + + Use imdent to make multiple levels of nested #if easier to follow + + Signed-off-by: Alan Coopersmith + Reviewed-by: James Cloos + +commit 79c785adf86ef06f09910b68019bc8a1e6fcb122 +Author: Matt Dew +Date: Tue Oct 4 22:42:05 2011 -0600 + + Cleanup IDs and links in doc + + 1 - fix the capitalization of the ID attributes to match either the + or <funcdef> string it goes with. + 2 - fix any <linkend>'s that were affected by 1. + 3 - any <function> in the docs that has an actual funcdef, + will become an olink. + + Signed-off-by: Matt Dew <marcoz@osource.org> + +commit 4708d636de50281ab2c52c32b81b7ecb67657820 +Author: Alan Coopersmith <alan.coopersmith@oracle.com> +Date: Fri Sep 16 22:03:00 2011 -0700 + + Strip trailing whitespace + + Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}' + git diff -w & git diff -b show no diffs from this change + + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> + +commit 44eecd93986368e71c404d8faa264a514bf88ab1 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Wed Sep 14 14:59:27 2011 -0400 + + docs: fix author affiliation + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 7ed7ef36b7e1fdd29554db122e4eb07323e27dee +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Mon Sep 12 16:54:45 2011 -0400 + + docs: use the &fullrelvers; entity to set X11 release information + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 7601182a252b44d0b04435f1eb4d574dfcf5fabb +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Sep 11 19:49:53 2011 -0400 + + docs: remove <productnumber> which is not used by default + + This element is not rendered by default on the title. A template + customization is required to display it. + X Window System does not have a product number. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit cbca5fad657122d1a9f370d0640acb66ef80aaef +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Thu Sep 8 20:00:00 2011 -0400 + + docbook.am: embed css styles inside the HTML HEAD element + + Rather than referring to the external xorg.css stylesheet, embed the content + of the file in the html output produced. This is accomplished by using + version 1.10 of xorg-xhtml.xsl. + + This makes the whole html docs tree much more relocatable. + In addition, it eliminates xorg.css as a runtime file which makes + xorg-sgml-doctools a build time only package. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit b88a9949fa6e1b12348541c6293535cc7ff931f4 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Wed Sep 7 10:31:04 2011 -0400 + + docbook.am: global maintenance update - entities, images and olinking + + Adding support in libX11 for html chunking caused a reorg of docbook.am + as well as the xorg-sgml-doctools masterdb for olinking. + The parameter img.src.path is added for pdf images. + A searchpath to the root builddir is added for local entities, if present. + + The docbook.am makefile hides all the details and is identical for + all 22 modules having DocBook documentation. It is included by a thin + Makefile.am which requires no docbook knowledge. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 64e002e55555205fdcdb9e6d78d6eadd4136cb7a +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Jun 12 17:54:50 2011 -0400 + + Install xml versions of specs even if HAVE_XMLTO is false + + DocBook/XML input source is also a usefull output format that can be viewed + with an XML viewer or editor and by some O/S help system. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit bef231eefedae448255b705aa2f687f49e371b71 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Jun 5 16:27:36 2011 -0400 + + Install target dbs alongside generated documents + + This matches a change in xorg-sgml-docs whereby the masterdb will look for + the target dbs into the same location as the generated documents. + + The target dbs are now installed alongside the generated documents. + Previously they are installed in $prefix/sgml/X11/dbs alongside masterdb which + has the potential of installing outside the package prefix and cause + distcheck to fail when user does not have write permission in this package. + + Requires XORG_CHECK_SGML_DOCTOOLS(1.8) which was released 2011-06-11 + +commit f7473da7b1ff6a5295a145f808c327e655e574a9 +Author: Matt Dew <marcoz@osource.org> +Date: Wed May 25 23:46:36 2011 -0600 + + add id attributes to funcsynopsis to allow other docs to olink to them. + + Signed-off-by: Matt Dew <marcoz@osource.org> + Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> + Reviewed-by: Gaetan Nadon <memsize@videotron.ca> + +commit 8683bdd74d3e40c7db92efd25acf345f6331b252 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Sun Feb 27 15:06:18 2011 -0500 + + Documentation: add Docbook external references support + + When writing technical documentation, it is often necessary to cross + reference to other information. When that other information is not in the + current document, additional support is needed, namely <olink>. + + A new feature with version 1.7 of xorg-sgml-doctools adds references to + other documents within or outside this package. + + This patch adds technical support for this feature but does not change + the content of the documentation as seen by the end user. + + Each book or article must generate a database containing the href + of sections that can be referred to from another document. This database + is installed in DATAROOTDIR/sgml/X11/dbs. There is a requirement that + the value of DATAROOTDIR for xorg-sgml-doctools and for the package + documentation is the same. This forms a virtual document tree. + + This database is consulted by other documents while they are being generated + in order to fulfill the missing information for linking. + Refer to the xorg-sgml-doctools for further technical information. + + Co-authored-by: Matt Dew <marcoz@osource.org> + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 252f6d2add7c926cdcf0cea43da04f182720b0b4 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Fri Feb 25 09:04:45 2011 -0500 + + Docbook: change the book id to match the xml file basename + + This is required for the up-coming external references support. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 2cd30c36c080217c20addf311510881c8eecf374 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Wed Feb 2 19:25:52 2011 -0500 + + config: splitting SM and XTRANS compiler options is not required + + Simplify configuration by using a single PKG_CHECK_MODULES statement. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 3c923881f415651d75434efd209003d602253437 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Wed Feb 2 11:43:40 2011 -0500 + + config: comment, minor upgrade, quote and layout configure.ac + + Group statements per section as per Autoconf standard layout + Quote statements where appropriate. + Autoconf recommends not using dnl instead of # for comments + + Use AC_CONFIG_FILES to replace the deprecated AC_OUTPUT with parameters. + + This helps automated maintenance and release activities. + Details can be found in http://wiki.x.org/wiki/NewModuleGuidelines + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit b29f5c9f3a728c5b7673cf54ad60d988b5dd93e7 +Author: Alan Coopersmith <alan.coopersmith@oracle.com> +Date: Thu Jan 27 22:05:40 2011 -0800 + + Bug 33390 - sm.pc: don't export a dependency on ice + + https://bugs.freedesktop.org/show_bug.cgi?id=33390 + + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> + Reviewed-by: Dan Nicholson <dbn.lists@gmail.com> + +commit fe43b6de5bb4423ce99d2df1ab37ea8ece39a9fa +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Fri Jan 28 16:07:07 2011 -0500 + + config: replace deprecated AC_HELP_STRING with AS_HELP_STRING + + This silences an Automake warning. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + +commit 57b6f700378a001e1aff9b83f6cb396c7c4a7368 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Fri Jan 28 14:59:04 2011 -0500 + + config: remove unrequired AC_HEADER_STDC + + Autoconf says: + "This macro is obsolescent, as current systems have conforming + header files. New programs need not use this macro". + +commit 8f9878c06e359d21715a3e4358895b589466bc46 +Author: Paulo Zanoni <pzanoni@mandriva.com> +Date: Thu Dec 16 14:03:06 2010 -0200 + + Use docbookx.dtd version 4.3 for all docs + + Signed-off-by: Paulo Zanoni <pzanoni@mandriva.com> + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> + +commit 6d093e2397ecdbbba044fe7ef2fd922c8c8261de +Author: Alan Coopersmith <alan.coopersmith@oracle.com> +Date: Sun Nov 21 11:19:45 2010 -0800 + + config: replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERS + + Regroup AC statements under the Autoconf initialization section. + Regroup AM statements under the Automake initialization section. + + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> + +commit b8ef6cea0ccae4d88a9cb91cd836188ae781cda8 +Author: Alan Coopersmith <alan.coopersmith@oracle.com> +Date: Sun Nov 21 11:17:25 2010 -0800 + + config: Remove unnecessary calls from configure.ac + + AC_PROG_CC are provided by XORG_DEFAULT_OPTIONS now + PKG_CONFIG_MODULES handles AC_SUBST of the CFLAGS & LIBS variables + + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> + +commit 15dc32dd7b57315f9e319f3e346ba28a1e69c646 +Author: Alan Coopersmith <alan.coopersmith@oracle.com> +Date: Sun Nov 21 11:16:14 2010 -0800 + + Sun's copyrights belong to Oracle now + + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> + +commit 8480764c94d15673c884b90c7a10bc86635dec63 +Author: Gaetan Nadon <memsize@videotron.ca> +Date: Tue Nov 9 13:04:40 2010 -0500 + + config: HTML file generation: use the installed copy of xorg.css + + Currenlty the xorg.css file is copied in each location + where a DocBook/XML file resides. This produces about + 70 copies in the $(docdir) install tree. + + Signed-off-by: Gaetan Nadon <memsize@videotron.ca> + commit d2327760a52fdbcd3759211578e3663e00e4a31e Author: Alan Coopersmith <alan.coopersmith@oracle.com> Date: Wed Oct 27 22:26:41 2010 -0700 diff --git a/INSTALL b/INSTALL new file mode 100644 index 0000000..8b82ade --- /dev/null +++ b/INSTALL @@ -0,0 +1,291 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007, 2008 Free Software Foundation, Inc. + + This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + + Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 6. Often, you can also type `make uninstall' to remove the installed + files again. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +Installation Names +================== + + By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + + Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `<wchar.h>' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`--prefix=DIR' + Use DIR as the installation prefix. *Note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/Makefile.am b/Makefile.am old mode 100755 new mode 100644 diff --git a/NEWS b/NEWS deleted file mode 100644 index e69de29..0000000 diff --git a/README b/README old mode 100755 new mode 100644 diff --git a/autogen.sh b/autogen.sh deleted file mode 100644 index 904cd67..0000000 --- a/autogen.sh +++ /dev/null @@ -1,12 +0,0 @@ -#! /bin/sh - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -ORIGDIR=`pwd` -cd $srcdir - -autoreconf -v --install || exit 1 -cd $ORIGDIR || exit $? - -$srcdir/configure --enable-maintainer-mode "$@" diff --git a/configure.ac b/configure.ac old mode 100755 new mode 100644 index 54aabdb..6d578e6 --- a/configure.ac +++ b/configure.ac @@ -1,51 +1,36 @@ -# -*- Autoconf -*- -# Process this file with autoconf to produce a configure script. +# Initialize Autoconf AC_PREREQ(2.60) -AC_INIT([libSM], - [1.2.0], - [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], - libSM) - +AC_INIT([libSM], [1.2.1], + [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libSM]) AC_CONFIG_SRCDIR([Makefile.am]) -AM_INIT_AUTOMAKE([foreign dist-bzip2]) +AC_CONFIG_HEADERS([config.h]) +# Initialize Automake +AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_MAINTAINER_MODE -# Require xorg-macros minimum of 1.10 for DocBook XML documentation +# Initialize libtool +AC_PROG_LIBTOOL + +# Require xorg-macros minimum of 1.12 for DocBook external references m4_ifndef([XORG_MACROS_VERSION], - [m4_fatal([must install xorg-macros 1.10 or later before running autoconf/autogen])]) -XORG_MACROS_VERSION(1.10) + [m4_fatal([must install xorg-macros 1.12 or later before running autoconf/autogen])]) +XORG_MACROS_VERSION(1.12) XORG_DEFAULT_OPTIONS XORG_ENABLE_DOCS -XORG_WITH_XMLTO(0.0.20) +XORG_WITH_XMLTO(0.0.22) XORG_WITH_FOP -XORG_CHECK_SGML_DOCTOOLS(1.5) - -AM_CONFIG_HEADER([config.h]) - -# Checks for programs. -AC_PROG_LIBTOOL -AC_PROG_CC - -# Checks for pkg-config packages -PKG_CHECK_MODULES(SM, [ice >= 1.0.5] xproto) -AC_SUBST(SM_CFLAGS) -AC_SUBST(SM_LIBS) - -PKG_CHECK_MODULES(XTRANS, xtrans) -AC_SUBST(XTRANS_CFLAGS) -AC_SUBST(XTRANS_LIBS) - -# Checks for libraries. +XORG_WITH_XSLTPROC +XORG_CHECK_SGML_DOCTOOLS(1.8) -# Checks for header files. -AC_HEADER_STDC +# Obtain compiler/linker options for depedencies +PKG_CHECK_MODULES(SM, [ice >= 1.0.5] xproto xtrans) # Needed to check for TCP & IPv6 support and set flags appropriately XTRANS_CONNECTION_FLAGS -AC_ARG_WITH(libuuid, AC_HELP_STRING([--with-libuuid], [Build with libuuid support for client IDs])) +AC_ARG_WITH(libuuid, AS_HELP_STRING([--with-libuuid], [Build with libuuid support for client IDs])) AC_CHECK_FUNCS([uuid_create], [], [ if test x"$with_libuuid" != xno && test x"$have_system_uuid" != xyes; then @@ -58,7 +43,8 @@ AC_CHECK_FUNCS([uuid_create], [], [ AM_CONDITIONAL(WITH_LIBUUID, test x"$HAVE_LIBUUID" = xyes) -AC_OUTPUT([Makefile - doc/Makefile - src/Makefile - sm.pc]) +AC_CONFIG_FILES([Makefile + doc/Makefile + src/Makefile + sm.pc]) +AC_OUTPUT diff --git a/debian/README.source b/debian/README.source deleted file mode 100644 index 34ab4bf..0000000 --- a/debian/README.source +++ /dev/null @@ -1,73 +0,0 @@ ------------------------------------------------------- -Quick Guide To Patching This Package For The Impatient ------------------------------------------------------- - -1. Make sure you have quilt installed -2. Unpack the package as usual with "dpkg-source -x" -3. Run the "patch" target in debian/rules -4. Create a new patch with "quilt new" (see quilt(1)) -5. Edit all the files you want to include in the patch with "quilt edit" - (see quilt(1)). -6. Write the patch with "quilt refresh" (see quilt(1)) -7. Run the "clean" target in debian/rules - -Alternatively, instead of using quilt directly, you can drop the patch in to -debian/patches and add the name of the patch to debian/patches/series. - ------------------------------------- -Guide To The X Strike Force Packages ------------------------------------- - -The X Strike Force team maintains X packages in git repositories on -git.debian.org in the pkg-xorg subdirectory. Most upstream packages -are actually maintained in git repositories as well, so they often -just need to be pulled into git.debian.org in a "upstream-*" branch. -Otherwise, the upstream sources are manually installed in the Debian -git repository. - -The .orig.tar.gz upstream source file could be generated this -"upstream-*" branch in the Debian git repository but it is actually -copied from upstream tarballs directly. - -Due to X.org being highly modular, packaging all X.org applications -as their own independent packages would have created too many Debian -packages. For this reason, some X.org applications have been grouped -into larger packages: xutils, xutils-dev, x11-apps, x11-session-utils, -x11-utils, x11-xfs-utils, x11-xkb-utils, x11-xserver-utils. -Most packages, including the X.org server itself and all libraries -and drivers are, however maintained independently. - -The Debian packaging is added by creating the "debian-*" git branch -which contains the aforementioned "upstream-*" branch plus the debian/ -repository files. -When a patch has to be applied to the Debian package, two solutions -are involved: -* If the patch is available in one of the upstream branches, it - may be git'cherry-picked into the Debian repository. In this - case, it appears directly in the .diff.gz. -* Otherwise, the patch is added to debian/patches/ which is managed - with quilt as documented in /usr/share/doc/quilt/README.source. - -quilt is actually invoked by the Debian X packaging through a larger -set of scripts called XSFBS. XSFBS brings some other X specific -features such as managing dependencies and conflicts due to the video -and input driver ABIs. -XSFBS itself is maintained in a separate repository at - git://git.debian.org/pkg-xorg/xsfbs.git -and it is pulled inside the other Debian X repositories when needed. - -The XSFBS patching system requires a build dependency on quilt. Also -a dependency on $(STAMP_DIR)/patch has to be added to debian/rules -so that the XSFBS patching occurs before the actual build. So the -very first target of the build (likely the one running autoreconf) -should depend on $(STAMP_DIR)/patch. It should also not depend on -anything so that parallel builds are correctly supported (nothing -should probably run while patching is being done). And finally, the -clean target should depend on the xsfclean target so that patches -are unapplied on clean. - -When the upstream sources contain some DFSG-nonfree files, they are -listed in text files in debian/prune/ in the "debian-*" branch of -the Debian repository. XSFBS' scripts then take care of removing -these listed files during the build so as to generate a modified -DFSG-free .orig.tar.gz tarball. diff --git a/debian/changelog b/debian/changelog deleted file mode 100755 index 06bf0b8..0000000 --- a/debian/changelog +++ /dev/null @@ -1,197 +0,0 @@ -libsm (2:1.2.0-1slp2) unstable; urgency=low - - * [X11R7.6] upgrade package - * Git: 165.213.180.234:slp/pkgs/xorg/lib/libsm - * Tag: libsm_1.2.0-1slp2 - - -- SooChan Lim <sc1.lim@samsung.com> Mon, 03 Jan 2011 22:17:16 +0900 - -libsm (2:1.1.1-6slp2) unstable; urgency=low - - * Modify the changelog - * Git: 165.213.180.234:/git/slp/pkgs/xorg/lib/libsm - * Tag: libsm_1.1.1-6slp2 - - -- SooChan Lim <sc1.lim@samsung.com> Fri, 26 Nov 2010 10:53:37 +0900 - -libsm (2:1.1.1-5slp2) unstable; urgency=low - - * modify the package name - - -- SooChan Lim <sc1.lim@samsung.com> Thu, 25 Mar 2010 17:38:53 +0900 - -libsm (2:1.1.1-4) unstable; urgency=low - - * Change configure option (--with-uuid=no) temporarily for build rdepends packages properly. - - -- Sung-Jin Park <sj76.park@samsung.com> Thu, 17 Dec 2009 10:28:06 +0900 - -libsm (2:1.1.1-3) unstable; urgency=low - - * Fix debian/rules to install .la files properly - - -- Sung-Jin Park <sj76.park@samsung.com> Mon, 07 Dec 2009 14:37:58 +0900 - -libsm (2:1.1.1-2) unstable; urgency=low - - * Import debian package - * Install .la files - - -- Sung-Jin Park <sj76.park@samsung.com> Mon, 07 Dec 2009 10:30:25 +0900 - -libsm (2:1.1.1-1) unstable; urgency=low - - * New upstream release. - * Move libsm6-dbg to 'debug' section. - * Drop x11-common (pre-)dependencies, this isn't needed anymore. - * Bump libice-dev build-dep to 2:1.0.5. - * Bump xutils-dev build-dep to 1:7.4+4 for new util-macros. - * Add README.source from xsfbs, bump Standards-Version to 3.8.3. - * Look for space-separated DEB_BUILD_OPTIONS. - - -- Julien Cristau <jcristau@debian.org> Tue, 25 Aug 2009 17:58:18 +0200 - -libsm (2:1.1.0-2) unstable; urgency=low - - * Upload to unstable. - - -- Julien Cristau <jcristau@debian.org> Mon, 16 Feb 2009 01:33:27 +0100 - -libsm (2:1.1.0-1) experimental; urgency=low - - [ Brice Goglin ] - * Use ${binary:Version} instead of the deprecated ${Source-Version}. - - [ Julien Cristau ] - * New upstream release. - - generate client IDs using libuuid instead of gethostbyname() - * Switch to running autoreconf at build time; clean up in debian/rules - clean, and build-depend on automake, libtool and xutils-dev. - * Drop -1 debian revisions from build-deps. - * Stop handling nostrip explicitly in debian/rules (dh_strip does it - already), and allow parallel builds using sample code from policy. - * Add myself to Uploaders. - * Don't export a dependency on ice in sm.pc. - - -- Julien Cristau <jcristau@debian.org> Fri, 18 Jul 2008 16:16:47 +0200 - -libsm (2:1.0.3-2) unstable; urgency=low - - * Fix short descriptions of libsm-dev and libsm-dbg, - thanks Philippe Cloutier, closes: #432967. - * Add upstream URL to debian/copyright. - * Bump Standards-Version to 3.7.3 (no changes). - * Add myself to Uploaders, and remove Branden and Fabio with their - permission. - * Add Vcs-Browser field and drop the XS- prefix from Vcs-Git. - * Add a link to www.X.org and a reference to the libSM module in the long - description. - - -- Brice Goglin <bgoglin@debian.org> Fri, 13 Jun 2008 07:07:33 +0200 - -libsm (2:1.0.3-1) unstable; urgency=low - - [ Julien Cristau ] - * Move binary packages to the proper sections. - * New upstream release. - - [ Timo Aaltonen ] - * Bump the epoch so that this can be synced to Ubuntu in the future. - - -- Julien Cristau <jcristau@debian.org> Mon, 14 May 2007 16:41:22 +0200 - -libsm (1:1.0.2-2) unstable; urgency=low - - * Upload to unstable. - - -- Julien Cristau <jcristau@debian.org> Wed, 11 Apr 2007 10:53:40 +0200 - -libsm (1:1.0.2-1) experimental; urgency=low - - * New upstream release. - * Drop obsolete CVS info from the descriptions, and add XS-Vcs-Git. - * Install the upstream changelog. - - -- Julien Cristau <jcristau@debian.org> Fri, 9 Feb 2007 17:37:39 +0100 - -libsm (1:1.0.1-3) unstable; urgency=low - - * Exclude libSM.la from dh_install. - * The library in debian/rules is libsm6 not libxau6! Closes: #383468. - * libsm-dev uses versioned depends on libice-dev from X11R7. - Closes: #372129. - - -- Drew Parsons <dparsons@debian.org> Fri, 22 Sep 2006 21:33:23 +1000 - -libsm (1:1.0.1-2) unstable; urgency=low - - [ Andres Salomon ] - * Test for obj-$(DEB_BUILD_GNU_TYPE) before creating it during build; - idempotency fix. - - [ Drew Parsons ] - * dbg package has priority extra. - - -- David Nusinow <dnusinow@debian.org> Tue, 29 Aug 2006 23:35:12 +0000 - -libsm (1:1.0.1-1) experimental; urgency=low - - * New upstream release - * Run dh_install with --list-missing - * Bump debhelper compat to 5 - * Remove extra x11-common dep from -dev package - * Version x11-common pre-dep in -dev package to be 1:7.0.0 to match the rest - of Debian and shut lintian up - * Bump standards version to 3.7.2.0 - * Don't look to install manpages for -dev package, there aren't any - - -- David Nusinow <dnusinow@debian.org> Mon, 3 Jul 2006 17:18:41 -0400 - -libsm (1:1.0.0-4) unstable; urgency=low - - * Reorder makeshlib command in rules file so that ldconfig is run - properly. Thanks Drew Parsons and Steve Langasek. - - -- David Nusinow <dnusinow@debian.org> Tue, 18 Apr 2006 21:49:55 -0400 - -libsm (1:1.0.0-3) unstable; urgency=low - - * Upload to unstable - - -- David Nusinow <dnusinow@debian.org> Thu, 23 Mar 2006 22:44:25 -0500 - -libsm (1:1.0.0-2) experimental; urgency=low - - * Provide versioned build depends for the X libs - - -- David Nusinow <dnusinow@debian.org> Thu, 23 Feb 2006 22:46:43 -0500 - -libsm (1:1.0.0-1) UNRLEASED; urgency=low - - * First upload to Debian - - -- David Nusinow <dnusinow@debian.org> Thu, 29 Dec 2005 20:47:53 -0500 - -libsm (1:6.0.4-4) breezy; urgency=low - - * Version the x11proto-core-dev build-dep to avoid _XOPEN_SOURCE. - - -- Adam Conrad <adconrad@ubuntu.com> Sun, 24 Jul 2005 10:42:00 +0000 - -libsm (1:6.0.4-3) breezy; urgency=low - - * Add libice-dev to libsm-dev Depends. - - -- Daniel Stone <daniel.stone@ubuntu.com> Thu, 21 Jul 2005 18:07:37 +1000 - -libsm (1:6.0.4-2) breezy; urgency=low - - * Fix Build-Depends-Indep vs B-D hilarity/stupidity. - - -- Daniel Stone <daniel.stone@ubuntu.com> Wed, 1 Jun 2005 00:34:43 +1000 - -libsm (1:6.0.4-1) breezy; urgency=low - - * First libsm release. - - -- Daniel Stone <daniel.stone@ubuntu.com> Mon, 16 May 2005 22:10:17 +1000 diff --git a/debian/compat b/debian/compat deleted file mode 100644 index 7ed6ff8..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -5 diff --git a/debian/control b/debian/control deleted file mode 100755 index 8224b7f..0000000 --- a/debian/control +++ /dev/null @@ -1,67 +0,0 @@ -Source: libsm -Section: x11 -Priority: optional -Maintainer: SooChan Lim <sc1.lim@samsung.com>, Sangjin Lee <lsj119@samsung.com>, Debian X Strike Force <debian-x@lists.debian.org> -Uploaders: SooChan Lim <sc1.lim@samsung.com>, David Nusinow <dnusinow@debian.org>, Brice Goglin <bgoglin@debian.org>, Julien Cristau <jcristau@debian.org> -Build-Depends: debhelper (>= 5.0.0), pkg-config, x11proto-core-dev (>= 6.8.99.15+cvs.20050722), xtrans-dev, libice-dev (>= 2:1.0.5), libuuid-dev, automake, libtool, xutils-dev (>= 1:7.4+4), quilt -Standards-Version: 3.8.3 -Vcs-Git: git://git.debian.org/git/pkg-xorg/lib/libsm -Vcs-Browser: http://git.debian.org/?p=pkg-xorg/lib/libsm.git - -Package: libsm6 -Section: libs -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: X11 Session Management library - This package provides the main interface to the X11 Session Management - library, which allows for applications to both manage sessions, and make use - of session managers to save and restore their state for later use. - . - More information about X.Org can be found at: - <URL:http://www.X.org> - <URL:http://xorg.freedesktop.org> - <URL:http://lists.freedesktop.org/mailman/listinfo/xorg> - . - This module can be found at - git://anongit.freedesktop.org/git/xorg/lib/libSM - -Package: libsm6-dbg -Section: debug -Architecture: any -Priority: extra -Depends: ${shlibs:Depends}, ${misc:Depends}, libsm6 (= ${binary:Version}) -Description: X11 Session Management library (debug package) - This package provides the main interface to the X11 Session Management - library, which allows for applications to both manage sessions, and make use - of session managers to save and restore their state for later use. - . - This package contains the debug versions of the library found in libsm6. - Non-developers likely have little use for this package. - . - More information about X.Org can be found at: - <URL:http://www.X.org> - <URL:http://xorg.freedesktop.org> - <URL:http://lists.freedesktop.org/mailman/listinfo/xorg> - . - This module can be found at - git://anongit.freedesktop.org/git/xorg/lib/libSM - -Package: libsm-dev -Section: libdevel -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, libsm6 (= ${binary:Version}), x11proto-core-dev, libice-dev (>= 1:1.0.0-1) -Description: X11 Session Management library (development headers) - This package provides the main interface to the X11 Session Management - library, which allows for applications to both manage sessions, and make use - of session managers to save and restore their state for later use. - . - This package contains the development headers for the library found in libsm6. - Non-developers likely have little use for this package. - . - More information about X.Org can be found at: - <URL:http://www.X.org> - <URL:http://xorg.freedesktop.org> - <URL:http://lists.freedesktop.org/mailman/listinfo/xorg> - . - This module can be found at - git://anongit.freedesktop.org/git/xorg/lib/libSM diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index ddc4be2..0000000 --- a/debian/copyright +++ /dev/null @@ -1,24 +0,0 @@ -This package was downloaded from -http://xorg.freedesktop.org/releases/individual/lib/ - -Copyright 1993, 1998 The Open Group - -Permission to use, copy, modify, distribute, and sell this software and its -documentation for any purpose is hereby granted without fee, provided that -the above copyright notice appear in all copies and that both that -copyright notice and this permission notice appear in supporting -documentation. - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Except as contained in this notice, the name of The Open Group shall not be -used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. diff --git a/debian/libsm-dev.install b/debian/libsm-dev.install deleted file mode 100755 index 2ff2802..0000000 --- a/debian/libsm-dev.install +++ /dev/null @@ -1,5 +0,0 @@ -usr/include/X11/* -usr/lib/libSM.a -usr/lib/libSM.la -usr/lib/libSM.so -usr/lib/pkgconfig/sm.pc diff --git a/debian/libsm6.install b/debian/libsm6.install deleted file mode 100644 index f6c0204..0000000 --- a/debian/libsm6.install +++ /dev/null @@ -1 +0,0 @@ -usr/lib/libSM.so.6* diff --git a/debian/patches/0001-sm.pc-don-t-export-a-dependency-on-ice.patch b/debian/patches/0001-sm.pc-don-t-export-a-dependency-on-ice.patch deleted file mode 100644 index 3347ef4..0000000 --- a/debian/patches/0001-sm.pc-don-t-export-a-dependency-on-ice.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 756399aa14618be0a8ac2e0a824356abf69cc466 Mon Sep 17 00:00:00 2001 -From: Julien Cristau <jcristau@debian.org> -Date: Fri, 18 Jul 2008 16:12:29 +0200 -Subject: [PATCH] sm.pc: don't export a dependency on ice - -use Requires.private for this ---- - sm.pc.in | 3 +-- - 1 files changed, 1 insertions(+), 2 deletions(-) - -diff --git a/sm.pc.in b/sm.pc.in -index ab1261e..aefc38c 100644 ---- a/sm.pc.in -+++ b/sm.pc.in -@@ -6,7 +6,6 @@ includedir=@includedir@ - Name: SM - Description: X Session Management Library - Version: @PACKAGE_VERSION@ --Requires: ice xproto --Requires.private: ice -+Requires.private: ice xproto - Cflags: -I${includedir} - Libs: -L${libdir} -lSM --- -1.5.6.2 - diff --git a/debian/patches/series b/debian/patches/series deleted file mode 100644 index 34b233e..0000000 --- a/debian/patches/series +++ /dev/null @@ -1 +0,0 @@ -0001-sm.pc-don-t-export-a-dependency-on-ice.patch diff --git a/debian/rules b/debian/rules deleted file mode 100755 index 58effb2..0000000 --- a/debian/rules +++ /dev/null @@ -1,112 +0,0 @@ -#!/usr/bin/make -f -# debian/rules for the Debian libxau package. -# Copyright © 2004 Scott James Remnant <scott@netsplit.com> -# Copyright © 2005 Daniel Stone <daniel@fooishbar.org> -# Copyright © 2005 David Nusinow <dnusinow@debian.org> - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -# set this to the name of the main shlib's binary package -PACKAGE = libsm6 - -include debian/xsfbs/xsfbs.mk - -CFLAGS = -Wall -g -ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) - CFLAGS += -O0 -else - CFLAGS += -O2 -endif -ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) - NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) - MAKEFLAGS += -j$(NUMJOBS) -endif - -DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) -DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) -ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) - confflags += --build=$(DEB_HOST_GNU_TYPE) -else - confflags += --build=$(DEB_HOST_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) -# confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) -endif - -confflags += --with-libuuid=no -#confflags += --with-libuuid - -.PHONY: autogen -autogen: autogen-stamp -autogen-stamp: -#autogen-stamp: $(STAMP_DIR)/patch - dh_testdir - autoreconf -vfi - >$@ - -obj-$(DEB_BUILD_GNU_TYPE)/config.status: autogen-stamp - dh_testdir - test -d obj-$(DEB_BUILD_GNU_TYPE) || mkdir obj-$(DEB_BUILD_GNU_TYPE) - cd obj-$(DEB_BUILD_GNU_TYPE) && \ - ../configure --prefix=/usr --mandir=\$${prefix}/share/man \ - --infodir=\$${prefix}/share/info $(confflags) \ - CFLAGS="$(CFLAGS)" - -.PHONY: build -build: build-stamp -build-stamp: obj-$(DEB_BUILD_GNU_TYPE)/config.status - dh_testdir - cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) - >$@ - -clean: xsfclean - dh_testdir - dh_testroot - rm -f autogen-stamp build-stamp - - rm -f config.cache config.log config.status - rm -f */config.cache */config.log */config.status - rm -f conftest* */conftest* - rm -rf autom4te.cache */autom4te.cache - rm -rf obj-* - rm -f $$(find -name Makefile.in) - rm -f compile config.guess config.sub configure depcomp install-sh - rm -f ltmain.sh missing INSTALL aclocal.m4 config.h.in - rm -f mkinstalldirs - - dh_clean - -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir - dh_testroot - -# dh_installdocs - dh_install --sourcedir=debian/tmp --list-missing - #dh_install --sourcedir=debian/tmp --list-missing --exclude=libSM.la -# dh_installchangelogs ChangeLog - dh_link - dh_strip --dbg-package=$(PACKAGE)-dbg - dh_compress - dh_fixperms - dh_makeshlibs - dh_shlibdeps - dh_installdeb - dh_gencontrol - dh_md5sums - dh_builddeb - -# Build architecture-independent files here. -binary-indep: build install -# Nothing to do - -binary: binary-indep binary-arch -.PHONY: clean binary-indep binary-arch binary install diff --git a/debian/watch b/debian/watch deleted file mode 100644 index d2e8274..0000000 --- a/debian/watch +++ /dev/null @@ -1,2 +0,0 @@ -version=3 -http://xorg.freedesktop.org/releases/individual/lib/ libSM-(.*)\.tar\.gz diff --git a/debian/xsfbs/repack.sh b/debian/xsfbs/repack.sh deleted file mode 100644 index 5935cc9..0000000 --- a/debian/xsfbs/repack.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -set -e - -if ! [ -d debian/prune ]; then - exit 0 -fi - -if [ "x$1" != x--upstream-version ]; then - exit 1 -fi - -version="$2" -filename="$3" - -if [ -z "$version" ] || ! [ -f "$filename" ]; then - exit 1 -fi - -dir="$(pwd)" -tempdir="$(mktemp -d)" - -cd "$tempdir" -tar xf "$dir/$filename" -cat "$dir"/debian/prune/* | while read file; do rm -f */$file; done - -tar czf "$dir/$filename" * -cd "$dir" -rm -rf "$tempdir" -echo "Done pruning upstream tarball" - -exit 0 diff --git a/debian/xsfbs/xsfbs.mk b/debian/xsfbs/xsfbs.mk deleted file mode 100644 index f0f8953..0000000 --- a/debian/xsfbs/xsfbs.mk +++ /dev/null @@ -1,293 +0,0 @@ -#!/usr/bin/make -f - -# Debian X Strike Force Build System (XSFBS): Make portion - -# Copyright 1996 Stephen Early -# Copyright 1997 Mark Eichin -# Copyright 1998-2005, 2007 Branden Robinson -# Copyright 2005 David Nusinow -# -# Licensed under the GNU General Public License, version 2. See the file -# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>. - -# Originally by Stephen Early <sde1000@debian.org> -# Modified by Mark W. Eichin <eichin@kitten.gen.ma.us> -# Modified by Adam Heath <doogie@debian.org> -# Modified by Branden Robinson <branden@debian.org> -# Modified by Fabio Massimo Di Nitto <fabbione@fabbione.net> -# Modified by David Nusinow <dnusinow@debian.org> -# Acknowledgements to Manoj Srivastava. - -# Pass $(DH_OPTIONS) into the environment for debhelper's benefit. -export DH_OPTIONS - -# force quilt to not use ~/.quiltrc and to use debian/patches -QUILT = QUILT_PATCHES=debian/patches quilt --quiltrc /dev/null - -# Set up parameters for the upstream build environment. - -# Determine (source) package name from Debian changelog. -SOURCE_NAME:=$(shell dpkg-parsechangelog -ldebian/changelog \ - | grep '^Source:' | awk '{print $$2}') - -# Determine package version from Debian changelog. -SOURCE_VERSION:=$(shell dpkg-parsechangelog -ldebian/changelog \ - | grep '^Version:' | awk '{print $$2}') - -# Determine upstream version number. -UPSTREAM_VERSION:=$(shell echo $(SOURCE_VERSION) | sed 's/-.*//') - -# Determine the source version without the epoch for make-orig-tar-gz -NO_EPOCH_VER:=$(shell echo $(UPSTREAM_VERSION) | sed 's/^.://') - -# Figure out who's building this package. -BUILDER:=$(shell echo $${DEBEMAIL:-$${EMAIL:-$$(echo $$LOGNAME@$$(cat /etc/mailname 2>/dev/null))}}) - -# Find out if this is an official build; an official build has nothing but -# digits, dots, and/or the codename of a release in the Debian part of the -# version number. Anything else indicates an unofficial build. -OFFICIAL_BUILD:=$(shell VERSION=$(SOURCE_VERSION); if ! expr "$$(echo $${VERSION\#\#*-} | sed 's/\(woody\|sarge\|etch\|lenny\)//g')" : ".*[^0-9.].*" >/dev/null 2>&1; then echo yes; fi) - -# Set up parameters for the Debian build environment. - -# Determine our architecture. -BUILD_ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH) -# Work around some old-time dpkg braindamage. -BUILD_ARCH:=$(subst i486,i386,$(BUILD_ARCH)) -# The DEB_HOST_ARCH variable may be set per the Debian cross-compilation policy. -ifdef DEB_HOST_ARCH - ARCH:=$(DEB_HOST_ARCH) -else - # dpkg-cross sets the ARCH environment variable; if set, use it. - ifdef ARCH - ARCH:=$(ARCH) - else - ARCH:=$(BUILD_ARCH) - endif -endif - -# $(STAMP_DIR) houses stamp files for complex targets. -STAMP_DIR:=stampdir - -# $(DEBTREEDIR) is where all install rules are told (via $(DESTDIR)) to place -# their files. -DEBTREEDIR:=$(CURDIR)/debian/tmp - -# All "important" targets have four lines: -# 1) A target name that is invoked by a package-building tool or the user. -# This consists of a dependency on a "$(STAMP_DIR)/"-prefixed counterpart. -# 2) A line delcaring 1) as a phony target (".PHONY:"). -# 3) A "$(STAMP_DIR)/"-prefixed target which does the actual work, and may -# depend on other targets. -# 4) A line declaring 3) as a member of the $(stampdir_targets) variable; the -# "$(STAMP_DIR)/" prefix is omitted. -# -# This indirection is needed so that the "stamp" files that signify when a rule -# is done can be located in a separate "stampdir". Recall that make has no way -# to know when a goal has been met for a phony target (like "build" or -# "install"). -# -# At the end of each "$(STAMP_DIR)/" target, be sure to run the command ">$@" -# so that the target will not be run again. Removing the file will make Make -# run the target over. - -# All phony targets should be declared as dependencies of .PHONY, even if they -# do not have "($STAMP_DIR)/"-prefixed counterparts. - -# Define a harmless default rule to keep things from going nuts by accident. -.PHONY: default -default: - -# Set up the $(STAMP_DIR) directory. -.PHONY: stampdir -stampdir_targets+=stampdir -stampdir: $(STAMP_DIR)/stampdir -$(STAMP_DIR)/stampdir: - mkdir $(STAMP_DIR) - >$@ - -# Set up the package build directory as quilt expects to find it. -.PHONY: prepare -stampdir_targets+=prepare -prepare: $(STAMP_DIR)/prepare -$(STAMP_DIR)/prepare: $(STAMP_DIR)/log $(STAMP_DIR)/genscripts - >$@ - -.PHONY: log -stampdir_targets+=log -log: $(STAMP_DIR)/log -$(STAMP_DIR)/log: $(STAMP_DIR)/stampdir - mkdir -p $(STAMP_DIR)/log - -# Apply all patches to the upstream source. -.PHONY: patch -stampdir_targets+=patch -patch: $(STAMP_DIR)/patch -$(STAMP_DIR)/patch: $(STAMP_DIR)/prepare - if ! [ `which quilt` ]; then \ - echo "Couldn't find quilt. Please install it or add it to the build-depends for this package."; \ - exit 1; \ - fi; \ - if $(QUILT) next >/dev/null 2>&1; then \ - echo -n "Applying patches..."; \ - if $(QUILT) push -a -v >$(STAMP_DIR)/log/patch 2>&1; then \ - cat $(STAMP_DIR)/log/patch; \ - echo "successful."; \ - else \ - cat $(STAMP_DIR)/log/patch; \ - echo "failed! (check $(STAMP_DIR)/log/patch for details)"; \ - exit 1; \ - fi; \ - else \ - echo "No patches to apply"; \ - fi; \ - >$@ - -# Revert all patches to the upstream source. -.PHONY: unpatch -unpatch: $(STAMP_DIR)/log - rm -f $(STAMP_DIR)/patch - @echo -n "Unapplying patches..."; \ - if $(QUILT) applied >/dev/null 2>/dev/null; then \ - if $(QUILT) pop -a -v >$(STAMP_DIR)/log/unpatch 2>&1; then \ - cat $(STAMP_DIR)/log/unpatch; \ - echo "successful."; \ - else \ - cat $(STAMP_DIR)/log/unpatch; \ - echo "failed! (check $(STAMP_DIR)/log/unpatch for details)"; \ - exit 1; \ - fi; \ - else \ - echo "nothing to do."; \ - fi - -# Clean the generated maintainer scripts. -.PHONY: cleanscripts -cleanscripts: - rm -f $(STAMP_DIR)/genscripts - rm -f debian/*.config \ - debian/*.postinst \ - debian/*.postrm \ - debian/*.preinst \ - debian/*.prerm - -# Clean the package build tree. -.PHONY: xsfclean -xsfclean: cleanscripts unpatch - dh_testdir - rm -rf .pc - rm -rf $(STAMP_DIR) $(SOURCE_DIR) - rm -rf imports - dh_clean debian/shlibs.local \ - debian/po/pothead - -# Generate the debconf templates POT file header. -debian/po/pothead: debian/po/pothead.in - sed -e 's/SOURCE_VERSION/$(SOURCE_VERSION)/' \ - -e 's/DATE/$(shell date "+%F %X%z"/)' <$< >$@ - -# Update POT and PO files. -.PHONY: updatepo -updatepo: debian/po/pothead - debian/scripts/debconf-updatepo --pot-header=pothead --verbose - -# Remove files from the upstream source tree that we don't need, or which have -# licensing problems. It must be run before creating the .orig.tar.gz. -# -# Note: This rule is for Debian package maintainers' convenience, and is not -# needed for conventional build scenarios. -.PHONY: prune-upstream-tree -prune-upstream-tree: - # Ensure we're in the correct directory. - dh_testdir - grep -rvh '^#' debian/prune/ | xargs --no-run-if-empty rm -rf - -# Verify that there are no offsets or fuzz in the patches we apply. -# -# Note: This rule is for Debian package maintainers' convenience, and is not -# needed for conventional build scenarios. -.PHONY: patch-audit -patch-audit: prepare unpatch - @echo -n "Auditing patches..."; \ - >$(STAMP_DIR)/log/patch; \ - FUZZY=; \ - while [ -n "$$($(QUILT) next)" ]; do \ - RESULT=$$($(QUILT) push -v | tee -a $(STAMP_DIR)/log/patch | grep ^Hunk | sed 's/^Hunk.*\(succeeded\|FAILED\).*/\1/');\ - case "$$RESULT" in \ - succeeded) \ - echo "fuzzy patch: $$($(QUILT) top)" \ - | tee -a $(STAMP_DIR)/log/$$($(QUILT) top); \ - FUZZY=yes; \ - ;; \ - FAILED) \ - echo "broken patch: $$($(QUILT) next)" \ - | tee -a $(STAMP_DIR)/log/$$($(QUILT) next); \ - exit 1; \ - ;; \ - esac; \ - done; \ - if [ -n "$$FUZZY" ]; then \ - echo "there were fuzzy patches; please fix."; \ - exit 1; \ - else \ - echo "done."; \ - fi - -# Generate the maintainer scripts. -.PHONY: genscripts -stampdir_targets+=genscripts -genscripts: $(STAMP_DIR)/genscripts -$(STAMP_DIR)/genscripts: $(STAMP_DIR)/stampdir - for FILE in debian/*.config.in \ - debian/*.postinst.in \ - debian/*.postrm.in \ - debian/*.preinst.in \ - debian/*.prerm.in; do \ - if [ -e "$$FILE" ]; then \ - MAINTSCRIPT=$$(echo $$FILE | sed 's/.in$$//'); \ - sed -n '1,/^#INCLUDE_SHELL_LIB#$$/p' <$$FILE \ - | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >$$MAINTSCRIPT.tmp; \ - cat debian/xsfbs/xsfbs.sh >>$$MAINTSCRIPT.tmp; \ - sed -n '/^#INCLUDE_SHELL_LIB#$$/,$$p' <$$FILE \ - | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >>$$MAINTSCRIPT.tmp; \ - sed -e 's/@SOURCE_VERSION@/$(SOURCE_VERSION)/' \ - -e 's/@OFFICIAL_BUILD@/$(OFFICIAL_BUILD)/' \ - -e 's/@DEFAULT_DCRESOLUTIONS@/$(DEFAULT_DCRESOLUTIONS)/' \ - <$$MAINTSCRIPT.tmp >$$MAINTSCRIPT; \ - rm $$MAINTSCRIPT.tmp; \ - fi; \ - done - # Validate syntax of generated shell scripts. - #sh debian/scripts/validate-posix-sh debian/*.config \ - # debian/*.postinst \ - # debian/*.postrm \ - # debian/*.preinst \ - # debian/*.prerm - >$@ - -# Generate the shlibs.local file. -debian/shlibs.local: - cat debian/*.shlibs >$@ - -SERVERMINVERS = $(shell cat /usr/share/xserver-xorg/serverminver 2>/dev/null) -VIDEOABI = $(shell cat /usr/share/xserver-xorg/videoabiver 2>/dev/null) -INPUTABI = $(shell cat /usr/share/xserver-xorg/inputabiver 2>/dev/null) -SERVER_DEPENDS = xserver-xorg-core (>= $(SERVERMINVERS)) -VIDDRIVER_PROVIDES = xserver-xorg-video-$(VIDEOABI) -INPDRIVER_PROVIDES = xserver-xorg-input-$(INPUTABI) -ifeq ($(PACKAGE),) -PACKAGE=$(shell awk '/^Package:/ { print $$2; exit }' < debian/control) -endif - -.PHONY: serverabi -serverabi: install -ifeq ($(SERVERMINVERS),) - @echo error: xserver-xorg-dev needs to be installed - @exit 1 -else - echo "xserver:Depends=$(SERVER_DEPENDS)" >> debian/$(PACKAGE).substvars - echo "xviddriver:Provides=$(VIDDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars - echo "xinpdriver:Provides=$(INPDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars -endif - -# vim:set noet ai sts=8 sw=8 tw=0: diff --git a/debian/xsfbs/xsfbs.sh b/debian/xsfbs/xsfbs.sh deleted file mode 100644 index 781826f..0000000 --- a/debian/xsfbs/xsfbs.sh +++ /dev/null @@ -1,853 +0,0 @@ -# $Id$ - -# This is the X Strike Force shell library for X Window System package -# maintainer scripts. It serves to define shell functions commonly used by -# such packages, and performs some error checking necessary for proper operation -# of those functions. By itself, it does not "do" much; the maintainer scripts -# invoke the functions defined here to accomplish package installation and -# removal tasks. - -# If you are reading this within a Debian package maintainer script (e.g., -# /var/lib/dpkg)info/PACKAGE.{config,preinst,postinst,prerm,postrm}), you can -# skip past this library by scanning forward in this file to the string -# "GOBSTOPPER". - -SOURCE_VERSION=@SOURCE_VERSION@ -OFFICIAL_BUILD=@OFFICIAL_BUILD@ - -# Use special abnormal exit codes so that problems with this library are more -# easily tracked down. -SHELL_LIB_INTERNAL_ERROR=86 -SHELL_LIB_THROWN_ERROR=74 -SHELL_LIB_USAGE_ERROR=99 - -# old -> new variable names -if [ -z "$DEBUG_XORG_PACKAGE" ] && [ -n "$DEBUG_XFREE86_PACKAGE" ]; then - DEBUG_XORG_PACKAGE="$DEBUG_XFREE86_PACKAGE" -fi -if [ -z "$DEBUG_XORG_DEBCONF" ] && [ -n "$DEBUG_XFREE86_DEBCONF" ]; then - DEBUG_XORG_DEBCONF="$DEBUG_XFREE86_DEBCONF" -fi - -# initial sanity checks -if [ -z "$THIS_PACKAGE" ]; then - cat >&2 <<EOF -Error: package maintainer script attempted to use shell library without -definining \$THIS_PACKAGE shell variable. Please report the package name, -version, and the text of this error message to the Debian Bug Tracking System. -Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for -instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the -"doc-debian" package, or install the "reportbug" package and use the command of -the same name to file a report against version $SOURCE_VERSION of this package. -EOF - exit $SHELL_LIB_USAGE_ERROR -fi - -if [ -z "$THIS_SCRIPT" ]; then - cat >&2 <<EOF -Error: package maintainer script attempted to use shell library without -definining \$THIS_SCRIPT shell variable. Please report the package name, -version, and the text of this error message to the Debian Bug Tracking System. -Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for -instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the -"doc-debian" package, or install the "reportbug" package and use the command of -the same name to file a report against version $SOURCE_VERSION of the -"$THIS_PACKAGE" package. -EOF - exit $SHELL_LIB_USAGE_ERROR -fi - -if [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then - RECONFIGURE="true" -else - RECONFIGURE= -fi - -if ([ "$1" = "install" ] || [ "$1" = "configure" ]) && [ -z "$2" ]; then - FIRSTINST="yes" -fi - -if [ -z "$RECONFIGURE" ] && [ -z "$FIRSTINST" ]; then - UPGRADE="yes" -fi - -trap "message;\ - message \"Received signal. Aborting $THIS_PACKAGE package $THIS_SCRIPT script.\";\ - message;\ - exit 1" HUP INT QUIT TERM - -reject_nondigits () { - # syntax: reject_nondigits [ operand ... ] - # - # scan operands (typically shell variables whose values cannot be trusted) for - # characters other than decimal digits and barf if any are found - while [ -n "$1" ]; do - # does the operand contain anything but digits? - if ! expr "$1" : "[[:digit:]]\+$" > /dev/null 2>&1; then - # can't use die(), because it wraps message() which wraps this function - echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_nondigits() encountered" \ - "possibly malicious garbage \"$1\"" >&2 - exit $SHELL_LIB_THROWN_ERROR - fi - shift - done -} - -reject_whitespace () { - # syntax: reject_whitespace [ operand ] - # - # scan operand (typically a shell variable whose value cannot be trusted) for - # whitespace characters and barf if any are found - if [ -n "$1" ]; then - # does the operand contain any whitespace? - if expr "$1" : "[[:space:]]" > /dev/null 2>&1; then - # can't use die(), because I want to avoid forward references - echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_whitespace() encountered" \ - "possibly malicious garbage \"$1\"" >&2 - exit $SHELL_LIB_THROWN_ERROR - fi - fi -} - -reject_unlikely_path_chars () { - # syntax: reject_unlikely_path_chars [ operand ... ] - # - # scan operands (typically shell variables whose values cannot be trusted) for - # characters unlikely to be seen in a path and which the shell might - # interpret and barf if any are found - while [ -n "$1" ]; do - # does the operand contain any funny characters? - if expr "$1" : '.*[!$&()*;<>?|].*' > /dev/null 2>&1; then - # can't use die(), because I want to avoid forward references - echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_unlikely_path_chars()" \ - "encountered possibly malicious garbage \"$1\"" >&2 - exit $SHELL_LIB_THROWN_ERROR - fi - shift - done -} - -# Query the terminal to establish a default number of columns to use for -# displaying messages to the user. This is used only as a fallback in the -# event the COLUMNS variable is not set. ($COLUMNS can react to SIGWINCH while -# the script is running, and this cannot, only being calculated once.) -DEFCOLUMNS=$(stty size 2> /dev/null | awk '{print $2}') || true -if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" > /dev/null 2>&1; then - DEFCOLUMNS=80 -fi - -message () { - # pretty-print messages of arbitrary length - reject_nondigits "$COLUMNS" - echo "$*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} >&2 -} - -observe () { - # syntax: observe message ... - # - # issue observational message suitable for logging someday when support for - # it exists in dpkg - if [ -n "$DEBUG_XORG_PACKAGE" ]; then - message "$THIS_PACKAGE $THIS_SCRIPT note: $*" - fi -} - -warn () { - # syntax: warn message ... - # - # issue warning message suitable for logging someday when support for - # it exists in dpkg; also send to standard error - message "$THIS_PACKAGE $THIS_SCRIPT warning: $*" -} - -die () { - # syntax: die message ... - # - # exit script with error message - message "$THIS_PACKAGE $THIS_SCRIPT error: $*" - exit $SHELL_LIB_THROWN_ERROR -} - -internal_error () { - # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message - message "internal error: $*" - if [ -n "$OFFICIAL_BUILD" ]; then - message "Please report a bug in the $THIS_SCRIPT script of the" \ - "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \ - "Tracking System. Include all messages above that mention the" \ - "$THIS_PACKAGE package. Visit " \ - "<http://www.debian.org/Bugs/Reporting> on the World Wide Web for" \ - "instructions, read the file" \ - "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \ - "package, or install the reportbug package and use the command of" \ - "the same name to file a report." - fi - exit $SHELL_LIB_INTERNAL_ERROR -} - -usage_error () { - message "usage error: $*" - message "Please report a bug in the $THIS_SCRIPT script of the" \ - "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \ - "Tracking System. Include all messages above that mention the" \ - "$THIS_PACKAGE package. Visit " \ - "<http://www.debian.org/Bugs/Reporting> on the World Wide Web for" \ - "instructions, read the file" \ - "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \ - "package, or install the reportbug package and use the command of" \ - "the same name to file a report." - exit $SHELL_LIB_USAGE_ERROR -} - - -maplink () { - # returns what symlink should point to; i.e., what the "sane" answer is - # Keep this in sync with the debian/*.links files. - # This is only needed for symlinks to directories. - # - # XXX: Most of these look wrong in the X11R7 world and need to be fixed. - # If we've stopped using this function, fixing it might enable us to re-enable - # it again and catch more errors. - case "$1" in - /etc/X11/xkb/compiled) echo /var/lib/xkb ;; - /etc/X11/xkb/xkbcomp) echo /usr/X11R6/bin/xkbcomp ;; - /usr/X11R6/lib/X11/app-defaults) echo /etc/X11/app-defaults ;; - /usr/X11R6/lib/X11/fs) echo /etc/X11/fs ;; - /usr/X11R6/lib/X11/lbxproxy) echo /etc/X11/lbxproxy ;; - /usr/X11R6/lib/X11/proxymngr) echo /etc/X11/proxymngr ;; - /usr/X11R6/lib/X11/rstart) echo /etc/X11/rstart ;; - /usr/X11R6/lib/X11/twm) echo /etc/X11/twm ;; - /usr/X11R6/lib/X11/xdm) echo /etc/X11/xdm ;; - /usr/X11R6/lib/X11/xinit) echo /etc/X11/xinit ;; - /usr/X11R6/lib/X11/xkb) echo /etc/X11/xkb ;; - /usr/X11R6/lib/X11/xserver) echo /etc/X11/xserver ;; - /usr/X11R6/lib/X11/xsm) echo /etc/X11/xsm ;; - /usr/bin/X11) echo ../X11R6/bin ;; - /usr/bin/rstartd) echo ../X11R6/bin/rstartd ;; - /usr/include/X11) echo ../X11R6/include/X11 ;; - /usr/lib/X11) echo ../X11R6/lib/X11 ;; - *) internal_error "maplink() called with unknown path \"$1\"" ;; - esac -} - -analyze_path () { - # given a supplied set of pathnames, break each one up by directory and do an - # ls -dl on each component, cumulatively; i.e. - # analyze_path /usr/X11R6/bin -> ls -dl /usr /usr/X11R6 /usr/X11R6/bin - # Thanks to Randolph Chung for this clever hack. - - local f g - - while [ -n "$1" ]; do - reject_whitespace "$1" - g= - message "Analyzing $1:" - for f in $(echo "$1" | tr / \ ); do - if [ -e /$g$f ]; then - ls -dl /$g$f /$g$f.dpkg-* 2> /dev/null || true - g=$g$f/ - else - message "/$g$f: nonexistent; directory contents of /$g:" - ls -l /$g - break - fi - done - shift - done -} - -find_culprits () { - local f p dpkg_info_dir possible_culprits smoking_guns bad_packages package \ - msg - - reject_whitespace "$1" - message "Searching for overlapping packages..." - dpkg_info_dir=/var/lib/dpkg/info - if [ -d $dpkg_info_dir ]; then - if [ "$(echo $dpkg_info_dir/*.list)" != "$dpkg_info_dir/*.list" ]; then - possible_culprits=$(ls -1 $dpkg_info_dir/*.list | egrep -v \ - "(xbase-clients|x11-common|xfs|xlibs)") - if [ -n "$possible_culprits" ]; then - smoking_guns=$(grep -l "$1" $possible_culprits || true) - if [ -n "$smoking_guns" ]; then - bad_packages=$(printf "\\n") - for f in $smoking_guns; do - # too bad you can't nest parameter expansion voodoo - p=${f%*.list} # strip off the trailing ".list" - package=${p##*/} # strip off the directories - bad_packages=$(printf "%s\n%s" "$bad_packages" "$package") - done - msg=$(cat <<EOF -The following packages appear to have file overlaps with the X.Org packages; -these packages are either very old, or in violation of Debian Policy. Try -upgrading each of these packages to the latest available version if possible: -for example, with the command "apt-get install". If no newer version of a -package is available, you will have to remove it; for example, with the command -"apt-get remove". If even the latest available version of the package has -this file overlap, please file a bug against that package with the Debian Bug -Tracking System. You may want to refer the package maintainer to section 12.8 -of the Debian Policy manual. -EOF -) - message "$msg" - message "The overlapping packages are: $bad_packages" - else - message "no overlaps found." - fi - fi - else - message "cannot search; no matches for $dpkg_info_dir/*.list." - fi - else - message "cannot search; $dpkg_info_dir does not exist." - fi -} - -check_symlink () { - # syntax: check_symlink symlink - # - # See if specified symlink points where it is supposed to. Return 0 if it - # does, and 1 if it does not. - # - # Primarily used by check_symlinks_and_warn() and check_symlinks_and_bomb(). - - local symlink - - # validate arguments - if [ $# -ne 1 ]; then - usage_error "check_symlink() called with wrong number of arguments;" \ - "expected 1, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - symlink="$1" - - if [ "$(maplink "$symlink")" = "$(readlink "$symlink")" ]; then - return 0 - else - return 1 - fi -} - -check_symlinks_and_warn () { - # syntax: check_symlinks_and_warn symlink ... - # - # For each argument, check for symlink sanity, and warn if it isn't sane. - # - # Call this function from a preinst script in the event $1 is "upgrade" or - # "install". - - local errmsg symlink - - # validate arguments - if [ $# -lt 1 ]; then - usage_error "check_symlinks_and_warn() called with wrong number of" \ - "arguments; expected at least 1, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - while [ -n "$1" ]; do - symlink="$1" - if [ -L "$symlink" ]; then - if ! check_symlink "$symlink"; then - observe "$symlink symbolic link points to wrong location" \ - "$(readlink "$symlink"); removing" - rm "$symlink" - fi - elif [ -e "$symlink" ]; then - errmsg="$symlink exists and is not a symbolic link; this package cannot" - errmsg="$errmsg be installed until this" - if [ -f "$symlink" ]; then - errmsg="$errmsg file" - elif [ -d "$symlink" ]; then - errmsg="$errmsg directory" - else - errmsg="$errmsg thing" - fi - errmsg="$errmsg is removed" - die "$errmsg" - fi - shift - done -} - -check_symlinks_and_bomb () { - # syntax: check_symlinks_and_bomb symlink ... - # - # For each argument, check for symlink sanity, and bomb if it isn't sane. - # - # Call this function from a postinst script. - - local problem symlink - - # validate arguments - if [ $# -lt 1 ]; then - usage_error "check_symlinks_and_bomb() called with wrong number of" - "arguments; expected at least 1, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - while [ -n "$1" ]; do - problem= - symlink="$1" - if [ -L "$symlink" ]; then - if ! check_symlink "$symlink"; then - problem=yes - warn "$symlink symbolic link points to wrong location" \ - "$(readlink "$symlink")" - fi - elif [ -e "$symlink" ]; then - problem=yes - warn "$symlink is not a symbolic link" - else - problem=yes - warn "$symlink symbolic link does not exist" - fi - if [ -n "$problem" ]; then - analyze_path "$symlink" "$(readlink "$symlink")" - find_culprits "$symlink" - die "bad symbolic links on system" - fi - shift - done -} - -font_update () { - # run $UPDATECMDS in $FONTDIRS - - local dir cmd shortcmd x_font_dir_prefix - - x_font_dir_prefix="/usr/share/fonts/X11" - - if [ -z "$UPDATECMDS" ]; then - usage_error "font_update() called but \$UPDATECMDS not set" - fi - if [ -z "$FONTDIRS" ]; then - usage_error "font_update() called but \$FONTDIRS not set" - fi - - reject_unlikely_path_chars "$UPDATECMDS" - reject_unlikely_path_chars "$FONTDIRS" - - for dir in $FONTDIRS; do - if [ -d "$x_font_dir_prefix/$dir" ]; then - for cmd in $UPDATECMDS; do - if which "$cmd" > /dev/null 2>&1; then - shortcmd=${cmd##*/} - observe "running $shortcmd in $dir font directory" - cmd_opts= - if [ "$shortcmd" = "update-fonts-alias" ]; then - cmd_opts=--x11r7-layout - fi - if [ "$shortcmd" = "update-fonts-dir" ]; then - cmd_opts=--x11r7-layout - fi - if [ "$shortcmd" = "update-fonts-scale" ]; then - cmd_opts=--x11r7-layout - fi - $cmd $cmd_opts $dir || warn "$cmd $cmd_opts $dir" \ - "failed; font directory data may not" \ - "be up to date" - else - warn "$cmd not found; not updating corresponding $dir font" \ - "directory data" - fi - done - else - warn "$dir is not a directory; not updating font directory data" - fi - done -} - -remove_conffile_prepare () { - # syntax: remove_conffile_prepare filename official_md5sum ... - # - # Check a conffile "filename" against a list of canonical MD5 checksums. - # If the file's current MD5 checksum matches one of the "official_md5sum" - # operands provided, then prepare the conffile for removal from the system. - # We defer actual deletion until the package is configured so that we can - # roll this operation back if package installation fails. - # - # Call this function from a preinst script in the event $1 is "upgrade" or - # "install" and verify $2 to ensure the package is being upgraded from a - # version (or installed over a version removed-but-not-purged) prior to the - # one in which the conffile was obsoleted. - - local conffile current_checksum - - # validate arguments - if [ $# -lt 2 ]; then - usage_error "remove_conffile_prepare() called with wrong number of" \ - "arguments; expected at least 2, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - conffile="$1" - shift - - # does the conffile even exist? - if [ -e "$conffile" ]; then - # calculate its checksum - current_checksum=$(md5sum < "$conffile" | sed 's/[[:space:]].*//') - # compare it to each supplied checksum - while [ -n "$1" ]; do - if [ "$current_checksum" = "$1" ]; then - # we found a match; move the confffile and stop looking - observe "preparing obsolete conffile $conffile for removal" - mv "$conffile" "$conffile.$THIS_PACKAGE-tmp" - break - fi - shift - done - fi -} - -remove_conffile_lookup () { - # syntax: remove_conffile_lookup package filename - # - # Lookup the md5sum of a conffile in dpkg's database, and prepare for removal - # if it matches the actual file's md5sum. - # - # Call this function when you would call remove_conffile_prepare but only - # want to check against dpkg's status database instead of known checksums. - - local package conffile old_md5sum - - # validate arguments - if [ $# -ne 2 ]; then - usage_error "remove_conffile_lookup() called with wrong number of" \ - "arguments; expected 1, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - package="$1" - conffile="$2" - - if ! [ -e "$conffile" ]; then - return - fi - old_md5sum="$(dpkg-query -W -f='${Conffiles}' "$package" | \ - awk '{ if (match($0, "^ '"$conffile"' ")) print $2}')" - if [ -n "$old_md5sum" ]; then - remove_conffile_prepare "$conffile" "$old_md5sum" - fi -} - -remove_conffile_commit () { - # syntax: remove_conffile_commit filename - # - # Complete the removal of a conffile "filename" that has become obsolete. - # - # Call this function from a postinst script after having used - # remove_conffile_prepare() in the preinst. - - local conffile - - # validate arguments - if [ $# -ne 1 ]; then - usage_error "remove_conffile_commit() called with wrong number of" \ - "arguments; expected 1, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - conffile="$1" - - # if the temporary file created by remove_conffile_prepare() exists, remove it - if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then - observe "committing removal of obsolete conffile $conffile" - rm "$conffile.$THIS_PACKAGE-tmp" - fi -} - -remove_conffile_rollback () { - # syntax: remove_conffile_rollback filename - # - # Roll back the removal of a conffile "filename". - # - # Call this function from a postrm script in the event $1 is "abort-upgrade" - # or "abort-install" is after having used remove_conffile_prepare() in the - # preinst. - - local conffile - - # validate arguments - if [ $# -ne 1 ]; then - usage_error "remove_conffile_rollback() called with wrong number of" \ - "arguments; expected 1, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - conffile="$1" - - # if the temporary file created by remove_conffile_prepare() exists, move it - # back - if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then - observe "rolling back removal of obsolete conffile $conffile" - mv "$conffile.$THIS_PACKAGE-tmp" "$conffile" - fi -} - -replace_conffile_with_symlink_prepare () { - # syntax: replace_conffile_with_symlink_prepare oldfilename newfilename \ - # official_md5sum ... - # - # Check a conffile "oldfilename" against a list of canonical MD5 checksums. - # If the file's current MD5 checksum matches one of the "official_md5sum" - # operands provided, then prepare the conffile for removal from the system. - # We defer actual deletion until the package is configured so that we can - # roll this operation back if package installation fails. Otherwise copy it - # to newfilename and let dpkg handle it through conffiles mechanism. - # - # Call this function from a preinst script in the event $1 is "upgrade" or - # "install" and verify $2 to ensure the package is being upgraded from a - # version (or installed over a version removed-but-not-purged) prior to the - # one in which the conffile was obsoleted. - - local conffile current_checksum - - # validate arguments - if [ $# -lt 3 ]; then - usage_error "replace_conffile_with_symlink_prepare() called with wrong" \ - " number of arguments; expected at least 3, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - oldconffile="$1" - shift - newconffile="$1" - shift - - remove_conffile_prepare "$_oldconffile" "$@" - # If $oldconffile still exists, then md5sums didn't match. - # Copy it to new one. - if [ -f "$oldconffile" ]; then - cp "$oldconffile" "$newconffile" - fi - -} - -replace_conffile_with_symlink_commit () { - # syntax: replace_conffile_with_symlink_commit oldfilename - # - # Complete the removal of a conffile "oldfilename" that has been - # replaced by a symlink. - # - # Call this function from a postinst script after having used - # replace_conffile_with_symlink_prepare() in the preinst. - - local conffile - - # validate arguments - if [ $# -ne 1 ]; then - usage_error "replace_conffile_with_symlink_commit() called with wrong" \ - "number of arguments; expected 1, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - conffile="$1" - - remove_conffile_commit "$conffile" -} - -replace_conffile_with_symlink_rollback () { - # syntax: replace_conffile_with_symlink_rollback oldfilename newfilename - # - # Roll back the replacing of a conffile "oldfilename" with symlink to - # "newfilename". - # - # Call this function from a postrm script in the event $1 is "abort-upgrade" - # or "abort-install" and verify $2 to ensure the package failed to upgrade - # from a version (or install over a version removed-but-not-purged) prior - # to the one in which the conffile was obsoleted. - # You should have used replace_conffile_with_symlink_prepare() in the - # preinst. - - local conffile - - # validate arguments - if [ $# -ne 2 ]; then - usage_error "replace_conffile_with_symlink_rollback() called with wrong" \ - "number of arguments; expected 2, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - oldconffile="$1" - newconffile="$2" - - remove_conffile_rollback "$_oldconffile" - if [ -f "$newconffile" ]; then - rm "$newconffile" - fi -} - -run () { - # syntax: run command [ argument ... ] - # - # Run specified command with optional arguments and report its exit status. - # Useful for commands whose exit status may be nonzero, but still acceptable, - # or commands whose failure is not fatal to us. - # - # NOTE: Do *not* use this function with db_get or db_metaget commands; in - # those cases the return value of the debconf command *must* be checked - # before the string returned by debconf is used for anything. - - local retval - - # validate arguments - if [ $# -lt 1 ]; then - usage_error "run() called with wrong number of arguments; expected at" \ - "least 1, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - "$@" || retval=$? - - if [ ${retval:-0} -ne 0 ]; then - observe "command \"$*\" exited with status $retval" - fi -} - -make_symlink_sane () { - # syntax: make_symlink_sane symlink target - # - # Ensure that the symbolic link symlink exists, and points to target. - # - # If symlink does not exist, create it and point it at target. - # - # If symlink exists but is not a symbolic link, back it up. - # - # If symlink exists, is a symbolic link, but points to the wrong location, fix - # it. - # - # If symlink exists, is a symbolic link, and already points to target, do - # nothing. - # - # This function wouldn't be needed if ln had an -I, --idempotent option. - - # Validate arguments. - if [ $# -ne 2 ]; then - usage_error "make_symlink_sane() called with wrong number of arguments;" \ - "expected 2, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - # We could just use the positional parameters as-is, but that makes things - # harder to follow. - local symlink target - - symlink="$1" - target="$2" - - if [ -L "$symlink" ] && [ "$(readlink "$symlink")" = "$target" ]; then - observe "link from $symlink to $target already exists" - else - observe "creating symbolic link from $symlink to $target" - mkdir -p "${target%/*}" "${symlink%/*}" - ln -s -b -S ".dpkg-old" "$target" "$symlink" - fi -} - -migrate_dir_to_symlink () { - # syntax: migrate_dir_to_symlink old_location new_location - # - # Per Debian Policy section 6.5.4, "A directory will never be replaced by a - # symbolic link to a directory or vice versa; instead, the existing state - # (symlink or not) will be left alone and dpkg will follow the symlink if - # there is one." - # - # We have to do it ourselves. - # - # This function moves the contents of old_location, a directory, into - # new_location, a directory, then makes old_location a symbolic link to - # new_location. - # - # old_location need not exist, but if it does, it must be a directory (or a - # symlink to a directory). If it is not, it is backed up. If new_location - # exists already and is not a directory, it is backed up. - # - # This function should be called from a package's preinst so that other - # packages unpacked after this one --- but before this package's postinst runs - # --- are unpacked into new_location even if their payloads contain - # old_location filespecs. - - # Validate arguments. - if [ $# -ne 2 ]; then - usage_error "migrate_dir_to_symlink() called with wrong number of" - "arguments; expected 2, got $#" - exit $SHELL_LIB_USAGE_ERROR - fi - - # We could just use the positional parameters as-is, but that makes things - # harder to follow. - local new old - - old="$1" - new="$2" - - # Is old location a symlink? - if [ -L "$old" ]; then - # Does it already point to new location? - if [ "$(readlink "$old")" = "$new" ]; then - # Nothing to do; migration has already been done. - observe "migration of $old to $new already done" - return 0 - else - # Back it up. - warn "backing up symbolic link $old as $old.dpkg-old" - mv -b "$old" "$old.dpkg-old" - fi - fi - - # Does old location exist, but is not a directory? - if [ -e "$old" ] && ! [ -d "$old" ]; then - # Back it up. - warn "backing up non-directory $old as $old.dpkg-old" - mv -b "$old" "$old.dpkg-old" - fi - - observe "migrating $old to $new" - - # Is new location a symlink? - if [ -L "$new" ]; then - # Does it point the wrong way, i.e., back to where we're migrating from? - if [ "$(readlink "$new")" = "$old" ]; then - # Get rid of it. - observe "removing symbolic link $new which points to $old" - rm "$new" - else - # Back it up. - warn "backing up symbolic link $new as $new.dpkg-old" - mv -b "$new" "$new.dpkg-old" - fi - fi - - # Does new location exist, but is not a directory? - if [ -e "$new" ] && ! [ -d "$new" ]; then - warn "backing up non-directory $new as $new.dpkg-old" - mv -b "$new" "$new.dpkg-old" - fi - - # Create new directory if it does not yet exist. - if ! [ -e "$new" ]; then - observe "creating $new" - mkdir -p "$new" - fi - - # Copy files in old location to new location. Back up any filenames that - # already exist in the new location with the extension ".dpkg-old". - observe "copying files from $old to $new" - if ! (cd "$old" && cp -a -b -S ".dpkg-old" . "$new"); then - die "error(s) encountered while copying files from $old to $new" - fi - - # Remove files at old location. - observe "removing $old" - rm -r "$old" - - # Create symlink from old location to new location. - make_symlink_sane "$old" "$new" -} - -# vim:set ai et sw=2 ts=2 tw=80: - -# GOBSTOPPER: The X Strike Force shell library ends here. diff --git a/doc/Makefile.am b/doc/Makefile.am old mode 100755 new mode 100644 index 12a3c6e..d8a2ad0 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,64 +1,13 @@ -# -# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. -# if ENABLE_DOCS -doc_sources = SMlib.xml xsmp.xml -dist_doc_DATA = $(doc_sources) -if HAVE_XMLTO -doc_DATA = $(doc_sources:.xml=.html) +# Main DocBook/XML files (DOCTYPE book) +docbook = SMlib.xml xsmp.xml -if HAVE_FOP -doc_DATA += $(doc_sources:.xml=.ps) $(doc_sources:.xml=.pdf) -endif +# The location where the DocBook/XML files and their generated formats are installed +shelfdir = $(docdir) -if HAVE_XMLTO_TEXT -doc_DATA += $(doc_sources:.xml=.txt) -endif +# Generate DocBook/XML output formats with or without stylesheets +include $(top_srcdir)/docbook.am -if HAVE_STYLESHEETS -XMLTO_FLAGS = -m $(XSL_STYLESHEET) - -doc_DATA += xorg.css -xorg.css: $(STYLESHEET_SRCDIR)/xorg.css - $(AM_V_GEN)cp -pf $(STYLESHEET_SRCDIR)/xorg.css $@ -endif - -CLEANFILES = $(doc_DATA) - -SUFFIXES = .xml .ps .pdf .txt .html - -.xml.txt: - $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) txt $< - -.xml.html: - $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) xhtml-nochunks $< - -.xml.pdf: - $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) --with-fop pdf $< - -.xml.ps: - $(AM_V_GEN)$(XMLTO) $(XMLTO_FLAGS) --with-fop ps $< - -endif HAVE_XMLTO endif ENABLE_DOCS diff --git a/doc/SMlib.xml b/doc/SMlib.xml old mode 100755 new mode 100644 index fd84f1a..43579f9 --- a/doc/SMlib.xml +++ b/doc/SMlib.xml @@ -1,28 +1,29 @@ <?xml version="1.0" encoding="UTF-8" ?> -<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" - "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"> +<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" + "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" +[ +<!ENTITY % defs SYSTEM "defs.ent"> %defs; +]> <!-- lifted from troff+ms+XMan by doclifter --> -<book id="smlibms"> +<book id="SMlib"> <bookinfo> <title>X Session Management Library X Consortium Standard - X Version 11, Release 6.4 + X Version 11, Release &fullrelvers; RalphMor + X Consortium - X Consortium Standard 19931994 X Consortium Version 1.0 - X Consortium - X Version 11, Release 7 @@ -64,7 +65,7 @@ X Window System is a trademark of The Open Group. - + Overview of Session Management @@ -96,7 +97,7 @@ displays at all. - + The Session Management Library @@ -149,7 +150,7 @@ chance to interact with the user and cancel the shutdown. - + Understanding SMlib's Dependence on ICE @@ -163,8 +164,8 @@ knowledge of how the ICE library works. The ICE library utilizes callbacks to process messages. When a client detects that there is data to read on an ICE connection, it should -call the IceProcessMessages function. -IceProcessMessages will read the message header +call the IceProcessMessages function. +IceProcessMessages will read the message header and look at the major opcode in order to determine which protocol the message was intended for. The appropriate protocol library will then be triggered to unpack the message and hand it off to the client via a @@ -177,7 +178,7 @@ have some code that detects when there is data to read on an ICE connection. This can be done via a select call on the file descriptor for the ICE connection, but more typically, XtAppAddInput will be used to register -a callback that will invoke IceProcessMessages +a callback that will invoke IceProcessMessages each time there is data to read on the ICE connection. @@ -185,9 +186,9 @@ each time there is data to read on the ICE connection. To further complicate things, knowing which file descriptors to call select on requires an understanding of how ICE connections are created. On the client side, a call must be made -to SmcOpenConnection in order to open a connection -with a session manager. SmcOpenConnection will -internally makea call into IceOpenConnection +to in order to open a connection +with a session manager. will +internally makea call into IceOpenConnection which will, in turn, determine if an ICE connection already exists between the client and session manager. Most likely, a connection will not already exist and a new ICE connection will be created. The @@ -204,9 +205,9 @@ the list of descriptors to call select on. On the session manager side, things work a bit differently. The session manager has complete control over the creation of ICE connections. The session manager has to first -call IceListenForConnections in order to start +call IceListenForConnections in order to start listening for connections from clients. Once a connection attempt is -detected, IceAcceptConnection must be called, and +detected, IceAcceptConnection must be called, and the session manager can simply add the new ICE file descriptor to the list of descriptors to call select on. @@ -219,7 +220,7 @@ standard. - + Header Files and Library Name @@ -238,7 +239,7 @@ SMlib and ICElib by using - + Session Management Client (<acronym>Smc</acronym>) Functions @@ -257,15 +258,15 @@ SMlib and ICElib by using - - Connecting to the Session Manager + +Connecting to the Session Manager To open a connection with a session manager, -use SmcOpenConnection +use - + SmcConn SmcOpenConnection char *network_ids_list @@ -348,26 +349,23 @@ is NULL, the value of the SESSION_MANAGER environment variable will be used. Each network ID has the following format: - - - - - + + + + + - - tcp/<hostname>:<portnumber> - or + tcp/<hostname>:<portnumber> + or - - decnet/<hostname>::<objname> - or + decnet/<hostname>::<objname> + or - - local/<hostname>:<path> - + local/<hostname>:<path> + @@ -380,7 +378,7 @@ an attempt will be made using the second network ID, and so on. -After the connection is established, SmcOpenConnection +After the connection is established, registers the client with the session manager. If the client is being restarted from a previous session, previous_id should contain a null terminated string representing the client ID from the @@ -392,12 +390,12 @@ client with previous_id set to NULL. -If SmcOpenConnection succeeds, it returns an +If succeeds, it returns an opaque connection pointer of type SmcConn and the client_id_ret argument contains the client ID to be used for this session. The client_id_ret should be freed with a call to free when no longer needed. On -failure, SmcOpenConnection returns +failure, returns NULL, and the reason for failure is returned in error_string_ret. @@ -420,12 +418,12 @@ context associated with it. As previously discussed -(section 3, +(section 3, “Understanding SMlib's Dependence on ICE”), the client will have to keep track of when ICE connections are created or -destroyed (using IceAddConnectionWatch -and IceRemoveConnectionWatch and will have to -call IceProcessMessages each time +destroyed (using IceAddConnectionWatch +and IceRemoveConnectionWatch and will have to +call IceProcessMessages each time a select shows that there is data to read on an ICE connection. For further information, see the Inter-Client Exchange Library @@ -485,14 +483,14 @@ typedef struct { } SmcCallbacks; - - The Save Yourself Callback + +The Save Yourself Callback The Save Yourself callback is of type SmcSaveYourselfProc - + typedef void (*SaveYourselfProc) SmcConn smc_conn @@ -535,9 +533,9 @@ The Save Yourself callback is of type SmcSaveYourselfProc The session manager sends a “Save Yourself” message to a client either to checkpoint it or just before termination so that it can save its state. The client responds with zero or more calls -to SmcSetProperties to update the properties +to to update the properties indicating how to restart the client. When all the properties have -been set, the client calls SmcSaveYourselfDone +been set, the client calls @@ -551,13 +549,13 @@ If interact_style is SmInteractStyleAny then the client may interact with the user for any purpose. Because only one client can interact with the user at a time, the client must -call SmcInteractRequest and wait for an +call and wait for an “Interact” message from the session manager. When the client is done interacting with the user, it -calls SmcInteractDone The client may only -call SmcInteractRequest after it receives a +calls The client may only +call after it receives a “Save Yourself” message and before it -calls SmcSaveYourselfDone +calls @@ -620,14 +618,14 @@ set fast to True. - - The Die Callback + +The Die Callback -The Die callback is of type SmcDieProc +The Die callback is of type - + typedef void (*SmcDieProc) SmcConn smc_conn @@ -650,20 +648,20 @@ The Die callback is of type SmcDieProc The session manager sends a “Die” message to a client when it wants it to die. The client should respond by calling -SmcCloseConnection. A session manager that +. A session manager that behaves properly will send a “Save Yourself” message before the “Die” message. - - The Save Complete Callback + +The Save Complete Callback -The Save Complete callback is of type SmcSaveCompleteProc +The Save Complete callback is of type - + typedef void (*SmcSaveCompleteProc) SmcConn smc_conn @@ -684,15 +682,15 @@ The Save Complete callback is of type SmcSaveCompleteProc - - The Shutdown Cancelled Callback + +The Shutdown Cancelled Callback The Shutdown Cancelled callback is of type -SmcShutdownCancelledProc + - + typedef void (*SmcShutdownCancelledProc) SmcConn smc_conn @@ -714,27 +712,28 @@ The Shutdown Cancelled callback is of type The session manager sends a “Shutdown Cancelled” message when the user cancelled the shutdown during an interaction -(see section 5.5, +(see section 5.5, “Interacting With the User”). The client can now continue as if the shutdown had never happened. If the client has not -called SmcSaveYourselfDone yet, it can either -abort the save and then call SmcSaveYourselfDone +called yet, it can either +abort the save and then call with the success argument set to False or it can -continue with the save and then call SmcSaveYourselfDone +continue with the save and then call with the success argument set to reflect the outcome of the save. - Closing the Connection + +Closing the Connection To close a connection with a session manager, -use SmcCloseConnection +use - + SmcCloseStatus SmcCloseConnection SmcConn smc_conn @@ -769,11 +768,11 @@ display these reason messages to the user. Note that SMlib used the ICE protocol to establish a connection with the session manager, and various protocols other than session management may be active on the ICE connection. -When SmcCloseConnection is called, the ICE +When is called, the ICE connection will be closed only if all protocols have been shutdown on the connection. Check the ICElib standard -for IceAddConnectionWatch -and IceRemoveConnectionWatch to learn how to set +for IceAddConnectionWatch +and IceRemoveConnectionWatch to learn how to set up a callback to be invoked each time an ICE connection is opened or closed. Typically this callback adds/removes the ICE file descriptor from the list of active descriptors to call select on @@ -783,7 +782,7 @@ from the list of active descriptors to call select on -SmcCloseConnection returns one of the following values: + returns one of the following values: @@ -792,11 +791,11 @@ this time, the watch procedures were invoked, and the connection was freed. SmcClosedASAP - an IO error had occurred on the -connection, but SmcCloseConnection is being -called within a nested IceProcessMessages The +connection, but is being +called within a nested IceProcessMessages The watch procedures have been invoked at this time, but the connection will be freed as soon as possible (when the nesting level reaches zero -and IceProcessMessages returns a status +and IceProcessMessages returns a status of IceProcessMessagesConnectionClosed @@ -808,15 +807,15 @@ this time, because it is being used by other active protocols. - - Modifying Callbacks + +Modifying Callbacks -To modify callbacks set up in SmcOpenConnection -use SmcModifyCallbacks +To modify callbacks set up in +use - + void SmcModifyCallbacks SmcConn smc_conn @@ -852,15 +851,15 @@ the following values may be ORed together: - - Setting, Deleting, and Retrieving Session Management Properties + +Setting, Deleting, and Retrieving Session Management Properties To set session management properties for this client, -use SmcSetProperties +use - + void SmcSetProperties SmcConn smc_conn @@ -888,7 +887,7 @@ use SmcSetProperties The properties are specified as an array of property pointers. Previously set property values may be over-written using -the SmcSetProperties function. Note that the +the function. Note that the session manager is not expected to restore property values when the session is restarted. Because of this, clients should not try to use the session manager as a database for storing application specific state. @@ -897,17 +896,17 @@ the session manager as a database for storing application specific state. For a description of session management properties and the SmProp structure, -see section 7, +see section 7, “Session Management Properties.” To delete properties previously set by the client, -use SmcDeleteProperties +use - + void SmcDeleteProperties SmcConn smc_conn @@ -932,10 +931,10 @@ use SmcDeleteProperties To get properties previously stored by the client, -use SmcGetProperties +use - + Status SmcGetProperties SmcConn smc_conn @@ -955,22 +954,22 @@ use SmcGetProperties client_data - This pointer to client data will be passed to the SmcPropReplyProc callback. + This pointer to client data will be passed to the callback. -The return value of SmcGetProperties is zero for +The return value of is zero for failure and a positive value for success. Note that the library does not block until the properties reply comes -back. Rather, a callback of type SmcPropReplyProc +back. Rather, a callback of type is invoked when the data is ready. - + typedef void (*SmcPropReplyProc) SmcConn smc_conn @@ -987,7 +986,7 @@ is invoked when the data is ready. client_data - This pointer to client data will be passed to the SmcPropReplyProc callback. + This pointer to client data will be passed to the callback. num_props @@ -1000,15 +999,15 @@ is invoked when the data is ready. -To free each property, use SmFreeProperty -(see section 8, “Freeing +To free each property, use +(see section 8, “Freeing Data”). To free the actual array of pointers, use free - - Interacting With the User + +Interacting With the User After receiving a “Save Yourself” message with an @@ -1016,11 +1015,11 @@ After receiving a “Save Yourself” message with an SmInteractStyleErrors or SmInteractStyleAny the client may choose to interact with the user. Because only one client can interact with the -user at a time, the client must call SmcInteractRequest +user at a time, the client must call and wait for an “Interact” message from the session manager. - + Status SmcInteractRequest SmcConn smc_conn @@ -1047,14 +1046,14 @@ and wait for an “Interact” message from the session manager. client_data This pointer to client data will be passed to -the SmcInteractProc callback when the +the callback when the “Interact” message arrives. -The return value of SmcInteractRequest is zero +The return value of is zero for failure and a positive value for success. @@ -1074,11 +1073,11 @@ that have not interacted yet with the user will receive a -The SmcInteractProc callback will be invoked when +The callback will be invoked when the “Interact” message arrives from the session manager. - + typedef void (*SmcInteractProc) SmcConn smc_conn @@ -1099,10 +1098,10 @@ the “Interact” message arrives from the session manager. After interacting with the user (in response to an “Interact” -message), you should call SmcInteractDone +message), you should call - + void SmcInteractDone SmcConn smc_conn @@ -1130,15 +1129,15 @@ the interact_style. - - Requesting a Save Yourself + +Requesting a Save Yourself To request a checkpoint from the session manager, -use SmcRequestSaveYourself +use - + void SmcRequestSaveYourself SmcConn smc_conn @@ -1182,7 +1181,7 @@ use SmcRequestSaveYourself The save_type, shutdown, interact_style, and fast arguments are discussed in more detail in -section 5.1.1, +section 5.1.1, “The Save Yourself Callback.” @@ -1201,16 +1200,16 @@ Yourself” should only be sent to the client that requested it. - - Requesting a Save Yourself Phase 2 + +Requesting a Save Yourself Phase 2 In response to a “Save Yourself”, the client may request to be informed when all the other clients are quiescent so that it can save their -state. To do so, use SmcRequestSaveYourselfPhase2 +state. To do so, use - + Status SmcRequestSaveYourselfPhase2 SmcConn smc_conn @@ -1235,7 +1234,7 @@ state. To do so, use SmcRequestSaveYourselfPhase2 -The return value of SmcRequestSaveYourselfPhase2 +The return value of is zero for failure and a positive value for success. @@ -1247,15 +1246,15 @@ an idle state so that their state can be saved. - - Completing a Save Yourself + +Completing a Save Yourself After saving state in response to a “Save Yourself” -message, you should call SmcSaveYourselfDone +message, you should call - + void SmcSaveYourselfDone SmcConn smc_conn @@ -1275,16 +1274,16 @@ message, you should call SmcSaveYourselfDone -Before calling SmcSaveYourselfDone the client +Before calling the client must have set each required property at least once since the client registered with the session manager. - - Using Smc Informational Functions + +Using Smc Informational Functions - + int SmcProtocolVersion SmcConn smc_conn @@ -1292,12 +1291,12 @@ registered with the session manager. -SmcProtocolVersion returns the major version of + returns the major version of the session management protocol associated with this session. - + int SmcProtocolRevision SmcConn smc_conn @@ -1305,11 +1304,11 @@ the session management protocol associated with this session. -SmcProtocolRevision returns the minor version of + returns the minor version of the session management protocol associated with this session. - + char *SmcVendor SmcConn smc_conn @@ -1317,12 +1316,12 @@ the session management protocol associated with this session. -SmcVendor returns a string that provides some + returns a string that provides some identification of the owner of the session manager. The string should be freed with a call to free - + char *SmcRelease SmcConn smc_conn @@ -1330,12 +1329,12 @@ be freed with a call to free -SmcRelease returns a string that provides the + returns a string that provides the release number of the session manager. The string should be freed with a call to free - + char *SmcClientID SmcConn smc_conn @@ -1343,14 +1342,14 @@ with a call to free -SmcClientID returns a null-terminated string for + returns a null-terminated string for the client ID associated with this connection. This information was -also returned in SmcOpenConnection (it is +also returned in (it is provided here for convenience). Call free on this pointer when the client ID is no longer needed. - + IceConn SmcGetIceConnection SmcConn smc_conn @@ -1358,22 +1357,22 @@ this pointer when the client ID is no longer needed. -SmcGetIceConnection returns the ICE connection + returns the ICE connection object associated with this session management connection object. The ICE connection object can be used to get some additional information about the connection. Some of the more useful functions which can be used on the IceConn are IceConnectionNumber, IceConnectionString, -IceLastSentSequenceNumber, +IceLastSentSequenceNumber, IceLastReceivedSequenceNumber, -and IcePing. For further information, see +and IcePing. For further information, see the Inter-Client Exchange Library standard. - - Error Handling + +Error Handling If the client receives an unexpected protocol error from the session @@ -1381,10 +1380,10 @@ manager, an error handler is invoked by SMlib. A default error handler exists that simply prints the error message to stderr and exits if the severity of the error is fatal. The client can change this error handler by calling -the SmcSetErrorHandler function. +the function. - + SmcErrorHandler SmcSetErrorHandler SmcErrorHandler handler @@ -1398,14 +1397,14 @@ restore the default handler. -SmcSetErrorHandler returns the previous error handler. + returns the previous error handler. -The SmcErrorHandler has the following type: +The has the following type: - + typedef void (*SmcErrorHandler) SmcConn smc_conn @@ -1455,14 +1454,14 @@ The SmcErrorHandler has the following type: Note that this error handler is invoked for protocol related errors. To install an error handler to be invoked when an IO error occurs, use -IceSetIOErrorHandler For further information, see +IceSetIOErrorHandler For further information, see the Inter-Client Exchange Library standard. - + Session Management Server (<acronym>Sms</acronym>) Functions @@ -1485,21 +1484,21 @@ This section discusses how Session Management servers: - - Initializing the Library + +Initializing the Library -SmsInitialize is the first SMlib function that + is the first SMlib function that should be called by a session manager. It provides information about the session manager and registers a callback that will be invoked each time a new client connects to the session manager. - + Status SmsInitialize - char *vendor - char *release + const char *vendor + const char *release SmsNewClientProc new_client_proc SmPointer manager_data IceHostBasedAuthProc host_based_auth_proc @@ -1525,7 +1524,7 @@ time a new client connects to the session manager. manager_data - When the SmsNewClientProc callback is invoked, this pointer to manager data will be passed. + When the callback is invoked, this pointer to manager data will be passed. host_based_auth_proc @@ -1546,15 +1545,15 @@ No more than error_length bytes are used. -After the SmsInitialize function is called, the -session manager should call the IceListenForConnections +After the function is called, the +session manager should call the IceListenForConnections function to listen for new connections. Afterwards, each time a client connects, the session manager should -call IceAcceptConnection +call IceAcceptConnection -See section 9, +See section 9, “Authentication of Clients,” for more details on authentication (including host based authentication). Also see the Inter-Client Exchange @@ -1564,14 +1563,14 @@ accepting ICE connections. Each time a new client connects to the session manager, -the SmsNewClientProc callback is invoked. The +the callback is invoked. The session manager obtains a new opaque connection object that it should use for all future interaction with the client. At this time, the session manager must also register a set of callbacks to respond to the different messages that the client might send. - + typedef Status (*SmsNewClientProc) SmsConn sms_conn @@ -1606,7 +1605,7 @@ the different messages that the client might send. -If a failure occurs, the SmsNewClientProc should +If a failure occurs, the should return a zero status as well as allocate and return a failure reason string in failure_reason_ret. SMlib will be responsible for freeing this memory. @@ -1699,16 +1698,16 @@ typedef struct { } SmsCallbacks; - - The Register Client Callback + +The Register Client Callback The Register Client callback is the first callback that will be invoked after the client connects to the session manager. Its type -is SmsRegisterClientProc +is - + typedef Status (*SmsRegisterClientProc) SmsConn sms_conn @@ -1755,22 +1754,22 @@ client should re-register with previous_id set to NULL. Otherwise, the session manager should register the client with a unique -client ID by calling the SmsRegisterClientReply +client ID by calling the function (to be discussed shortly), and the -SmsRegisterClientProc callback should return a + callback should return a status of one. - - The Interact Request Callback + +The Interact Request Callback The Interact Request callback is of -type SmsInteractRequestProc +type - + typedef void (*SmsInteractRequestProc) SmsConn sms_conn @@ -1823,15 +1822,15 @@ requested to interact. - - The Interact Done Callback + +The Interact Done Callback When the client is done interacting with the user, -the SmsInteractDoneProc callback will be invoked. +the callback will be invoked. - + typedef void (*SmsInteractDoneProc) SmsConn sms_conn @@ -1865,15 +1864,15 @@ or SmInteractStyleAny for the - - The Save Yourself Request Callback + +The Save Yourself Request Callback The Save Yourself Request callback is of type SmsSaveYourselfRequestProc - + typedef void (*SaveYourselfRequestProc) SmsConn sms_conn @@ -1922,7 +1921,7 @@ The Save Yourself Request prompts the session manager to initiate a checkpoint or shutdown. For information on the save_type, shutdown, interact_style, and fast -arguments, see section 6.3, +arguments, see section 6.3, “Sending a Save Yourself Message.” @@ -1934,15 +1933,15 @@ If global is set to False then the - - The Save Yourself Phase 2 Request Callback + +The Save Yourself Phase 2 Request Callback The Save Yourself Phase 2 Request callback is of -type SmsSaveYourselfPhase2RequestProc +type - + typedef void (*SmsSaveYourselfPhase2RequestProc) SmsConn sms_conn @@ -1969,8 +1968,8 @@ are in an idle state so that their state can be saved. - - The Save Yourself Done Callback + +The Save Yourself Done Callback When the client is done saving its state in response to a @@ -1978,7 +1977,7 @@ When the client is done saving its state in response to a the SmsSaveYourselfDoneProc will be invoked. - + typedef void (*SaveYourselfDoneProc) SmsConn sms_conn @@ -2009,16 +2008,16 @@ the session manager. - - The Connection Closed Callback + +The Connection Closed Callback If the client properly terminates (that is, it -calls SmcCloseConnection, -the SmsCloseConnectionProc callback is invoked. +calls , +the callback is invoked. - + typedef void (*SmsCloseConnectionProc) SmsConn sms_conn @@ -2057,21 +2056,21 @@ display these reason messages to the user. -Call SmFreeReasons to free the reason messages. +Call to free the reason messages. For further information, see -section 8, “Freeing Data” +section 8, “Freeing Data” - - The Set Properties Callback + +The Set Properties Callback When the client sets session management properties, -the SmsSetPropertiesProc callback will be invoked. +the callback will be invoked. - + typedef void (*SmsSetPropertiesProc) SmsConn sms_conn @@ -2104,7 +2103,7 @@ the SmsSetPropertiesProc callback will be invoked. The properties are specified as an array of property pointers. For a description of session management properties and the SmProp structure, -see section 7, +see section 7, “Session Management Properties.” @@ -2115,22 +2114,22 @@ nonpredefined properties. -To free each property, use SmFreeProperty. -For further information, see section 8, +To free each property, use . +For further information, see section 8, “Freeing Data” You should free the actual array of pointers with a call to free - - The Delete Properties Callback + +The Delete Properties Callback When the client deletes session management properties, -the SmsDeletePropertiesProc callback will be invoked. +the callback will be invoked. - + typedef void (*SmsDeletePropertiesProc) SmsConn sms_conn @@ -2163,20 +2162,20 @@ the SmsDeletePropertiesProc callback will be invoked. The properties are specified as an array of strings. For a description of session management properties and the SmProp structure, -see section 7, +see section 7, “Session Management Properties.” - - The Get Properties Callback + +The Get Properties Callback -The SmsGetPropertiesProc callback is invoked when +The callback is invoked when the client wants to retrieve properties it set. - + typedef void (*SmsGetPropertiesProc) SmsConn sms_conn @@ -2197,22 +2196,22 @@ the client wants to retrieve properties it set. The session manager should respond by -calling SmsReturnProperties. +calling . All of the properties set for this client should be returned. - - Registering the Client + +Registering the Client To register a client (in response to -a SmsRegisterClientProc callback), -use SmsRegisterClientReply. +a callback), +use . - + Status SmsRegisterClientReply SmsConn sms_conn @@ -2232,7 +2231,7 @@ use SmsRegisterClientReply. -The return value of SmsRegisterClientReply is +The return value of is zero for failure and a positive value for success. Failure will occur if SMlib can not allocate memory to hold a copy of the client ID for it's own internal needs. @@ -2267,11 +2266,11 @@ unique. -You should call the SmsGenerateClientID function +You should call the function to generate a globally unique client ID. - + char *SmsGenerateClientID SmsConn sms_conn @@ -2294,15 +2293,15 @@ no longer needed. - - Sending a Save Yourself Message + +Sending a Save Yourself Message To send a “Save Yourself” to a client, -use SmsSaveYourself. +use . - + void SmsSaveYourself SmsConn sms_conn @@ -2397,15 +2396,15 @@ to True. - - Sending a Save Yourself Phase 2 Message + +Sending a Save Yourself Phase 2 Message In order to send a “Save Yourself Phase 2” message to a -client, use SmsSaveYourselfPhase2 +client, use - + void SmsSaveYourselfPhase2 SmsConn sms_conn @@ -2427,15 +2426,15 @@ and this client can save state that is associated with other clients. - - Sending an Interact Message + +Sending an Interact Message To send an “Interact” message to a client, -use SmsInteract. +use . - + void SmsInteract SmsConn sms_conn @@ -2457,15 +2456,15 @@ session manager. - - Sending a Save Complete Message + +Sending a Save Complete Message To send a “Save Complete” message to a client, -use SmsSaveComplete. +use . - + void SmsSaveComplete SmsConn sms_conn @@ -2485,15 +2484,15 @@ checkpoint. The client is then free to change its state. - - Sending a Die Message + +Sending a Die Message To send a “Die” message to a client, -use SmsDie. +use . - + void SmsDie SmsConn sms_conn @@ -2514,14 +2513,14 @@ a “Die” message to, timing out appropriately. - - Cancelling a Shutdown + +Cancelling a Shutdown -To cancel a shutdown, use SmsShutdownCancelled. +To cancel a shutdown, use . - + void SmsShutdownCancelled SmsConn sms_conn @@ -2547,15 +2546,15 @@ of the save. - - Returning Properties + +Returning Properties In response to a “Get Properties” message, the session -manager should call SmsReturnProperties. +manager should call . - + void SmsReturnProperties SmsConn sms_conn @@ -2583,25 +2582,25 @@ manager should call SmsReturnProperties. The properties are returned as an array of property pointers. For a description of session management properties and the SmProp structure, -see section 7, +see section 7, “Session Management Properties.” - - Pinging a Client + +Pinging a Client To check that a client is still alive, you should use -the IcePing function provided by the ICE library. +the IcePing function provided by the ICE library. To do so, the ICE connection must be obtained using -the SmsGetIceConnection -(see section 6.12, +the +(see section 6.12, “Using Sms Informational Functions”). - + void IcePing IceConn ice_conn @@ -2621,19 +2620,19 @@ the SmsGetIceConnection client_data - This pointer will be passed to the IcePingReplyProc callback. + This pointer will be passed to the callback. When the Ping reply is ready (if ever), -the IcePingReplyProc callback will be invoked. A +the callback will be invoked. A session manager should have some sort of timeout period, after which it assumes the client has unexpectedly died. - + typedef void (*IcePingReplyProc) IceConn ice_conn @@ -2648,23 +2647,23 @@ it assumes the client has unexpectedly died. client_data - The client data specified in the call to IcePing + The client data specified in the call to IcePing - - Cleaning Up After a Client Disconnects + +Cleaning Up After a Client Disconnects When the session manager receives a “Connection Closed” message or otherwise detects that the client aborted the connection, -it should call the SmsCleanUp function in order +it should call the function in order to free up the connection object. - + void SmsCleanUp SmsConn sms_conn @@ -2680,10 +2679,10 @@ to free up the connection object. - - Using Sms Informational Functions + +Using Sms Informational Functions - + int SmsProtocolVersion SmsConn sms_conn @@ -2691,11 +2690,11 @@ to free up the connection object. -SmsProtocolVersion returns the major version of + returns the major version of the session management protocol associated with this session. - + int SmsProtocolRevision SmsConn sms_conn @@ -2703,11 +2702,11 @@ the session management protocol associated with this session. -SmsProtocolRevision returns the minor version of + returns the minor version of the session management protocol associated with this session. - + char *SmsClientID SmsConn sms_conn @@ -2715,7 +2714,7 @@ the session management protocol associated with this session. -SmsClientID returns a null-terminated string for + returns a null-terminated string for the client ID associated with this connection. You should call free on this pointer when the client ID is no longer needed. @@ -2724,11 +2723,11 @@ no longer needed. To obtain the host name of a client, -use SmsClientHostName. +use . This host name will be needed to restart the client. - + char *SmsClientHostName SmsConn sms_conn @@ -2744,7 +2743,7 @@ You should call free on the string returned when it is no longer needed. - + IceConn SmsGetIceConnection SmsConn sms_conn @@ -2752,7 +2751,7 @@ it is no longer needed. -SmsGetIceConnection returns the ICE connection + returns the ICE connection object associated with this session management connection object. The ICE connection object can be used to get some additional information about the connection. Some of the more useful functions which can be @@ -2764,18 +2763,18 @@ standard. - - Error Handling + +Error Handling If the session manager receives an unexpected protocol error from a client, an error handler is invoked by SMlib. A default error handler exists which simply prints the error message (it does not exit). The session manager can change this error handler by -calling SmsSetErrorHandler. +calling . - + SmsErrorHandler SmsSetErrorHandler SmsErrorHandler handler @@ -2788,11 +2787,11 @@ to restore the default handler. -SmsSetErrorHandler returns the previous error handler. -The SmsErrorHandler has the following type: + returns the previous error handler. +The has the following type: - + typedef void (*SmsErrorHandler) SmsConn sms_conn @@ -2843,7 +2842,7 @@ The SmsErrorHandler has the following type: Note that this error handler is invoked for protocol related errors. To install an error handler to be invoked when an IO error occurs, -use IceSetIOErrorHandler. +use IceSetIOErrorHandler. For further information, see the Inter-Client Exchange Library standard. @@ -2851,7 +2850,7 @@ standard. - + Session Management Properties @@ -2886,86 +2885,86 @@ A type of SmLISTofARRAY8 indicates that there is a list of array of bytes. - - - - - - + + + + + + - - Name - Type - POSIX Type - Required + + Name + Type + POSIX Type + Required - SmCloneCommand - OS-specific - SmLISTofARRAY8 - Yes + SmCloneCommand + OS-specific + SmLISTofARRAY8 + Yes - SmCurrentDirectory - OS-specific - SmARRAY8 - No + SmCurrentDirectory + OS-specific + SmARRAY8 + No - SmDiscardCommand - OS-specific - SmLISTofARRAY8 - No* + SmDiscardCommand + OS-specific + SmLISTofARRAY8 + No* - SmEnvironment - OS-specific - SmLISTofARRAY8 - No + SmEnvironment + OS-specific + SmLISTofARRAY8 + No - SmProcessID - OS-specific - SmARRAY8 - No + SmProcessID + OS-specific + SmARRAY8 + No - SmProgram - OS-specific - SmARRAY8 - Yes + SmProgram + OS-specific + SmARRAY8 + Yes - SmRestartCommand - OS-specific - SmLISTofARRAY8 - Yes + SmRestartCommand + OS-specific + SmLISTofARRAY8 + Yes - SmResignCommand - OS-specific - SmLISTofARRAY8 - No + SmResignCommand + OS-specific + SmLISTofARRAY8 + No - SmRestartStyleHint - SmCARD8 - SmCARD8 - No + SmRestartStyleHint + SmCARD8 + SmCARD8 + No - SmShutdownCommand - OS-specific - SmLISTofARRAY8 - No + SmShutdownCommand + OS-specific + SmLISTofARRAY8 + No - SmUserID - SmARRAY8 - SmARRAY8 - Yes + SmUserID + SmARRAY8 + SmARRAY8 + Yes @@ -3050,32 +3049,33 @@ style of restarting the client prefers. If this style is not specified, SmRestartIfRunning is assumed. The possible values are as follows: - - - - + + + + + - - Name - Value + + Name + Value - SmRestartIfRunning - 0 + SmRestartIfRunning + 0 - SmRestartAnyway - 1 + SmRestartAnyway + 1 - SmRestartImmediately - 2 + SmRestartImmediately + 2 - SmRestartNever - 3 + SmRestartNever + 3 @@ -3134,14 +3134,14 @@ contain the user's name (the pw_name member of - + Freeing Data -To free an individual property, use SmFreeProperty +To free an individual property, use - + void SmFreeProperty SmProp *prop @@ -3157,11 +3157,11 @@ To free an individual property, use SmFreeProperty To free the reason strings from -the SmsCloseConnectionProc callback, -use SmFreeReasons +the callback, +use - + void SmFreeReasons int count @@ -3181,7 +3181,7 @@ use SmFreeReasons - + Authentication of Clients @@ -3203,7 +3203,7 @@ standard. - + Working in a Multi-Threaded Environment @@ -3216,7 +3216,7 @@ standard. - + Acknowledgements diff --git a/doc/xsmp.xml b/doc/xsmp.xml old mode 100755 new mode 100644 index c90a45c..d962fcb --- a/doc/xsmp.xml +++ b/doc/xsmp.xml @@ -1,28 +1,29 @@ - + %defs; +]> - + X Session Management Protocol X Consortium Standard - X Version 11, Release 7 + X Version 11, Release &fullrelvers; + Version 1.0 MikeWexler + Kubota Pacific Computer, Inc - Kubota Pacific Computer, Inc 1992199319942002 The Open Group - Version 1.0 - X Consortium - X Version 11, Release 7 @@ -74,7 +75,7 @@ top of the X.Org ICE protocol. - + Acknowledgments @@ -86,7 +87,7 @@ and Bob Scheifler. - + Definitions and Goals @@ -123,7 +124,7 @@ relies on the ICE protocol to handle connection management an - + Overview of the Protocol @@ -229,7 +230,7 @@ no properties set. - + Data Types @@ -245,12 +246,12 @@ types, a BadValue error message must be sent by the receiver of the message to the sender of the message. - - - - + + + + - + Type Name Description @@ -306,7 +307,7 @@ the receiver of the message to the sender of the message. - + Protocol Setup and Message Format @@ -321,7 +322,7 @@ message this message contains. - + Client Identification String A client ID is a string of XPCS characters encoded in ISO Latin 1 (ISO @@ -399,7 +400,7 @@ any user, session manager, and machine will be different from any other. - + Protocol The protocol consists of a sequence of messages as described below. @@ -425,12 +426,12 @@ set of valid responses and possible error messages are listed. The The client must send this message to the SM to register the client's existence. If a client is being restarted from a previous session, the previous-ID field must contain the client -ID from the previous session. For new clients, +ID from the previous session. For new clients, previous-ID should be of zero length. -If previous-ID is not valid, +If previous-ID is not valid, the SM will send a BadValue error message to the client. At this point the SM reverts to the register state and waits for another RegisterClient @@ -446,14 +447,14 @@ null previous-ID field. The client-ID specifies a unique identification -for this client. If the client had specified an ID in the -previous-ID field of the -RegisterClient message, +for this client. If the client had specified an ID in the +previous-ID field of the +RegisterClient message, client-ID will be identical to the previously specified ID. If previous-ID was null, client-ID will be a unique ID freshly generated by the SM. The client-ID format is specified in -section 6. +section 6. @@ -778,7 +779,7 @@ and Any or Errors for the SaveComplete Die ShutdownCancelled - + @@ -807,7 +808,7 @@ field of the SaveYourselfDone message. Valid Responses: ShutdownCancelled SaveYourselfPhase2 - + @@ -901,7 +902,7 @@ Sets the specified properties to the specified values. Existing properties not specified in the Set­Properties message are unaffected. Some properties have predefined semantics. -See section 11, +See section 11, “Predefined Properties.” @@ -946,7 +947,7 @@ message and includes the values of all the properties. - + Errors @@ -963,15 +964,15 @@ a BadState error message. - + State Diagrams These state diagrams are designed to cover all actions of both the client and the SM. - - Client State Diagram + +Client State Diagram @@ -1065,7 +1066,7 @@ client and the SM. client stops participating in session - + Session Manager State Diagram @@ -1163,198 +1164,258 @@ client and the SM. - + Protocol Encoding - - Types - - - - - - - - - + +Types + + + + + + + - BOOL + BOOL + + - 0 - False + 0 + False - 1 - True + 1 + True - + + + + + + + - INTERACT_STYLE + INTERACT_STYLE + + - 0 - None + 0 + None - 1 - Errors + 1 + Errors - 2 - Any + 2 + Any - + + + + + + + - DIALOG_TYPE + DIALOG_TYPE + + - 0 - Error + 0 + Error - 1 - Normal + 1 + Normal - + + + + + + + - SAVE_TYPE + SAVE_TYPE + + - 0 - Global + 0 + Global - 1 - Local + 1 + Local - 2 - Both + 2 + Both - + + + + + + + + - ARRAY8 + ARRAY8 + + - 4 - CARD32 - length + 4 + CARD32 + length - n - ListofCARD8, the array - p = pad (4 + n, 8) + n + ListofCARD8, the array + p = pad (4 + n, 8) - 2 - Both + 2 + Both - + + + + + + + + - LISTofARRAY8 + LISTofARRAY8 + + - 4 - CARD32 - count + 4 + CARD32 + count - 4 - - unused + 4 + + unused - a - ARRAY8 - first array + a + ARRAY8 + first array - b - ARRAY8 - second array + b + ARRAY8 + second array - . - - + . + + - . - - + . + + - . - - + . + + - q - ARRAY8 - last array + q + ARRAY8 + last array - + + + + + + + + - PROPERTY + PROPERTY + + - a - ARRAY8 - name + a + ARRAY8 + name - b - ARRAY8 - type (XPCS encoded in Latin-1, case sensitive) + b + ARRAY8 + type (XPCS encoded in Latin-1, case sensitive) - c - LISTofARRAY8 - values + c + LISTofARRAY8 + values - + + + + + + + + - LISTofPROPERTY + LISTofPROPERTY + + - 4 - CARD32 - count + 4 + CARD32 + count - 4 - - unused + 4 + + unused - a - PROPERTY - first property + a + PROPERTY + first property - b - PROPERTY - second property + b + PROPERTY + second property - . - - + . + + - . - - + . + + - . - - + . + + - q - PROPERTY - last property + q + PROPERTY + last property @@ -1362,8 +1423,8 @@ client and the SM. - - Messages + +Messages XSMP is a sub-protocol of ICE. The major opcode is assigned at run-time by ICE and is represented here @@ -1389,572 +1450,735 @@ manager. The session manager should supply this information in the ICE ProtocolReply message. - - - - - - - - + + + + + + + - RegisterClient + RegisterClient + + - 1 - ? - XSMP + 1 + ? + XSMP - 1 - 1 - opcode + 1 + 1 + opcode - 2 - - unused + 2 + + unused - 4 - a/8 - length of remaining data in 8-byte units + 4 + a/8 + length of remaining data in 8-byte units - a - ARRAY8 - previous-ID + a + ARRAY8 + previous-ID - + + + + + + + + - RegisterClientReply + RegisterClientReply + + - 1 - ? - XSMP + 1 + ? + XSMP - 1 - 2 - opcode + 1 + 2 + opcode - 2 - - unused + 2 + + unused - 4 - a/8 - length of remaining data in 8-byte units + 4 + a/8 + length of remaining data in 8-byte units - a - ARRAY8 - client-ID + a + ARRAY8 + client-ID - + + + + + + + + - SaveYourself + SaveYourself + + - 1 - ? - XSMP + 1 + ? + XSMP - 1 - 3 - opcode + 1 + 3 + opcode - 2 - - unused + 2 + + unused - 4 - 1 - length of remaining data in 8-byte units + 4 + 1 + length of remaining data in 8-byte units - 1 - SAVE_TYPE - type + 1 + SAVE_TYPE + type - 1 - BOOL - shutdown + 1 + BOOL + shutdown - 1 - INTERACT_STYLE - interact-style + 1 + INTERACT_STYLE + interact-style - 1 - BOOL - fast + 1 + BOOL + fast - 4 - - unused + 4 + + unused - + + + + + + + + - SaveYourselfRequest + SaveYourselfRequest + + - 1 - ? - XSMP + 1 + ? + XSMP - 1 - 4 - opcode + 1 + 4 + opcode - 2 - - unused + 2 + + unused - 4 - 1 - length of remainning data in 8-byte units + 4 + 1 + length of remainning data in 8-byte units - 1 - SAVE_TYPE - type + 1 + SAVE_TYPE + type - 1 - BOOL - shutdown + 1 + BOOL + shutdown - 1 - INTERACT_STYLE - interact-style + 1 + INTERACT_STYLE + interact-style - 1 - BOOL - fast + 1 + BOOL + fast - 3 - - unused + 3 + + unused - + + + + + + + + - InteractRequest + InteractRequest + + - 1 - ? - XSMP + 1 + ? + XSMP - 1 - 5 - opcode + 1 + 5 + opcode - 1 - DIALOG_TYPE - dialog type + 1 + DIALOG_TYPE + dialog type - 1 - - unused + 1 + + unused - 4 - 0 - length of remaining data in 8-byte units + 4 + 0 + length of remaining data in 8-byte units - + + + + + + + + - Interact + Interact + + - 1 - ? - XSMP + 1 + ? + XSMP - 1 - 6 - opcode + 1 + 6 + opcode - 2 - - unused + 2 + + unused - 4 - 0 - length of remaining data in 8-byte units + 4 + 0 + length of remaining data in 8-byte units - + + + + + + + + - InteractDone + InteractDone + + - 1 - ? - XSMP + 1 + ? + XSMP - 1 - 7 - opcode + 1 + 7 + opcode - 1 - BOOL - cancel-shutdown + 1 + BOOL + cancel-shutdown - 1 - - unused + 1 + + unused - + + + + + + + + - InteractDone + InteractDone + + - 1 - ? - XSMP + 1 + ? + XSMP - 1 - 7 - opcode + 1 + 7 + opcode - 1 - BOOL - cancel-shutdown + 1 + BOOL + cancel-shutdown - 1 - - unused + 1 + + unused - 4 - 0 - length of remaining data in 8-byte units + 4 + 0 + length of remaining data in 8-byte units - + + + + + + + + - SaveYourselfDone + SaveYourselfDone + + - 1 - ? - XSMP + 1 + ? + XSMP - 1 - 8 - opcode + 1 + 8 + opcode - 1 - BOOL - success + 1 + BOOL + success - 1 - - unused + 1 + + unused - 4 - 0 - length of remaining data in 8-byte units + 4 + 0 + length of remaining data in 8-byte units - + + + + + + + + - Die + Die + + - 1 - ? - XSMP + 1 + ? + XSMP - 1 - 9 - opcode + 1 + 9 + opcode - 1 - - unused + 1 + + unused - 4 - 0 - length of remaining data in 8-byte units + 4 + 0 + length of remaining data in 8-byte units - + + + + + + + + - ShutdownCancelled + ShutdownCancelled + + - 1 - ? - XSMP + 1 + ? + XSMP - 1 - 10 - opcode + 1 + 10 + opcode - 2 - - unused + 2 + + unused - 4 - 0 - length of remaining data in 8-byte units + 4 + 0 + length of remaining data in 8-byte units - + + + + + + + + - ConnectionClosed + ConnectionClosed + + - 1 - ? - XSMP + 1 + ? + XSMP - 1 - 11 - opcode + 1 + 11 + opcode - 2 - - unused + 2 + + unused - 4 - a/8 - length of remaining data in 8-byte units + 4 + a/8 + length of remaining data in 8-byte units - a - LISTofARRAY8 - reason + a + LISTofARRAY8 + reason - + + + + + + + + - SetProperties + SetProperties + + - 1 - ? - XSMP + 1 + ? + XSMP - 1 - 12 - opcode + 1 + 12 + opcode - 2 - - unused + 2 + + unused - 4 - a/8 - length of remaining data in 8-byte units + 4 + a/8 + length of remaining data in 8-byte units - a - LISTofPROPERTY - properties + a + LISTofPROPERTY + properties - + + + + + + + + - DeleteProperties + DeleteProperties + + - 1 - ? - XSMP + 1 + ? + XSMP - 1 - 13 - opcode + 1 + 13 + opcode - 2 - - unused + 2 + + unused - 4 - a/8 - length of remaining data in 8-byte units + 4 + a/8 + length of remaining data in 8-byte units - a - LISTofPROPERTY - properties + a + LISTofPROPERTY + properties - + + + + + + + + - GetProperties + GetProperties + + - 1 - ? - XSMP + 1 + ? + XSMP - 1 - 14 - opcode + 1 + 14 + opcode - 2 - - unused + 2 + + unused - 4 - 0 - length of remaining data in 8-byte units + 4 + 0 + length of remaining data in 8-byte units - + + + + + + + + - GetPropertiesReply + GetPropertiesReply + + - 1 - ? - XSMP + 1 + ? + XSMP - 1 - 15 - opcode + 1 + 15 + opcode - 2 - - unused + 2 + + unused - 4 - a/8 - length of remaining data in 8-byte units + 4 + a/8 + length of remaining data in 8-byte units - a - LISTofPROPERTY - properties + a + LISTofPROPERTY + properties - + + + + + + + + - SaveYourselfPhase2Request + SaveYourselfPhase2Request + + - 1 - ? - XSMP + 1 + ? + XSMP - 1 - 16 - opcode + 1 + 16 + opcode - 2 - - unused + 2 + + unused - 4 - 0 - length of remaining data in 8-byte units + 4 + 0 + length of remaining data in 8-byte units - + + + + + + + + - SaveYourselfPhase2 + SaveYourselfPhase2 + + - 1 - ? - XSMP + 1 + ? + XSMP - 1 - 17 - opcode + 1 + 17 + opcode - 2 - - unused + 2 + + unused - 4 - 0 - length of remaining data in 8-byte units + 4 + 0 + length of remaining data in 8-byte units - + + + + + + + + - SaveComplete + SaveComplete + + - 1 - ? - XSMP + 1 + ? + XSMP - 1 - 18 - opcode + 1 + 18 + opcode - 2 - - unused + 2 + + unused - 4 - 0 - length of remaining data in 8-byte units + 4 + 0 + length of remaining data in 8-byte units - + - + Predefined Properties All property values are stored in a LISTofARRAY8. If the type of the @@ -1977,14 +2201,14 @@ Clients may set, get, and delete nonstandard properties. The lifetime of stored properties does not extend into subsequent sessions. - - - - - - + + + + + + - + Name Type Posix Type @@ -2158,32 +2382,33 @@ specified, RestartIfRunning is assumed. The possible values are as follows: - - - - + + + + + - - Name - Value + + Name + Value - RestartIfRunning - 0 + RestartIfRunning + 0 - RestartAnyway - 1 + RestartAnyway + 1 - RestartImmediately - 2 + RestartImmediately + 2 - RestartNever - 3 + RestartNever + 3 diff --git a/docbook.am b/docbook.am new file mode 100644 index 0000000..bba4d54 --- /dev/null +++ b/docbook.am @@ -0,0 +1,105 @@ +# +# Generate output formats for a single DocBook/XML with/without chapters +# +# Variables set by the calling Makefile: +# shelfdir: the location where the docs/specs are installed. Typically $(docdir) +# docbook: the main DocBook/XML file, no chapters, appendix or image files +# chapters: all files pulled in by an XInclude statement and images. +# + +# +# This makefile is intended for Users Documentation and Functional Specifications. +# Do not use for Developer Documentation which is not installed and does not require olink. +# Refer to http://www.x.org/releases/X11R7.6/doc/xorg-docs/ReleaseNotes.html#id2584393 +# for an explanation on documents classification. +# + +# DocBook/XML generated output formats to be installed +shelf_DATA = + +# DocBook/XML file with chapters, appendix and images it includes +dist_shelf_DATA = $(docbook) $(chapters) + +if HAVE_XMLTO +if HAVE_STYLESHEETS + +XMLTO_SEARCHPATH_FLAGS = \ + --searchpath "$(XORG_SGML_PATH)/X11" \ + --searchpath "$(abs_top_builddir)" +XMLTO_HTML_OLINK_FLAGS = \ + --stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.html.xml \ + --stringparam current.docid="$(<:.xml=)" +XMLTO_HTML_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl +XMLTO_HTML_FLAGS = \ + $(XMLTO_SEARCHPATH_FLAGS) \ + $(XMLTO_HTML_STYLESHEET_FLAGS) \ + $(XMLTO_HTML_OLINK_FLAGS) + +shelf_DATA += $(docbook:.xml=.html) +%.html: %.xml $(chapters) + $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) xhtml-nochunks $< + +if HAVE_XMLTO_TEXT + +shelf_DATA += $(docbook:.xml=.txt) +%.txt: %.xml $(chapters) + $(AM_V_GEN)$(XMLTO) $(XMLTO_HTML_FLAGS) txt $< +endif HAVE_XMLTO_TEXT + +if HAVE_FOP +XMLTO_FO_IMAGEPATH_FLAGS = --stringparam img.src.path=$(abs_builddir)/ +XMLTO_PDF_OLINK_FLAGS = \ + --stringparam target.database.document=$(XORG_SGML_PATH)/X11/dbs/masterdb.pdf.xml \ + --stringparam current.docid="$(<:.xml=)" +XMLTO_FO_STYLESHEET_FLAGS = -x $(STYLESHEET_SRCDIR)/xorg-fo.xsl + +XMLTO_FO_FLAGS = \ + $(XMLTO_SEARCHPATH_FLAGS) \ + $(XMLTO_FO_STYLESHEET_FLAGS) \ + $(XMLTO_FO_IMAGEPATH_FLAGS) \ + $(XMLTO_PDF_OLINK_FLAGS) + +shelf_DATA += $(docbook:.xml=.pdf) +%.pdf: %.xml $(chapters) + $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop pdf $< + +shelf_DATA += $(docbook:.xml=.ps) +%.ps: %.xml $(chapters) + $(AM_V_GEN)$(XMLTO) $(XMLTO_FO_FLAGS) --with-fop ps $< +endif HAVE_FOP + +# Generate documents cross-reference target databases +if HAVE_XSLTPROC + +XSLT_SEARCHPATH_FLAGS = \ + --path "$(XORG_SGML_PATH)/X11" \ + --path "$(abs_top_builddir)" +XSLT_OLINK_FLAGS = \ + --stringparam targets.filename "$@" \ + --stringparam collect.xref.targets "only" \ + --stringparam olink.base.uri "$(@:.db=)" + +XSLT_HTML_FLAGS = \ + $(XSLT_SEARCHPATH_FLAGS) \ + $(XSLT_OLINK_FLAGS) \ + --nonet --xinclude \ + $(STYLESHEET_SRCDIR)/xorg-xhtml.xsl +XSLT_PDF_FLAGS = \ + $(XSLT_SEARCHPATH_FLAGS) \ + $(XSLT_OLINK_FLAGS) \ + --nonet --xinclude \ + $(STYLESHEET_SRCDIR)/xorg-fo.xsl + +shelf_DATA += $(docbook:.xml=.html.db) +%.html.db: %.xml $(chapters) + $(AM_V_GEN)$(XSLTPROC) $(XSLT_HTML_FLAGS) $< + +shelf_DATA += $(docbook:.xml=.pdf.db) +%.pdf.db: %.xml $(chapters) + $(AM_V_GEN)$(XSLTPROC) $(XSLT_PDF_FLAGS) $< + +endif HAVE_XSLTPROC +endif HAVE_STYLESHEETS +endif HAVE_XMLTO + +CLEANFILES = $(shelf_DATA) diff --git a/include/X11/SM/SM.h b/include/X11/SM/SM.h old mode 100755 new mode 100644 diff --git a/include/X11/SM/SMlib.h b/include/X11/SM/SMlib.h old mode 100755 new mode 100644 index 86be664..9645295 --- a/include/X11/SM/SMlib.h +++ b/include/X11/SM/SMlib.h @@ -168,7 +168,7 @@ typedef struct { typedef Status (*SmsRegisterClientProc) ( SmsConn /* smsConn */, SmPointer /* managerData */, - char * /* previousId */ + char * /* previousId */ ); typedef void (*SmsInteractRequestProc) ( @@ -445,8 +445,8 @@ extern IceConn SmcGetIceConnection ( ); extern Status SmsInitialize ( - char * /* vendor */, - char * /* release */, + const char * /* vendor */, + const char * /* release */, SmsNewClientProc /* newClientProc */, SmPointer /* managerData */, IceHostBasedAuthProc /* hostBasedAuthProc */, diff --git a/include/X11/SM/SMproto.h b/include/X11/SM/SMproto.h old mode 100755 new mode 100644 diff --git a/packaging/libSM.spec b/packaging/libSM.spec index d2bbe5c..8ca75dd 100644 --- a/packaging/libSM.spec +++ b/packaging/libSM.spec @@ -1,66 +1,65 @@ -Name: libSM -Summary: X.Org X11 libSM runtime library -Version: 1.2.0 -Release: 2.23 -Group: System/Libraries -License: MIT -URL: http://www.x.org -Source0: http://xorg.freedesktop.org/releases/individual/lib/%{name}-%{version}.tar.gz -Requires(post): /sbin/ldconfig -Requires(postun): /sbin/ldconfig -BuildRequires: pkgconfig(uuid) -BuildRequires: pkgconfig(xtrans) -BuildRequires: pkgconfig(ice) +Summary: X.Org X11 SM runtime library +Name: libSM +Version: 1.2.1 +Release: 1 +License: MIT +Group: System Environment/Libraries +URL: http://www.x.org + +Source0: %{name}-%{version}.tar.gz + +BuildRequires: pkgconfig BuildRequires: pkgconfig(xproto) BuildRequires: pkgconfig(xorg-macros) - +BuildRequires: xorg-x11-xtrans-devel >= 1.0.3-4 +BuildRequires: libICE-devel +BuildRequires: libuuid-devel %description -X11 Session Management library. - +The X.Org X11 SM (Session Management) runtime library. %package devel -Summary: X.Org X11 libSM development package -Group: Development/Libraries -Requires: %{name} = %{version}-%{release} +Summary: X.Org X11 SM development package +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} +Requires: libICE-devel %description devel -The X.org X11 SM development package. - +The X.Org X11 SM (Session Management) development package. %prep -%setup -q -n %{name}-%{version} - +%setup -q %build -%reconfigure --disable-static --with-libuuid=no - +%reconfigure --with-libuuid --disable-static \ + LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed" make %{?jobs:-j%jobs} %install -rm -rf %{buildroot} -%make_install - +rm -rf $RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT +# We intentionally don't ship *.la files +rm -f $RPM_BUILD_ROOT%{_libdir}/*.la -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig - +# we %%doc these ourselves, later, and only the text versions +rm -rf $RPM_BUILD_ROOT%{_docdir} +%remove_docs +%clean +rm -rf $RPM_BUILD_ROOT +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig %files %defattr(-,root,root,-) -%doc AUTHORS COPYING README +%doc AUTHORS COPYING ChangeLog %{_libdir}/libSM.so.6 -%{_libdir}/libSM.so.6.0.1 -%exclude /usr/share/doc/libSM/SMlib.xml -%exclude /usr/share/doc/libSM/xsmp.xml - +%{_libdir}/libSM.so.6.* %files devel %defattr(-,root,root,-) @@ -70,4 +69,3 @@ rm -rf %{buildroot} %{_includedir}/X11/SM/SMproto.h %{_libdir}/libSM.so %{_libdir}/pkgconfig/sm.pc - diff --git a/sm.pc.in b/sm.pc.in index ab1261e..3c82387 100644 --- a/sm.pc.in +++ b/sm.pc.in @@ -6,7 +6,7 @@ includedir=@includedir@ Name: SM Description: X Session Management Library Version: @PACKAGE_VERSION@ -Requires: ice xproto -Requires.private: ice +Requires: +Requires.private: ice xproto Cflags: -I${includedir} Libs: -L${libdir} -lSM diff --git a/src/Makefile.am b/src/Makefile.am old mode 100755 new mode 100644 index 1098679..a094ccc --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,7 @@ lib_LTLIBRARIES=libSM.la -AM_CFLAGS= $(CWARNFLAGS) -I${top_srcdir}/include $(SM_CFLAGS) $(XTRANS_CFLAGS) +AM_CPPFLAGS = -I${top_srcdir}/include +AM_CFLAGS = $(CWARNFLAGS) $(SM_CFLAGS) if WITH_LIBUUID AM_CFLAGS += $(LIBUUID_CFLAGS) -DHAVE_LIBUUID @@ -8,7 +9,7 @@ endif libSM_la_LDFLAGS = -version-number 6:0:1 -no-undefined -libSM_la_LIBADD = $(SM_LIBS) $(XTRANS_LIBS) +libSM_la_LIBADD = $(SM_LIBS) if WITH_LIBUUID libSM_la_LIBADD += $(LIBUUID_LIBS) diff --git a/src/SMlibint.h b/src/SMlibint.h old mode 100755 new mode 100644 index a478b48..c788739 --- a/src/SMlibint.h +++ b/src/SMlibint.h @@ -236,7 +236,7 @@ in this Software without prior written authorization from The Open Group. #define EXTRACT_ARRAY8(_pBuf, _swap, _len, _array8) \ { \ EXTRACT_CARD32 (_pBuf, _swap, _len); \ - _array8 = (char *) malloc (_len + 1); \ + _array8 = malloc (_len + 1); \ memcpy (_array8, _pBuf, _len); \ _array8[_len] = '\0'; \ _pBuf += _len + PAD64 (4 + _len); \ @@ -246,7 +246,7 @@ in this Software without prior written authorization from The Open Group. { \ CARD32 _len; \ EXTRACT_CARD32 (_pBuf, _swap, _len); \ - _string = (char *) malloc (_len + 1); \ + _string = malloc (_len + 1); \ memcpy (_string, _pBuf, _len); \ _string[_len] = '\0'; \ _pBuf += _len + PAD64 (4 + _len); \ @@ -257,15 +257,15 @@ in this Software without prior written authorization from The Open Group. int _i, _j; \ EXTRACT_CARD32 (_pBuf, _swap, _count); \ _pBuf += 4; \ - _props = (SmProp **) malloc (_count * sizeof (SmProp *)); \ + _props = malloc (_count * sizeof (SmProp *)); \ for (_i = 0; _i < _count; _i++) \ { \ - _props[_i] = (SmProp *) malloc (sizeof (SmProp)); \ + _props[_i] = malloc (sizeof (SmProp)); \ EXTRACT_ARRAY8_AS_STRING (_pBuf, _swap, _props[_i]->name); \ EXTRACT_ARRAY8_AS_STRING (_pBuf, _swap, _props[_i]->type); \ EXTRACT_CARD32 (_pBuf, _swap, _props[_i]->num_vals); \ _pBuf += 4; \ - _props[_i]->vals = (SmPropValue *) malloc ( \ + _props[_i]->vals = malloc ( \ _props[_i]->num_vals * sizeof (SmPropValue)); \ for (_j = 0; _j < _props[_i]->num_vals; _j++) \ { \ diff --git a/src/sm_auth.c b/src/sm_auth.c old mode 100755 new mode 100644 diff --git a/src/sm_client.c b/src/sm_client.c index a5c714f..23d8e32 100644 --- a/src/sm_client.c +++ b/src/sm_client.c @@ -138,7 +138,7 @@ SmcOpenConnection(char *networkIdsList, SmPointer context, return (NULL); } - if ((smcConn = (SmcConn) malloc (sizeof (struct _SmcConn))) == NULL) + if ((smcConn = malloc (sizeof (struct _SmcConn))) == NULL) { if (errorStringRet && errorLength > 0) { strncpy (errorStringRet, "Can't malloc", errorLength); @@ -158,7 +158,7 @@ SmcOpenConnection(char *networkIdsList, SmPointer context, setupstat == IceProtocolSetupIOError) { IceCloseConnection (iceConn); - free ((char *) smcConn); + free (smcConn); return (NULL); } else if (setupstat == IceProtocolAlreadyActive) @@ -169,7 +169,7 @@ SmcOpenConnection(char *networkIdsList, SmPointer context, * may not already have XSMP active on it. */ - free ((char *) smcConn); + free (smcConn); if (errorStringRet && errorLength > 0) { strncpy (errorStringRet, "Internal error in IceOpenConnection", errorLength); @@ -235,7 +235,7 @@ SmcOpenConnection(char *networkIdsList, SmPointer context, } free (smcConn->vendor); free (smcConn->release); - free ((char *) smcConn); + free (smcConn); return (NULL); } @@ -249,10 +249,7 @@ SmcOpenConnection(char *networkIdsList, SmPointer context, *clientIdRet = reply.client_id; - smcConn->client_id = (char *) malloc ( - strlen (*clientIdRet) + 1); - - strcpy (smcConn->client_id, *clientIdRet); + smcConn->client_id = strdup (*clientIdRet); } else { @@ -308,7 +305,7 @@ SmcCloseConnection(SmcConn smcConn, int count, char **reasonMsgs) pData += 4; for (i = 0; i < count; i++) - STORE_ARRAY8 (pData, strlen (reasonMsgs[i]), reasonMsgs[i]); + STORE_ARRAY8 (pData, strlen (reasonMsgs[i]), reasonMsgs[i]); IceFlush (iceConn); @@ -333,13 +330,13 @@ SmcCloseConnection(SmcConn smcConn, int count, char **reasonMsgs) while (ptr) { next = ptr->next; - free ((char *) ptr); + free (ptr); ptr = next; } - + } - free ((char *) smcConn); + free (smcConn); if (closeStatus == IceClosedNow) statusRet = SmcClosedNow; @@ -408,7 +405,7 @@ SmcDeleteProperties(SmcConn smcConn, int numProps, char **propNames) pData += 4; for (i = 0; i < numProps; i++) - STORE_ARRAY8 (pData, strlen (propNames[i]), propNames[i]); + STORE_ARRAY8 (pData, strlen (propNames[i]), propNames[i]); IceFlush (iceConn); } @@ -422,8 +419,7 @@ SmcGetProperties(SmcConn smcConn, SmcPropReplyProc propReplyProc, IceConn iceConn = smcConn->iceConn; _SmcPropReplyWait *wait, *ptr; - if ((wait = (_SmcPropReplyWait *) malloc ( - sizeof (_SmcPropReplyWait))) == NULL) + if ((wait = malloc (sizeof (_SmcPropReplyWait))) == NULL) { return (0); } @@ -457,8 +453,7 @@ SmcInteractRequest(SmcConn smcConn, int dialogType, smInteractRequestMsg *pMsg; _SmcInteractWait *wait, *ptr; - if ((wait = (_SmcInteractWait *) malloc ( - sizeof (_SmcInteractWait))) == NULL) + if ((wait = malloc (sizeof (_SmcInteractWait))) == NULL) { return (0); } @@ -537,8 +532,7 @@ SmcRequestSaveYourselfPhase2(SmcConn smcConn, wait = smcConn->phase2_wait; else { - if ((wait = (_SmcPhase2Wait *) malloc ( - sizeof (_SmcPhase2Wait))) == NULL) + if ((wait = malloc (sizeof (_SmcPhase2Wait))) == NULL) { return (0); } diff --git a/src/sm_error.c b/src/sm_error.c old mode 100755 new mode 100644 index 0714943..29f6e45 --- a/src/sm_error.c +++ b/src/sm_error.c @@ -273,12 +273,12 @@ _SmsDefaultErrorHandler(SmsConn smsConn, Bool swap, int offendingMinorOpcode, -/* +/* * This procedure sets the Smc error handler to be the specified * routine. If NULL is passed in the default error handler is restored. * The function's return value is the previous error handler. */ - + SmcErrorHandler SmcSetErrorHandler(SmcErrorHandler handler) { @@ -294,12 +294,12 @@ SmcSetErrorHandler(SmcErrorHandler handler) -/* +/* * This procedure sets the Sms error handler to be the specified * routine. If NULL is passed in the default error handler is restored. * The function's return value is the previous error handler. */ - + SmsErrorHandler SmsSetErrorHandler(SmsErrorHandler handler) { diff --git a/src/sm_genid.c b/src/sm_genid.c old mode 100755 new mode 100644 index 2cd6d26..c6731d8 --- a/src/sm_genid.c +++ b/src/sm_genid.c @@ -1,6 +1,6 @@ /* -Copyright © 2002 Sun Microsystems, Inc. All rights reserved. +Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -53,15 +53,15 @@ in this Software without prior written authorization from The Open Group. */ #ifdef WIN32 -#define _WILLWINSOCK_ +# define _WILLWINSOCK_ #endif #ifdef HAVE_CONFIG_H -#include +# include #endif #include #include "SMlibint.h" #ifdef XTHREADS -#include +# include #endif #include @@ -70,39 +70,35 @@ in this Software without prior written authorization from The Open Group. #ifndef WIN32 -#if defined(TCPCONN) || defined(STREAMSCONN) -#ifndef Lynx -#include -#else -#include -#endif -#include -#include -#define XOS_USE_NO_LOCKING -#define X_INCLUDE_NETDB_H -#include -#endif +# if defined(TCPCONN) || defined(STREAMSCONN) +# include +# include +# include +# define XOS_USE_NO_LOCKING +# define X_INCLUDE_NETDB_H +# include +# endif #else /* WIN32 */ -#include -#include -#define X_INCLUDE_NETDB_H -#define XOS_USE_MTSAFE_NETDBAPI -#include +# include +# include +# define X_INCLUDE_NETDB_H +# define XOS_USE_MTSAFE_NETDBAPI +# include #endif /* WIN32 */ #ifdef MNX_TCPCONN -#include +# include -#define TCPCONN +# define TCPCONN #endif #if defined(HAVE_UUID_CREATE) -#include +# include #elif defined(HAVE_LIBUUID) -#include +# include #endif @@ -139,45 +135,45 @@ SmsGenerateClientID(SmsConn smsConn) temp[1] = '\0'; uuid_unparse_lower(uuid, &temp[1]); - if ((id = malloc (strlen (temp) + 1)) != NULL) - strcpy (id, temp); + id = strdup (temp); return id; #else -#if defined(TCPCONN) || defined(STREAMSCONN) +# if defined(TCPCONN) || defined(STREAMSCONN) static const char hex[] = "0123456789abcdef"; char hostname[256]; char address[64], *addr_ptr = address; char temp[256]; char *id; static int sequence = 0; - - if (gethostname (hostname, sizeof (hostname))) - return (NULL); - - { char* inet_addr; - char temp[4], *ptr1, *ptr2; + char *ptr1; unsigned char decimal[4]; int i, len; struct in_addr *haddr = NULL; -#if defined(IPv6) && defined(AF_INET6) +# if defined(IPv6) && defined(AF_INET6) struct addrinfo *ai, *first_ai; +# endif + + if (gethostname (hostname, sizeof (hostname))) + return (NULL); + +# if defined(IPv6) && defined(AF_INET6) if (getaddrinfo(hostname,NULL,NULL,&ai) != 0) return NULL; for (first_ai = ai; ai != NULL; ai = ai->ai_next) { - if ( (ai->ai_family == AF_INET) || (ai->ai_family == AF_INET6) ) + if ( (ai->ai_family == AF_INET) || (ai->ai_family == AF_INET6) ) break; } if (ai == NULL) { freeaddrinfo(first_ai); return NULL; - } + } if (ai->ai_family == AF_INET6) { unsigned char *cp = (unsigned char *) &((struct sockaddr_in6 *)ai->ai_addr)->sin6_addr.s6_addr; - + *addr_ptr++ = '6'; /* IPv6 address code */ for (i = 0 ; i < 16 ; i++) { @@ -189,51 +185,52 @@ SmsGenerateClientID(SmsConn smsConn) } else { /* Fall through to IPv4 address handling */ haddr = &((struct sockaddr_in *)ai->ai_addr)->sin_addr; -#else -#ifdef XTHREADS_NEEDS_BYNAMEPARAMS - _Xgethostbynameparams hparams; -#endif - struct hostent *hostp; - - if ((hostp = _XGethostbyname (hostname,hparams)) != NULL) - haddr = (struct in_addr *)(hostp->h_addr); - else - return NULL; -#endif - - inet_addr = inet_ntoa (*haddr); - for (i = 0, ptr1 = inet_addr; i < 3; i++) - { - ptr2 = strchr (ptr1, '.'); - len = ptr2 - ptr1; - if (!ptr2 || len > 3) { -#if defined(IPv6) && defined(AF_INET6) - freeaddrinfo(first_ai); -#endif - return (NULL); +# else +# ifdef XTHREADS_NEEDS_BYNAMEPARAMS + _Xgethostbynameparams hparams; +# endif + struct hostent *hostp; + + if ((hostp = _XGethostbyname (hostname,hparams)) != NULL) + haddr = (struct in_addr *)(hostp->h_addr); + else + return NULL; +# endif + + inet_addr = inet_ntoa (*haddr); + for (i = 0, ptr1 = inet_addr; i < 3; i++) + { + char temp4[4]; + char *ptr2 = strchr (ptr1, '.'); + + len = ptr2 - ptr1; + if (!ptr2 || len > 3) { +# if defined(IPv6) && defined(AF_INET6) + freeaddrinfo(first_ai); +# endif + return (NULL); + } + strncpy (temp4, ptr1, len); + temp4[len] = '\0'; + decimal[i] = atoi (temp4); + ptr1 = ptr2 + 1; } - strncpy (temp, ptr1, len); - temp[len] = '\0'; - decimal[i] = atoi (temp); - ptr1 = ptr2 + 1; - } - decimal[3] = atoi (ptr1); + decimal[3] = atoi (ptr1); - *addr_ptr++ = '1'; + *addr_ptr++ = '1'; - for (i = 0; i < 4; i++) { - *addr_ptr++ = hex[decimal[i] >> 4]; - *addr_ptr++ = hex[decimal[i] & 0x0f]; - } + for (i = 0; i < 4; i++) { + *addr_ptr++ = hex[decimal[i] >> 4]; + *addr_ptr++ = hex[decimal[i] & 0x0f]; + } - *addr_ptr++ = '\0'; + *addr_ptr++ = '\0'; -#if defined(IPv6) && defined(AF_INET6) +# if defined(IPv6) && defined(AF_INET6) } freeaddrinfo(first_ai); -#endif - } +# endif sprintf (temp, "1%s%.13ld%.10ld%.4d", address, (long)time((Time_t*)0), (long)getpid(), sequence); @@ -241,12 +238,11 @@ SmsGenerateClientID(SmsConn smsConn) if (++sequence > 9999) sequence = 0; - if ((id = malloc (strlen (temp) + 1)) != NULL) - strcpy (id, temp); + id = strdup (temp); return (id); -#else +# else return (NULL); -#endif +# endif #endif } diff --git a/src/sm_manager.c b/src/sm_manager.c old mode 100755 new mode 100644 index 14b2bea..7a11a33 --- a/src/sm_manager.c +++ b/src/sm_manager.c @@ -68,12 +68,11 @@ _SmsProtocolSetupProc (IceConn iceConn, * Allocate new SmsConn. */ - if ((smsConn = (SmsConn) malloc (sizeof (struct _SmsConn))) == NULL) + if ((smsConn = malloc (sizeof (struct _SmsConn))) == NULL) { const char *str = "Memory allocation failed"; - if ((*failureReasonRet = (char *) malloc (strlen (str) + 1)) != NULL) - strcpy (*failureReasonRet, str); + *failureReasonRet = strdup (str); return (0); } @@ -111,7 +110,8 @@ _SmsProtocolSetupProc (IceConn iceConn, Status -SmsInitialize(char *vendor, char *release, SmsNewClientProc newClientProc, +SmsInitialize(const char *vendor, const char *release, + SmsNewClientProc newClientProc, SmPointer managerData, IceHostBasedAuthProc hostBasedAuthProc, int errorLength, char *errorStringRet) { @@ -187,13 +187,11 @@ SmsRegisterClientReply(SmsConn smsConn, char *clientId) smRegisterClientReplyMsg *pMsg; char *pData; - if ((smsConn->client_id = (char *) malloc (strlen (clientId) + 1)) == NULL) + if ((smsConn->client_id = strdup (clientId)) == NULL) { return (0); } - strcpy (smsConn->client_id, clientId); - extra = ARRAY8_BYTES (strlen (clientId)); IceGetHeaderExtra (iceConn, _SmsOpcode, SM_RegisterClientReply, @@ -338,5 +336,5 @@ SmsCleanUp(SmsConn smsConn) if (smsConn->client_id) free (smsConn->client_id); - free ((char *) smsConn); + free (smsConn); } diff --git a/src/sm_misc.c b/src/sm_misc.c old mode 100755 new mode 100644 index bdef3dd..83d1259 --- a/src/sm_misc.c +++ b/src/sm_misc.c @@ -54,11 +54,11 @@ SmFreeProperty(SmProp *prop) { for (i = 0; i < prop->num_vals; i++) if (prop->vals[i].value) - free ((char *) prop->vals[i].value); - free ((char *) prop->vals); + free (prop->vals[i].value); + free (prop->vals); } - free ((char *) prop); + free (prop); } } @@ -77,7 +77,7 @@ SmFreeReasons(int count, char **reasonMsgs) for (i = 0; i < count; i++) free (reasonMsgs[i]); - free ((char *) reasonMsgs); + free (reasonMsgs); } } @@ -104,33 +104,21 @@ SmcProtocolRevision(SmcConn smcConn) char * SmcVendor(SmcConn smcConn) { - char *string = (char *) malloc (strlen (smcConn->vendor) + 1); - - strcpy (string, smcConn->vendor); - - return (string); + return strdup(smcConn->vendor); } char * SmcRelease(SmcConn smcConn) { - char *string = (char *) malloc (strlen (smcConn->release) + 1); - - strcpy (string, smcConn->release); - - return (string); + return strdup(smcConn->release); } char * SmcClientID(SmcConn smcConn) { - char *clientId = (char *) malloc (strlen (smcConn->client_id) + 1); - - strcpy (clientId, smcConn->client_id); - - return (clientId); + return strdup(smcConn->client_id); } @@ -163,11 +151,7 @@ SmsProtocolRevision(SmsConn smsConn) char * SmsClientID(SmsConn smsConn) { - char *clientId = (char *) malloc (strlen (smsConn->client_id) + 1); - - strcpy (clientId, smsConn->client_id); - - return (clientId); + return strdup(smsConn->client_id); } diff --git a/src/sm_process.c b/src/sm_process.c old mode 100755 new mode 100644 index c7c7abe..651ddef --- a/src/sm_process.c +++ b/src/sm_process.c @@ -152,7 +152,7 @@ _SmcProcessMessage(IceConn iceConn, IcePointer clientData, int opcode, { smRegisterClientReplyMsg *pMsg; char *pData, *pStart; - _SmcRegisterClientReply *reply = + _SmcRegisterClientReply *reply = (_SmcRegisterClientReply *) (replyWait->reply); #if 0 /* No-op */ @@ -267,7 +267,7 @@ _SmcProcessMessage(IceConn iceConn, IcePointer clientData, int opcode, (*smcConn->phase2_wait->phase2_proc) (smcConn, smcConn->phase2_wait->client_data); - free ((char *) smcConn->phase2_wait); + free (smcConn->phase2_wait); smcConn->phase2_wait = NULL; } break; @@ -290,7 +290,7 @@ _SmcProcessMessage(IceConn iceConn, IcePointer clientData, int opcode, (*smcConn->interact_waits->interact_proc) (smcConn, smcConn->interact_waits->client_data); - free ((char *) smcConn->interact_waits); + free (smcConn->interact_waits); smcConn->interact_waits = next; } break; @@ -393,7 +393,7 @@ _SmcProcessMessage(IceConn iceConn, IcePointer clientData, int opcode, (*smcConn->prop_reply_waits->prop_reply_proc) (smcConn, smcConn->prop_reply_waits->client_data, numProps, props); - free ((char *) smcConn->prop_reply_waits); + free (smcConn->prop_reply_waits); smcConn->prop_reply_waits = next; IceDisposeCompleteMessage (iceConn, pStart); @@ -752,7 +752,7 @@ _SmsProcessMessage(IceConn iceConn, IcePointer clientData, int opcode, pData = pStart + 8; - reasonMsgs = (char **) malloc (count * sizeof (char *)); + reasonMsgs = malloc (count * sizeof (char *)); for (i = 0; i < count; i++) EXTRACT_ARRAY8_AS_STRING (pData, swap, reasonMsgs[i]); @@ -770,7 +770,7 @@ _SmsProcessMessage(IceConn iceConn, IcePointer clientData, int opcode, char *pData, *pStart; SmProp **props = NULL; int numProps; - + #if 0 /* No-op */ CHECK_AT_LEAST_SIZE (iceConn, _SmsOpcode, opcode, length, SIZEOF (smSetPropertiesMsg), IceFatalToProtocol); @@ -839,7 +839,7 @@ _SmsProcessMessage(IceConn iceConn, IcePointer clientData, int opcode, pData = pStart + 8; - propNames = (char **) malloc (count * sizeof (char *)); + propNames = malloc (count * sizeof (char *)); for (i = 0; i < count; i++) EXTRACT_ARRAY8_AS_STRING (pData, swap, propNames[i]); -- 2.7.4