<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[Freeswitch-trunk][16021] </title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<div id="header">FreeSWITCH Subversion</div>
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://fisheye.freeswitch.org/changelog/FreeSWITCH?cs=16021">16021</a></dd>
<dt>Author</dt> <dd>mikej</dd>
<dt>Date</dt> <dd>2009-12-22 13:10:16 -0600 (Tue, 22 Dec 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>inital addition of libuuid to tree</pre>

<h3>Added Paths</h3>
<ul>
<li>freeswitch/trunk/libs/uuid/</li>
<li><a href="#freeswitchtrunklibsuuidAUTHORS">freeswitch/trunk/libs/uuid/AUTHORS</a></li>
<li><a href="#freeswitchtrunklibsuuidBINDINGS">freeswitch/trunk/libs/uuid/BINDINGS</a></li>
<li><a href="#freeswitchtrunklibsuuidChangeLog">freeswitch/trunk/libs/uuid/ChangeLog</a></li>
<li><a href="#freeswitchtrunklibsuuidHISTORY">freeswitch/trunk/libs/uuid/HISTORY</a></li>
<li><a href="#freeswitchtrunklibsuuidINSTALL">freeswitch/trunk/libs/uuid/INSTALL</a></li>
<li><a href="#freeswitchtrunklibsuuidMANIFEST">freeswitch/trunk/libs/uuid/MANIFEST</a></li>
<li><a href="#freeswitchtrunklibsuuidMakefilePL">freeswitch/trunk/libs/uuid/Makefile.PL</a></li>
<li><a href="#freeswitchtrunklibsuuidMakefilein">freeswitch/trunk/libs/uuid/Makefile.in</a></li>
<li><a href="#freeswitchtrunklibsuuidNEWS">freeswitch/trunk/libs/uuid/NEWS</a></li>
<li><a href="#freeswitchtrunklibsuuidOVERVIEW">freeswitch/trunk/libs/uuid/OVERVIEW</a></li>
<li><a href="#freeswitchtrunklibsuuidPORTING">freeswitch/trunk/libs/uuid/PORTING</a></li>
<li><a href="#freeswitchtrunklibsuuidREADME">freeswitch/trunk/libs/uuid/README</a></li>
<li><a href="#freeswitchtrunklibsuuidSEEALSO">freeswitch/trunk/libs/uuid/SEEALSO</a></li>
<li><a href="#freeswitchtrunklibsuuidTHANKS">freeswitch/trunk/libs/uuid/THANKS</a></li>
<li><a href="#freeswitchtrunklibsuuidTODO">freeswitch/trunk/libs/uuid/TODO</a></li>
<li><a href="#freeswitchtrunklibsuuidUSERS">freeswitch/trunk/libs/uuid/USERS</a></li>
<li><a href="#freeswitchtrunklibsuuidacincludem4">freeswitch/trunk/libs/uuid/acinclude.m4</a></li>
<li><a href="#freeswitchtrunklibsuuidconfighin">freeswitch/trunk/libs/uuid/config.h.in</a></li>
<li><a href="#freeswitchtrunklibsuuidconfigureac">freeswitch/trunk/libs/uuid/configure.ac</a></li>
<li>freeswitch/trunk/libs/uuid/perl/</li>
<li><a href="#freeswitchtrunklibsuuidperlMANIFEST">freeswitch/trunk/libs/uuid/perl/MANIFEST</a></li>
<li><a href="#freeswitchtrunklibsuuidperlMakefilePL">freeswitch/trunk/libs/uuid/perl/Makefile.PL</a></li>
<li><a href="#freeswitchtrunklibsuuidperluuidpm">freeswitch/trunk/libs/uuid/perl/uuid.pm</a></li>
<li><a href="#freeswitchtrunklibsuuidperluuidpod">freeswitch/trunk/libs/uuid/perl/uuid.pod</a></li>
<li><a href="#freeswitchtrunklibsuuidperluuidtm">freeswitch/trunk/libs/uuid/perl/uuid.tm</a></li>
<li><a href="#freeswitchtrunklibsuuidperluuidts">freeswitch/trunk/libs/uuid/perl/uuid.ts</a></li>
<li><a href="#freeswitchtrunklibsuuidperluuidxs">freeswitch/trunk/libs/uuid/perl/uuid.xs</a></li>
<li><a href="#freeswitchtrunklibsuuidperluuid_compatpm">freeswitch/trunk/libs/uuid/perl/uuid_compat.pm</a></li>
<li><a href="#freeswitchtrunklibsuuidperluuid_compatpod">freeswitch/trunk/libs/uuid/perl/uuid_compat.pod</a></li>
<li><a href="#freeswitchtrunklibsuuidperluuid_compatts">freeswitch/trunk/libs/uuid/perl/uuid_compat.ts</a></li>
<li>freeswitch/trunk/libs/uuid/pgsql/</li>
<li><a href="#freeswitchtrunklibsuuidpgsqlMakefile">freeswitch/trunk/libs/uuid/pgsql/Makefile</a></li>
<li><a href="#freeswitchtrunklibsuuidpgsqluuidc">freeswitch/trunk/libs/uuid/pgsql/uuid.c</a></li>
<li><a href="#freeswitchtrunklibsuuidpgsqluuidsqlin">freeswitch/trunk/libs/uuid/pgsql/uuid.sql.in</a></li>
<li><a href="#freeswitchtrunklibsuuidpgsqluuidtxt">freeswitch/trunk/libs/uuid/pgsql/uuid.txt</a></li>
<li>freeswitch/trunk/libs/uuid/php/</li>
<li><a href="#freeswitchtrunklibsuuidphpMakefilelocal">freeswitch/trunk/libs/uuid/php/Makefile.local</a></li>
<li><a href="#freeswitchtrunklibsuuidphpconfigm4">freeswitch/trunk/libs/uuid/php/config.m4</a></li>
<li><a href="#freeswitchtrunklibsuuidphppackagexml">freeswitch/trunk/libs/uuid/php/package.xml</a></li>
<li><a href="#freeswitchtrunklibsuuidphpuuidc">freeswitch/trunk/libs/uuid/php/uuid.c</a></li>
<li><a href="#freeswitchtrunklibsuuidphpuuidphp4">freeswitch/trunk/libs/uuid/php/uuid.php4</a></li>
<li><a href="#freeswitchtrunklibsuuidphpuuidphp5">freeswitch/trunk/libs/uuid/php/uuid.php5</a></li>
<li><a href="#freeswitchtrunklibsuuidphpuuidts">freeswitch/trunk/libs/uuid/php/uuid.ts</a></li>
<li><a href="#freeswitchtrunklibsuuidshtool">freeswitch/trunk/libs/uuid/shtool</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid3">freeswitch/trunk/libs/uuid/uuid++.3</a></li>
<li><a href="#freeswitchtrunklibsuuiduuidcc">freeswitch/trunk/libs/uuid/uuid++.cc</a></li>
<li><a href="#freeswitchtrunklibsuuiduuidhh">freeswitch/trunk/libs/uuid/uuid++.hh</a></li>
<li><a href="#freeswitchtrunklibsuuiduuidpod">freeswitch/trunk/libs/uuid/uuid++.pod</a></li>
<li><a href="#freeswitchtrunklibsuuiduuidconfig1">freeswitch/trunk/libs/uuid/uuid-config.1</a></li>
<li><a href="#freeswitchtrunklibsuuiduuidconfigin">freeswitch/trunk/libs/uuid/uuid-config.in</a></li>
<li><a href="#freeswitchtrunklibsuuiduuidconfigpod">freeswitch/trunk/libs/uuid/uuid-config.pod</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid1">freeswitch/trunk/libs/uuid/uuid.1</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid3">freeswitch/trunk/libs/uuid/uuid.3</a></li>
<li><a href="#freeswitchtrunklibsuuiduuidac">freeswitch/trunk/libs/uuid/uuid.ac</a></li>
<li><a href="#freeswitchtrunklibsuuiduuidc">freeswitch/trunk/libs/uuid/uuid.c</a></li>
<li><a href="#freeswitchtrunklibsuuiduuidhin">freeswitch/trunk/libs/uuid/uuid.h.in</a></li>
<li><a href="#freeswitchtrunklibsuuiduuidpcin">freeswitch/trunk/libs/uuid/uuid.pc.in</a></li>
<li><a href="#freeswitchtrunklibsuuiduuidpod">freeswitch/trunk/libs/uuid/uuid.pod</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_ach">freeswitch/trunk/libs/uuid/uuid_ac.h</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_bmh">freeswitch/trunk/libs/uuid/uuid_bm.h</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_clic">freeswitch/trunk/libs/uuid/uuid_cli.c</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_clipod">freeswitch/trunk/libs/uuid/uuid_cli.pod</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_dcec">freeswitch/trunk/libs/uuid/uuid_dce.c</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_dceh">freeswitch/trunk/libs/uuid/uuid_dce.h</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_macc">freeswitch/trunk/libs/uuid/uuid_mac.c</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_mach">freeswitch/trunk/libs/uuid/uuid_mac.h</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_md5c">freeswitch/trunk/libs/uuid/uuid_md5.c</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_md5h">freeswitch/trunk/libs/uuid/uuid_md5.h</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_prngc">freeswitch/trunk/libs/uuid/uuid_prng.c</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_prngh">freeswitch/trunk/libs/uuid/uuid_prng.h</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_sha1c">freeswitch/trunk/libs/uuid/uuid_sha1.c</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_sha1h">freeswitch/trunk/libs/uuid/uuid_sha1.h</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_strc">freeswitch/trunk/libs/uuid/uuid_str.c</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_strh">freeswitch/trunk/libs/uuid/uuid_str.h</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_timec">freeswitch/trunk/libs/uuid/uuid_time.c</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_timeh">freeswitch/trunk/libs/uuid/uuid_time.h</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_ui128c">freeswitch/trunk/libs/uuid/uuid_ui128.c</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_ui128h">freeswitch/trunk/libs/uuid/uuid_ui128.h</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_ui64c">freeswitch/trunk/libs/uuid/uuid_ui64.c</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_ui64h">freeswitch/trunk/libs/uuid/uuid_ui64.h</a></li>
<li><a href="#freeswitchtrunklibsuuiduuid_versh">freeswitch/trunk/libs/uuid/uuid_vers.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="freeswitchtrunklibsuuidAUTHORS"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/AUTHORS (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/AUTHORS                                (rev 0)
+++ freeswitch/trunk/libs/uuid/AUTHORS        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+   _        ___  ____ ____  ____                _     _
+  |_|_ _   / _ \/ ___/ ___||  _ \   _   _ _   _(_) __| |
+  _|_||_| | | | \___ \___ \| |_) | | | | | | | | |/ _` |
+ |_||_|_| | |_| |___) |__) |  __/  | |_| | |_| | | (_| |
+  |_|_|_|  \___/|____/____/|_|      \__,_|\__,_|_|\__,_|
+
+  OSSP uuid - Universally Unique Identifier
+
+  AUTHORS
+
+  This is a list of authors who have written
+  or edited major parts of the OSSP uuid sources.
+
+  Ralf S. Engelschall   &lt;rse@engelschall.com&gt;
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidBINDINGS"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/BINDINGS (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/BINDINGS                                (rev 0)
+++ freeswitch/trunk/libs/uuid/BINDINGS        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+
+   _        ___  ____ ____  ____                _     _
+  |_|_ _   / _ \/ ___/ ___||  _ \   _   _ _   _(_) __| |
+  _|_||_| | | | \___ \___ \| |_) | | | | | | | | |/ _` |
+ |_||_|_| | |_| |___) |__) |  __/  | |_| | |_| | | (_| |
+  |_|_|_|  \___/|____/____/|_|      \__,_|\__,_|_|\__,_|
+
+  OSSP uuid - Universally Unique Identifier
+
+  LANGUAGE BINDINGS
+
+  Various programming language bindings exist for OSSP uuid.
+  The following is the list of known bindings:
+
+  o C
+    (native API)
+
+  o C++
+    (addon API; part of the OSSP uuid distribution; see uuid++.* files) 
+
+  o Perl
+    (addon API; part of the OSSP uuid distribution; see perl/ directory) 
+
+  o PHP
+    (addon API; part of the OSSP uuid distribution; see php/ directory) 
+
+  o PostgreSQL
+    (addon API; part of the OSSP uuid distribution; see pgsql/ directory) 
+
+  o GNU Guile GEE (Scheme)
+    https://gna.org/projects/gee
+
+  o Chicken (Scheme)
+    http://www.call-with-current-continuation.org/eggs/uuid-ossp.html
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidChangeLog"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/ChangeLog (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/ChangeLog                                (rev 0)
+++ freeswitch/trunk/libs/uuid/ChangeLog        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,624 @@
</span><ins>+   _        ___  ____ ____  ____                _     _
+  |_|_ _   / _ \/ ___/ ___||  _ \   _   _ _   _(_) __| |
+  _|_||_| | | | \___ \___ \| |_) | | | | | | | | |/ _` |
+ |_||_|_| | |_| |___) |__) |  __/  | |_| | |_| | | (_| |
+  |_|_|_|  \___/|____/____/|_|      \__,_|\__,_|_|\__,_|
+
+  OSSP uuid - Universally Unique Identifier
+
+  CHANGELOG
+
+  This is a list of all changes to OSSP uuid.
+  For a more brief summary please have a look at the NEWS file.
+
+  Changes between 1.6.1 and 1.6.2 (21-Feb-2008 to 04-Jul-2008)
+
+   o Adjust &quot;devtool.func&quot; for latest GNU Libtool compatibility.
+     [Ralf S. Engelschall]
+
+   o Improve PRNG under Win32.
+     [Hiroshi Saito]
+
+   o Consistently annotate &quot;RFC-XXXX&quot; with &quot;IETF&quot; to clearly
+     indicate from which standards body this comes from.
+     [Ralf S. Engelschall]
+
+   o Resolve namespace conflicts of recently introduced time_xxx()
+     functions by using a propoer &quot;uuid_&quot; prefix.
+     [Ralf S. Engelschall]
+
+   o Remove unused &quot;struct timezone&quot; from time_gettimeofday() in
+     order to simplify portability.
+     [Ralf S. Engelschall]
+
+   o Add support for POSIX clock_gettime(3) in case the Unix/POSIX
+     gettimeofday(3) is not available.
+     [Ralf S. Engelschall]
+
+   o Upgrade build environment to GNU autoconf 2.62.
+     [Ralf S. Engelschall]
+
+   o Upgrade build environment to GNU libtool 2.2.4.
+     [Ralf S. Engelschall]
+
+  Changes between 1.6.0 and 1.6.1 (19-May-2007 to 21-Feb-2008)
+
+   o Port to Win32 API.
+     [Hiroshi Saito, Wu Yongwei, Ralf S. Engelschall]
+
+   o Adjust copyright messages for new year 2008.
+     [Ralf S. Engelschall]
+   
+   o Fix __VA_COPY_USE_{CSP,CPP} fallback macros for va_copy.
+     [Mark A. Lindner &lt;mark.a.lindner@gmail.com&gt;]
+
+   o PostgreSQL bindings: use SET_VARSIZE() instead
+     of assigning to bytea-&gt;v_len under PostgreSQL &gt;= 8.3
+     [Ralf S. Engelschall]
+
+   o Upgrade build environment to GNU libtool 1.5.26
+     [Ralf S. Engelschall]
+
+  Changes between 1.5.1 and 1.6.0 (31-Jul-2006 to 19-May-2007)
+
+   o Expand unused &quot;datarootdir&quot; in Makefile.in and uuid-config.in to
+     make newer GNU autoconf versions happy.
+     [Ralf S. Engelschall]
+
+   o Upgrade build environment to GNU shtool 2.0.7
+     [Ralf S. Engelschall]
+
+   o Make GNU autoconf procedure of PHP binding more robust by using
+     -Wl,-Bsymbolic only on platforms where uuid_create(3) actually
+     exists and where -Wl,-Bsymbolic is really accepted by the tool
+     chain. This especially unbreaks MacOS X.
+     [Ralf S. Engelschall]
+
+   o Fix &quot;uuid_export&quot; function in PHP bindings under
+     UUID_FMT_SIV, UUID_FMT_STR and UUID_FMT_TXT where the
+     NUL-termination character should be not passed back to PHP.
+     [Neil Caunt &lt;retardis@gmail.com&gt;, Ralf S. Engelschall]
+
+   o Adjust copyright messages for new year 2007.
+     [Ralf S. Engelschall]
+
+   o Upgrade build environment to GNU autoconf 2.61
+     [Ralf S. Engelschall]
+
+   o Disable PostgreSQL &quot;(CSTRING AS uuid)&quot; and &quot;(uuid AS CSTRING)&quot;
+     CASTS as PostgreSQL 8.2 and higher explicitly disallow this.
+     [David Wheeler &lt;david@kineticode.com&gt;, Ralf S. Engelschall]
+
+   o Fix PostgreSQL bindings by mapping the correct DSO symbol
+     to the functions &quot;uuid_send&quot; and &quot;uuid_recv&quot;.
+     [Ralf S. Engelschall]
+
+   o Silence PostgreSQL processing messages
+     [David Wheeler &lt;david@kineticode.com&gt;]
+
+   o Support MacOS X (aka Darwin) in PostgreSQL bindings by passing
+     a &quot;-bundle_loader&quot; option to the linker in order to resolve the
+     &quot;undefined symbols&quot; problem.
+     [David Wheeler &lt;david@kineticode.com&gt;, Ralf S. Engelschall]
+
+   o Pass the correct type to PostgreSQL's errmsg().
+     [David Wheeler &lt;david@kineticode.com&gt;, Ralf S. Engelschall]
+
+   o Added PostgreSQL 8.2 PG_MODULE_MAGIC support.
+     [David Wheeler &lt;david@kineticode.com&gt;]
+
+   o Fix the Data::UUID::to_b64string() function of the Perl backward
+     compatibility API: an empty string was not supplied as the EOL
+     marker to MIME::Base64::encode_base64() and hence the returned
+     string ended with a newline character (which in turn breaks many
+     applications using Data::UUID).
+     [Piotr Roszatycki &lt;dexter@debian.org&gt;]
+
+   o Change type of &quot;data_ptr&quot; argument in uuid_export() API signature
+     from &quot;void **&quot; to &quot;void *&quot; as there is unfortunately no
+     &quot;generic pointer to pointer type&quot; in ISO C (see also
+     http://c-faq.com/ptrs/genericpp.html) and &quot;void **&quot; is just a
+     &quot;pointer to a 'void *'&quot;.
+     
+     The &quot;void **&quot; especially had the nasty side-effect that it breaks
+     strict pointer aliasing rules of ISO C and hence would require
+     fiddling with temporary variables on all uuid_export() calls if
+     one would be 100% correct and avoid aliasing related compiler
+     warnings. Instead, as uuid_export() internally has to cast the
+     &quot;data_ptr&quot; to the particular expected type anyway, it is better
+     to have &quot;data_ptr&quot; just be a really generic &quot;void *&quot; in the API
+     signature.
+     
+     Keep in mind that although this is an API change, it doesn't cause
+     any incompatibilities as the function still expects the same
+     &quot;pointer to a pointer of a particular type&quot;. This expected pointer
+     is just now passed the more correct although less intuitive way.
+     [Hrvoje Niksic &lt;hniksic@xemacs.org&gt;, Ralf S. Engelschall]
+
+   o Optional DMALLOC based memory debugging support.
+     [Ralf S. Engelschall]
+
+   o Consistently include &quot;uuid_ac.h&quot; in all source files to have GNU
+     autoconf results and standard system defines available everywhere.
+     [Ralf S. Engelschall]
+
+  Changes between 1.5.0 and 1.5.1 (28-Jul-2006 to 31-Jul-2006)
+
+   o Use &quot;MODULE_PATHNAME&quot; instead of &quot;@MODULE_PATHNAME@&quot; in
+     uuid.sql.in to be more aligned to the PostgreSQL styles.
+     [Simon &quot;janus&quot; Dassow &lt;janus@errornet.de&gt;]
+
+   o Use the available variables $(LIB_NAME), $(DCE_NAME) and
+     $(CXX_NAME) more consistently in Makefile.in to allow packagers to
+     override the library name with less patching.
+     [Piotr Roszatycki &lt;dexter@debian.org&gt;]
+
+   o Fix the &quot;make distclean&quot; target of php/Makefile.local
+     to make sure the &quot;.deps&quot; file is not left over.
+     [Ralf S. Engelschall]
+
+   o Fix the tarball rolling procedure to make sure we
+     do not distribute binary files again. This now especially uses
+     a MANIFEST file which explicitly lists all files which form the
+     distribution tarball. We compare the tarball and the MANIFEST file
+     for differences in the &quot;devtool dist&quot; now.
+     [Ralf S. Engelschall]
+
+  Changes between 1.4.2 and 1.5.0 (13-Mar-2006 to 28-Jul-2006)
+
+   o Fixed potential memory leak in uuid_create() as spotted by SPLINT.
+     [Ralf S. Engelschall]
+
+   o Cleanup source code according to complains by SPLINT.
+     [Ralf S. Engelschall]
+
+   o Cleanup internal uuid_mac.h header.
+     [Ralf S. Engelschall]
+   
+   o Numerous fixed to the error handling in the PostgreSQL bindings.
+     [Neil Conway &lt;neilc@samurai.com&gt;]
+
+   o Add Hash indexing support UUID data type of PostgreSQL bindings.
+     [Ralf S. Engelschall]
+
+   o Add comparison operators and B-Tree indexing support UUID data
+     type of PostgreSQL bindings.
+     [Roman Neuhauser &lt;neuhauser@sigpipe.cz&gt;]
+
+   o Fix PHP bindings: the wrong argument to uuid_create()
+     was forced to a reference
+     [Roman Neuhauser &lt;neuhauser@sigpipe.cz&gt;]
+
+   o Add full support for Single Integer Value (SIV) UUID representation
+     for both importing and exporting in C/C++/Perl/PHP APIs.
+     [Ralf S. Engelschall]
+   
+   o Upgrade build environment to GNU shtool 2.0.6 and GNU autoconf 2.60
+     [Ralf S. Engelschall]
+
+   o Added an &quot;OVERVIEW&quot; file which tries to give the &quot;big picture&quot;
+     about UUIDs and allows to survice during the nasty UUID bit fiddling.
+     [Ralf S. Engelschall]
+
+   o Replaced &quot;clock_seq_and_reserved&quot; with
+     &quot;clock_seq_high_and_reserved&quot; in uuid.pod to already reflect the
+     description in the forthcoming RFC.
+     [Ralf S. Engelschall]
+
+   o Speed up processing in uuid_str.c by reducing va_copy() calls from
+     two to just one per formatting.
+     [Ralf S. Engelschall]
+
+  Changes between 1.4.1 and 1.4.2 (07-Feb-2006 to 13-Mar-2006)
+
+   o Fix uuid_export() function by fixing the internal
+     uuid_s[ar]printf() functions which require the backup of va_list
+     arguments between subsequent processing.
+     [Ralf S. Engelschall, Thomas Lotterer &lt;thomas@lotterer.net&gt;]
+
+   o Fix Perl API's &quot;export&quot; function by not taking over NUL-termination
+     character under UUID_FMT_TXT.
+     [Thomas Lotterer &lt;thomas@lotterer.net&gt;]
+   
+   o Declare &quot;install&quot;, &quot;uninstall&quot; and &quot;clean&quot; make(1) targets
+     &quot;.PHONY&quot;. This especially workarounds problems on case insensitive
+     filesystems (like MacOS X' filesystem) where the &quot;INSTALL&quot; document
+     conflicts with the &quot;install&quot; target.
+     [Ralf S. Engelschall, David Wheeler &lt;david@kineticode.com&gt;]
+
+  Changes between 1.4.0 and 1.4.1 (15-Jan-2006 to 07-Feb-2006)
+
+   o Upgrade to GNU shtool 2.0.5
+     [Ralf S. Engelschall]
+
+   o Apply workaround to uuid.h to avoid conflicts with
+     vendor UUID implementations where uuid_t (Darwin/MacOSX)
+     or uuid_create/uuid_compare (POSIX) might exist.
+     [Ralf S. Engelschall]
+
+  Changes between 1.3.2 and 1.4.0 (06-Dec-2005 to 15-Jan-2006)
+
+   o Created a top-level Perl ExtUtils::MakeMaker wrapper script
+     [Ralf S. Engelschall]
+
+   o Adjust copyright messages for new year 2006.
+     [Ralf S. Engelschall]
+
+   o Added experimental PostgreSQL bindings.
+     [Ralf S. Engelschall]
+
+   o Fixed documentation of uuid_make() function.
+     [Ralf S. Engelschall]
+
+   o Upgrade build environment to GNU libtool 1.5.22
+     [Ralf S. Engelschall]
+
+  Changes between 1.3.1 and 1.3.2 (24-Sep-2005 to 06-Dec-2005)
+
+   o Cleaned up and speed optimized perl/uuid_compat.pm
+     (the Data::UUID compatibility module for Perl)
+     [David Wheeler &lt;david@justatheory.com&gt;]
+
+   o Upgrade to GNU shtool 2.0.3
+     [Ralf S. Engelschall]
+   
+   o Consistently use &quot;return&quot; in uuid++.cc
+     [Ralf S. Engelschall]
+
+  Changes between 1.3.0 and 1.3.1 (02-Sep-2005 to 24-Sep-2005)
+
+   o Fix two incorrect casts, detected by compiling the C code
+     under C++ constraints.
+     [Ralf S. Engelschall]
+
+   o Remove a compiler warning in the PHP bindings.
+     [Ralf S. Engelschall]
+
+   o Plug memory leak in PRNG sub-library.
+     [Ralf S. Engelschall]
+
+   o Add VPATH/srcdir support for at the default 
+     build procedure plus at least C++ and DCE build options.
+     [Ralf S. Engelschall]
+
+  Changes between 1.2.1 and 1.3.0 (30-Aug-2005 to 02-Sep-2005)
+
+   o Add an experimental PHP 4/5 language API binding which
+     can be enabled under build-time with opption --with-php.
+     [Ralf S. Engelschall]
+   
+   o Upgrade to GNU libtool 1.5.20
+     [Ralf S. Engelschall]
+
+   o Add missing &quot;const&quot; in manual page.
+     [Ralf S. Engelschall]
+
+   o Add an experimental C++ API binding which can be 
+     enabled under build-time with option --with-cxx.
+     [Ralf S. Engelschall]
+
+   o Cleanup the internals of the uuid_create() function and
+     add a new corresponding uuid_clone() API function.
+     [Ralf S. Engelschall]
+
+   o Cleanup some Makefile parts.
+     [Ralf S. Engelschall]
+
+   o Added a pkg-config(1) specification uuid.pc which is also
+     installed by default in addition to the old-style uuid-config tool.
+     [Ralf S. Engelschall]
+
+   o Added optional Data::UUID backward compatibility Perl API which can
+     be enabled with the build-time option --with-perl-compat.
+     [Piotr Roszatycki &lt;dexter@debian.org&gt;, Ralf S. Engelschall]
+
+   o Add a functionality-reduced TIE-style Perl API OSSP::uuid::tie,
+     intended for very high-level convenience programming.
+     [Ralf S. Engelschall]
+
+   o Reference the new officially published RFC 4122.
+     [Ralf S. Engelschall]
+
+  Changes between 1.2.0 and 1.2.1 (23-Jan-2005 to 30-Aug-2005)
+
+   o Add SEEALSO document which references all known
+     UUID implementations.
+     [Ralf S. Engelschall]
+
+   o Improve the PRNG in case no stronger system PRNG device is
+     available by passing time and rand(3) based entropy into the MD5
+     one-way hash function to achieve at least some sort of weaker PRN data.
+     [Ralf S. Engelschall]
+
+   o Fix MAC address determination under Solaris by using the result of
+     ioctl(...,SIOCGARP,...) only if arp_flags had ATF_COM set.
+     [Ralf S. Engelschall]
+
+   o Upgrade to GNU libtool 1.5.18 and GNU shtool 2.0.2.
+     [Ralf S. Engelschall]
+
+   o Cleanup the source code even more by following a large
+     set of FlexeLint's suggestions.
+     [Ralf S. Engelschall]
+
+   o Fixed generated &quot;section&quot; number in uuid-config(1).
+     [Piotr Roszatycki &lt;dexter@debian.org&gt;]
+
+  Changes between 1.1.2 and 1.2.0 (13-Jan-2005 to 23-Jan-2005)
+
+   o Added support for new version 5 UUIDs (name-based, SHA-1)
+     according to latest draft-mealling-uuid-urn-05.txt.
+     [Ralf S. Engelschall]
+
+   o Reference new ISO/IEC 9834-8:2004 / ITU-T Rec. X.667 2004 standard
+     and latest IETF draft-mealling-uuid-urn-05.txt.
+     [Ralf S. Engelschall]
+
+  Changes between 1.1.1 and 1.1.2 (18-Nov-2004 to 13-Jan-2005)
+
+   o Fix generation of v3 UUIDs by adding support for 64-bit platforms
+     to the underlying uuid_md5.c code (which internally is based on
+     the RFC reference code which in turn assumes a 32-bit environment).
+     [Ralf S. Engelschall, Piotr Roszatycki &lt;Piotr_Roszatycki@netia.net.pl&gt;]
+
+   o Optimize internal md5_store() function by directly finalizing MD5
+     calculation on buffer copy instead of finalizing original buffer
+     and having to restore it from the buffer copy.
+     [Ralf S. Engelschall]
+
+   o Adjust copyright messages for new year 2005.
+     [Ralf S. Engelschall]
+
+   o Do not rebuild the Perl API if there were no actual changes.
+     [Ralf S. Engelschall]
+
+  Changes between 1.1.0 and 1.1.1 (03-Nov-2004 to 18-Nov-2004)
+
+   o Apply the FreeBSD libc uuid_create() related workaround
+     in the Perl bindings also under FreeBSD 6.0-CURRENT. 
+     [Ralf S. Engelschall]
+
+   o Fix --with-perl configure option processing: Perl is
+     only required if --with-perl is used although we search for Perl
+     always in order to provide the PERL variable substitution.
+     [Ralf S. Engelschall]
+
+  Changes between 1.0.4 and 1.1.0 (16-Oct-2004 to 03-Nov-2004)
+
+   o Add --with-perl configure option for optionally enabling
+     the Perl language bindings.
+     [Ralf S. Engelschall]
+
+   o Add Perl language bindings providing both a C-style and OO-style API.
+     [Ralf S. Engelschall]
+
+  Changes between 1.0.3 and 1.0.4 (15-Oct-2004 to 16-Oct-2004)
+
+   o Fix version detection from uuid_vers.h
+     [Ralf S. Engelschall]
+
+  Changes between 1.0.2 and 1.0.3 (12-Sep-2004 to 15-Oct-2004)
+
+   o Support configuring/building/installing from an arbitrary
+     directory via srcdir/top_srcdir/VPATH.
+     [David Lee &lt;t.d.lee@durham.ac.uk&gt;, Ralf S. Engelschall]
+
+   o Upgrade build environment to GNU libtool 1.5.10.
+     [Ralf S. Engelschall]
+
+  Changes between 1.0.1 and 1.0.2 (16-Jul-2004 to 12-Sep-2004)
+
+   o Upgrade build environment to GNU libtool 1.5.8 and GNU shtool 2.0.1
+     [Ralf S. Engelschall]
+
+  Changes between 1.0.0 and 1.0.1 (16-Feb-2004 to 16-Jul-2004)
+
+   o Made documentation of uuid_export() more clear.
+     [Ralf S. Engelschall]
+
+   o Upgrade build environment to GNU libtool 1.5.6 and GNU shtool 2.0.0
+     [Ralf S. Engelschall]
+
+   o Remove some warnings occurring under GCC 3.5
+     [Ralf S. Engelschall]
+
+  Changes between 0.9.7 and 1.0.0 (13-Feb-2004 to 16-Feb-2004)
+
+   o Replace remaining (old) UUID_VERSIONX names with UUID_MAKE_VX
+     in the documentation (uuid.pod).
+     [Ralf S. Engelschall]
+
+   o Resolve namespace conflicts with GCC 3.4 internal pow10() and round()
+     functions within uuid_str.c.
+     [Ralf S. Engelschall]
+
+   o Fix buffer handling in &quot;uuid_export(..., UUID_FMT_TXT, vp, ...)&quot; in
+     case &quot;vp&quot; is not NULL.
+     [Fuyuki &lt;fuyuki@nigredo.org&gt;]
+
+  Changes between 0.9.6 and 0.9.7 (11-Feb-2004 to 13-Feb-2004)
+
+   o remove --with-rfc2518 option and functionality because
+     even the IETF/IESG has finally approved our report about the broken
+     random multicast MAC address generation in the standard (and
+     will fix it in new versions of the draft-mealling-uuid-urn). So,
+     finally get rid of this broken-by-design backward compatibility
+     functionality.
+     [Ralf S. Engelschall]
+
+   o Add support to uuid(1) CLI for decoding from stdin for
+     both binary and string representations.
+     [Ralf S. Engelschall]
+
+   o Add missing documentation entries for UUID_XXXX API constants and
+     uuid_version() function.
+     [Fuyuki &lt;fuyuki@nigredo.org&gt;]
+
+   o Adjust references for new draft-mealling-uuid-urn-02.txt.
+     [Fuyuki &lt;fuyuki@nigredo.org&gt;]
+
+   o Replaced overlooked references to old
+     uuid_{unpack,pack,parse,format,dump}() functions with their
+     current uuid_{import,export}() replacements.
+     [Fuyuki &lt;fuyuki@nigredo.org&gt;]
+
+   o Fixed &quot;uuid -h&quot; command.
+     [Fuyuki &lt;fuyuki@nigredo.org&gt;]
+
+  Changes between 0.9.5 and 0.9.6 (06-Feb-2004 to 11-Feb-2004)
+
+   o Added an experimental additional DCE 1.1 API for backward
+     compatibility with existing applications.
+     [Ralf S. Engelschall]
+
+  Changes between 0.9.4 and 0.9.5 (19-Jan-2004 to 06-Feb-2004)
+
+   o Fixed filedescriptor leak in the PRNG sub-API.
+     [Guerry Semones &lt;guerry@tsunamiresearch.com&gt;]
+
+   o Upgraded build environment to GNU libtool 1.5.2.
+     [Ralf S. Engelschall]
+
+  Changes between 0.9.3 and 0.9.4 (16-Jan-2004 to 19-Jan-2004)
+
+   o Include &lt;string.h&gt; in uuid.h because of size_t usage.
+     [Ralf S. Engelschall]
+
+   o INCOMPATIBILITY: Refactor the API and rename uuid_generate()
+     to uuid_make() and use a &quot;uuid_t&quot; pointer for the namespace
+     on UUID_VERSION3 generation. To allow access to the internal
+     pre-defined namespace UUIDs, provide a new uuid_load() function.
+     Because uuid_load() now also allows the loading of the &quot;nil&quot; UUID,
+     remove uuid_nil() from the API. After this second refactoring the
+     API is now the one we originally wished for the forthcoming version
+     1.0 of OSSP uuid.
+     [Ralf S. Engelschall]
+
+   o INCOMPATIBILITY: rename UUID_VERSIONx to UUID_MAKE_Vx and
+     UUID_MCASTRND to UUID_MAKE_MC to be more consistent throughout API.
+     [Ralf S. Engelschall]
+
+   o Add version support to API via UUID_VERSION (compile-time)
+     and uuid_version() (link-time).
+     [Ralf S. Engelschall]
+
+   o INCOMPATIBILITY: Refactor the API by merging
+     uuid_{unpack,pack,parse,format,dump}() functions into unified
+     uuid_{import,export}() functions. This allows us to easily add
+     support for other formats (e.g. XML) in the future without having
+     the change the API in principle.
+     [Ralf S. Engelschall]
+
+   o Document what DCE 1.1 UUID versions exist and what they are
+     intended for.
+     [Ralf S. Engelschall]
+
+   o Cleanup the C code to also pass warning-free a C++ compiler.
+     [Ralf S. Engelschall]
+
+   o Support C++ by enclosing the C API declarations in
+     'extern &quot;C&quot; {...}' within uuid.h.
+     [Guerry Semones &lt;guerry@tsunamiresearch.com&gt;]
+
+   o Improvide decoding in uuid_dump() by at least hex-dumping the
+     binary representation in case of v3, v4 and Nil UUIDs. Also,
+     annotate with better hints.
+     [Ralf S. Engelschall]
+
+   o Recognize special &quot;Nil UUID&quot; on decoding in uuid_dump().
+     [Ralf S. Engelschall]
+
+  Changes between 0.9.2 and 0.9.3 (15-Jan-2004 to 16-Jan-2004)
+
+   o Tested OSSP uuid on 16 particular Unix platforms and list
+     those in the new PORTING file.
+     [Ralf S. Engelschall]
+
+   o Fixed minor formatting bug in call to str_rsprintf().
+     [Ralf S. Engelschall]
+
+   o Fix syntax error in uuid.ac.
+     [Ralf S. Engelschall]
+
+  Changes between 0.9.1 and 0.9.2 (13-Jan-2004 to 15-Jan-2004)
+
+   o Provide both incorrect RFC2518-based and correct IEEE 802
+     multicast address generation. The default now is the correct
+     IEEE 802 multicast address generation but compile-time option
+     --with-rfc2518 selects the broken variant.
+     [Ralf S. Engelschall]
+
+   o Decode also the IEEE 802 MAC address local/global bit.
+     [Ralf S. Engelschall]
+
+   o Added missing documentation for uuid_dump().
+     [Ralf S. Engelschall]
+
+   o Fixed BM_POW2() macro implementation.
+     [Ralf S. Engelschall]
+
+   o Use BM_XXX() and str_xxx() APIs throughout internal implementation.
+     [Ralf S. Engelschall]
+
+   o Added missing manual page uuid-config(1).
+     [Ralf S. Engelschall]
+
+   o Fixed output of &quot;uuid-config --version&quot;
+     [Ralf S. Engelschall]
+
+   o Fixed typos in uuid.pod
+     [Ralf S. Engelschall]
+
+   o Cleanup uuid.ac for unused elements.
+     [Ralf S. Engelschall]
+
+   o Moved uuid_[u]int{8,16,32}_t auto-configuration into
+     own internal header uuid_ac.h.
+     [Ralf S. Engelschall]
+
+   o Fixed portability by replacing accidentally introduced
+     uint{8,16,32}_t with the portable uuid_uint{8,16,32}_t.
+     [Guerry Semones &lt;guerry@tsunamiresearch.com&gt;]
+
+   o Prefix all variable symbols in uuid.h with underscores
+     to avoid namespace conflicts.
+     [Ralf S. Engelschall]
+
+   o Add decoding examples to uuid(1) manual page.
+     [Ralf S. Engelschall]
+
+  Changes between 0.9.0 and 0.9.1 (11-Jan-2004 to 13-Jan-2004)
+
+   o Make &quot;md5_init&quot; and &quot;mac_address&quot; symbols namespace clean
+     by adding correct embedding support via &quot;uuid_&quot; prefix.
+     [Ralf S. Engelschall]
+
+   o Implement uuid_dump() and corresponding uuid CLI &quot;-d&quot;
+     option for dumping a given UUID into clear text. For convenience
+     reasons add uuid_bm.h (bit mask API) and uuid_str (string
+     formatting API) sub-modules.
+     [Ralf S. Engelschall]
+
+   o Add &quot;-m&quot; option to CLI for allowing to generate v1 UUIDs
+     with random multi-cast addresses (API UUID_MCASTRND option).
+     [Ralf S. Engelschall]
+
+   o Disable the C++ and F77 checks in GNU libtool.
+     [Ralf S. Engelschall]
+
+   o Print involved option character (instead of '?') on invalid
+     option for uuid(1) CLI.
+     [Matthias Andree &lt;matthias.andree@gmx.de&gt;]
+
+   o Fixed &quot;make install&quot; and &quot;make uninstall&quot;: the uuid(1) CLI
+     has to be [un]installed through GNU libtool, too.
+     [Matthias Andree &lt;matthias.andree@gmx.de&gt;]
+
+   o Document in uuid(1) [uuid_cli.pod] that for version 3
+     UUIDs additional arguments are required and what pre-defined
+     namespace ids are known.
+     [Ralf S. Engelschall, M.Daniel &lt;mdaniel@scdi.com&gt;]
+
+   o cleaned up source tree documentation files.
+     [Ralf S. Engelschall]
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidHISTORY"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/HISTORY (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/HISTORY                                (rev 0)
+++ freeswitch/trunk/libs/uuid/HISTORY        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,358 @@
</span><ins>+   _        ___  ____ ____  ____                _     _
+  |_|_ _   / _ \/ ___/ ___||  _ \   _   _ _   _(_) __| |
+  _|_||_| | | | \___ \___ \| |_) | | | | | | | | |/ _` |
+ |_||_|_| | |_| |___) |__) |  __/  | |_| | |_| | | (_| |
+  |_|_|_|  \___/|____/____/|_|      \__,_|\__,_|_|\__,_|
+
+  OSSP uuid - Universally Unique Identifier
+
+  HISTORY
+
+  During OSSP uuid we were totally puzzled by a subtle bug in the UUID
+  standards related to the generation of multi-cast MAC addresses.
+  This part of the history shows a very interesting technical bug,
+  the unusual way of having to fix a standard (which was multiple
+  times revised by different standard authorities, including the
+  IETF, the OpenGroup and ISO/IEC) afterwards plus the fixing of six
+  implementations into which the bug was inherited similarly. Below are
+  some snapshot of this part of history: the first implementation fix
+  (for FreeBSD) and the notification of the IETF standards authors.
+
+  ___________________________________________________________________________
+
+  Date: Fri, 13 Feb 2004 16:09:31 +0100
+  From: &quot;Ralf S. Engelschall&quot; &lt;rse@en1.engelschall.com&gt;
+  To: paulle@microsoft.com, michael@neonym.net, rsalz@datapower.com
+  Subject: [PATCH] draft-mealling-uuid-urn-02.txt
+  Message-ID: &lt;20040213150931.GA7656@engelschall.com&gt;
+
+  During implementation of OSSP uuid (a flexible CLI and C API for
+  generation and partial decoding of version 1, 3 and 4 UUIDs, see
+  http://www.ossp.org/pkg/lib/uuid/ for details), I discovered a nasty bug
+  in the generation of random multicast MAC addresses. It is present in
+  all standards and drafts (both expired ones and current ones) and was
+  also inherited (until I fixed it by submitting patches to the authors
+  recently) by all six freely available UUID implementations (Apache APR,
+  FreeBSD uuidgen(2), Java JUG, Linux's libuuid from e2fsutil, Perl's
+  Data::UUID and WINE's UUID generator)).
+
+  In case no real/physical IEEE 802 address is available, both the
+  expired &quot;draft-leach-uuids-guids-01&quot; (section &quot;4. Node IDs when no IEEE
+  802 network card is available&quot;), RFC 2518 (section &quot;6.4.1 Node Field
+  Generation Without the IEEE 802 Address&quot;) and now even your current
+  &quot;draft-mealling-uuid-urn-02.txt&quot; (section &quot;4.5 Node IDs that do not
+  identify the host&quot;) recommend:
+
+      &quot;A better solution is to obtain a 47-bit cryptographic quality
+      random number, and use it as the low 47 bits of the node ID, with
+      the _most_ significant bit of the first octet of the node ID set to
+      one. This bit is the unicast/multicast bit, which will never be set
+      in IEEE 802 addresses obtained from network cards; hence, there can
+      never be a conflict between UUIDs generated by machines with and
+      without network cards.&quot;
+
+  Unfortunately, this incorrectly explains how to implement this and even
+  the example implementation (draft-mealling-uuid-urn-02.txt, &quot;Appendix
+  A. Appendix A - Sample Implementation&quot;) inherited this. Correct is
+  &quot;the _least_ significant bit of the first octet of the node ID&quot; as the
+  multicast bit in a memory and hexadecimal string representation of a
+  48-bit IEEE 802 MAC address.
+
+  This standards bug arised from a false interpretation, as the multicast
+  bit is actually the _most_ significant bit in IEEE 802.3 (Ethernet)
+  _transmission order_ of an IEEE 802 MAC address. But you forgot that the
+  bitwise order of an _octet_ from a MAC address _memory_ and hexadecimal
+  string representation is still always from left (MSB, bit 7) to right
+  (LSB, bit 0). And the standard deals with memory representations only,
+  so the transmission order of a MAC doesnt' matter here.
+
+  As mentioned, OSSP uuid already implements this correctly. The FreeBSD
+  uuidgen(2) and Apache APR generators I've also fixed myself recently in
+  CVS. And for the remaining implementations I've submitted patches to the
+  authors and they all (except for WINE) responded that they took over the
+  patch. So the results of this long-standing bug we were able to fix --
+  at least for the free software world ;-). What is now remaining is that
+  you finally also should fix this in your standard so the bug does not
+  spread any longer into other implementations.
+
+  Here is the minimal required patch against your draft:
+
+  --- draft-mealling-uuid-urn-02.txt.orig        Mon Feb  2 21:50:35 2004
+  +++ draft-mealling-uuid-urn-02.txt        Fri Feb 13 15:41:49 2004
+  @@ -751,7 +751,7 @@
+      [6], and the cost was US$550.
+
+      A better solution is to obtain a 47-bit cryptographic quality random
+  -   number, and use it as the low 47 bits of the node ID, with the most
+  +   number, and use it as the low 47 bits of the node ID, with the least
+      significant bit of the first octet of the node ID set to one. This
+      bit is the unicast/multicast bit, which will never be set in IEEE 802
+      addresses obtained from network cards; hence, there can never be a
+  @@ -1369,7 +1369,7 @@
+              }
+              else {
+                  get_random_info(seed);
+  -               seed[0] |= 0x80;
+  +               seed[0] |= 0x01;
+                  memcpy(&amp;saved_node, seed, sizeof saved_node);
+                  fp = fopen(&quot;nodeid&quot;, &quot;wb&quot;);
+                  if (fp) {
+
+  But I recommend you to perhaps also add one or two sentences which
+  explain what I explained above (the difference between memory and
+  transmission order), just to make sure people are not confused in the
+  other direction and then think there is a bug (in the then fixed and
+  correct) standard, because they know about the transmission order of MAC
+  addresses.
+
+  Yours,
+                                         Ralf S. Engelschall
+                                         rse@engelschall.com
+                                         www.engelschall.com
+
+  Date: Fri, 13 Feb 2004 11:05:51 -0500
+  From: Rich Salz &lt;rsalz@datapower.com&gt;
+  To: rse@engelschall.com
+  Cc: paulle@microsoft.com, michael@neonym.net
+  Message-ID: &lt;402CF5DF.4020601@datapower.com&gt;
+  Subject: Re: [PATCH] draft-mealling-uuid-urn-02.txt
+  References: &lt;20040213150931.GA7656@engelschall.com&gt;
+  Content-Length: 431
+  Lines: 11
+
+  Thanks for writing, Ralf.
+
+  You're correct, and this has been noted by the IESG and will be fixed in
+  the next draft.  It's unfortunate we made it this far with the bug.
+
+      /r$
+  --
+  Rich Salz, Chief Security Architect
+  DataPower Technology                           http://www.datapower.com
+  XS40 XML Security Gateway   http://www.datapower.com/products/xs40.html
+  XML Security Overview  http://www.datapower.com/xmldev/xmlsecurity.html
+
+  Date: Thu, 22 Jan 2004 05:34:11 -0800 (PST)
+  From: &quot;Ralf S. Engelschall&quot; &lt;rse@FreeBSD.org&gt;
+  Message-Id: &lt;200401221334.i0MDYB1K018137@repoman.freebsd.org&gt;
+  To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
+  Subject: cvs commit: src/sys/kern kern_uuid.c
+  X-FreeBSD-CVS-Branch: HEAD
+  X-Loop: FreeBSD.ORG
+  Content-Length: 1907
+  Lines: 42
+
+  rse         2004/01/22 05:34:11 PST
+
+    FreeBSD src repository
+
+    Modified files:
+      sys/kern             kern_uuid.c
+    Log:
+    Fix generation of random multicast MAC address.
+
+    In case no real/physical IEEE 802 address is available, both the expired
+    &quot;draft-leach-uuids-guids-01&quot; (section &quot;4. Node IDs when no IEEE 802
+    network card is available&quot;) and RFC 2518 (section &quot;6.4.1 Node Field
+    Generation Without the IEEE 802 Address&quot;) recommend (quoted from RFC
+    2518):
+
+      &quot;The ideal solution is to obtain a 47 bit cryptographic quality random
+      number, and use it as the low 47 bits of the node ID, with the _most_
+      significant bit of the first octet of the node ID set to 1. This bit
+      is the unicast/multicast bit, which will never be set in IEEE 802
+      addresses obtained from network cards; hence, there can never be a
+      conflict between UUIDs generated by machines with and without network
+      cards.&quot;
+
+    Unfortunately, this incorrectly explains how to implement this and
+    the FreeBSD UUID generator code inherited this generation bug from
+    the broken reference code in the standards draft. They should instead
+    specify the &quot;_least_ significant bit of the first octet of the node ID&quot;
+    as the multicast bit in a memory and hexadecimal string representation
+    of a 48-bit IEEE 802 MAC address.
+
+    This standards bug arised from a false interpretation, as the multicast
+    bit is actually the _most_ significant bit in IEEE 802.3 (Ethernet)
+    _transmission order_ of an IEEE 802 MAC address. The standards authors
+    forgot that the bitwise order of an _octet_ from a MAC address _memory_
+    and hexadecimal string representation is still always from left (MSB,
+    bit 7) to right (LSB, bit 0).
+
+    Fortunately, this UUID generation bug could have occurred on systems
+    without any Ethernet NICs only.
+
+    Revision  Changes    Path
+    1.7       +1 -1      src/sys/kern/kern_uuid.c
+
+  Date: Thu, 22 Jan 2004 15:20:22 -0800
+  From: Marcel Moolenaar &lt;marcel@xcllnt.net&gt;
+  To: &quot;Ralf S. Engelschall&quot; &lt;rse@FreeBSD.org&gt;
+  Cc: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
+  Subject: Re: cvs commit: src/sys/kern kern_uuid.c
+  Message-ID: &lt;20040122232022.GA77798@ns1.xcllnt.net&gt;
+  References: &lt;200401221334.i0MDYB1K018137@repoman.freebsd.org&gt;
+  Content-Length: 380
+  Lines: 14
+
+  On Thu, Jan 22, 2004 at 05:34:11AM -0800, Ralf S. Engelschall wrote:
+  &gt; rse         2004/01/22 05:34:11 PST
+  &gt;
+  &gt;   FreeBSD src repository
+  &gt;
+  &gt;   Modified files:
+  &gt;     sys/kern             kern_uuid.c
+  &gt;   Log:
+  &gt;   Fix generation of random multicast MAC address.
+
+  An excellent catch and an outstanding commit log. Chapeau!
+
+  --
+   Marcel Moolenaar          USPA: A-39004                 marcel@xcllnt.net
+
+  ___________________________________________________________________________
+
+  Index: ChangeLog
+  ===================================================================
+  RCS file: /e/ossp/cvs/ossp-pkg/uuid/ChangeLog,v
+  retrieving revision 1.42
+  diff -u -d -r1.42 ChangeLog
+  --- ChangeLog        13 Feb 2004 16:17:07 -0000        1.42
+  +++ ChangeLog        13 Feb 2004 21:01:07 -0000
+  @@ -13,6 +13,14 @@
+
+     Changes between 0.9.6 and 0.9.7 (11-Feb-2004 to 13-Feb-2004)
+
+  +   o remove --with-rfc2518 option and functionality because
+  +     even the IETF/IESG has finally approved our report about the broken
+  +     random multicast MAC address generation in the standard (and
+  +     will fix it in new versions of the draft-mealling-uuid-urn). So,
+  +     finally get rid of this broken-by-design backward compatibility
+  +     functionality.
+  +     [Ralf S. Engelschall]
+  +
+      o Add support to uuid(1) CLI for decoding from stdin for
+        both binary and string representations.
+        [Ralf S. Engelschall]
+  Index: uuid.ac
+  ===================================================================
+  RCS file: /e/ossp/cvs/ossp-pkg/uuid/uuid.ac,v
+  retrieving revision 1.10
+  diff -u -d -r1.10 uuid.ac
+  --- uuid.ac        11 Feb 2004 14:38:40 -0000        1.10
+  +++ uuid.ac        13 Feb 2004 19:20:32 -0000
+  @@ -71,12 +71,6 @@
+       AC_CHECK_SIZEOF(unsigned long long, 8)
+
+       dnl #   options
+  -    AC_ARG_WITH(rfc2518,
+  -        AC_HELP_STRING([--with-rfc2518], [use incorrect generation of IEEE 802 multicast addresses according to RFC2518]),
+  -        [ac_cv_with_rfc2518=$withval], [ac_cv_with_rfc2518=no])
+  -    if test &quot;.$ac_cv_with_rfc2518&quot; = &quot;.yes&quot;; then
+  -        AC_DEFINE(WITH_RFC2518, 1, [whether to use incorrect generation of IEEE 802 multicast addresses according to RFC2518])
+  -    fi
+       AC_ARG_WITH(dce,
+           AC_HELP_STRING([--with-dce], [build DCE 1.1 backward compatibility API]),
+           [ac_cv_with_dce=$withval], [ac_cv_with_dce=no])
+  Index: uuid.c
+  ===================================================================
+  RCS file: /e/ossp/cvs/ossp-pkg/uuid/uuid.c,v
+  retrieving revision 1.44
+  diff -u -d -r1.44 uuid.c
+  --- uuid.c        19 Jan 2004 14:56:35 -0000        1.44
+  +++ uuid.c        13 Feb 2004 19:22:01 -0000
+  @@ -61,69 +61,9 @@
+       Unix UTC base time is January  1, 1970) */
+   #define UUID_TIMEOFFSET &quot;01B21DD213814000&quot;
+
+  -/* IEEE 802 MAC address encoding/decoding bit fields
+  -
+  -   ATTENTION:
+  -
+  -   In case no real/physical IEEE 802 address is available, both
+  -   &quot;draft-leach-uuids-guids-01&quot; (section &quot;4. Node IDs when no IEEE 802
+  -   network card is available&quot;) and RFC 2518 (section &quot;6.4.1 Node Field
+  -   Generation Without the IEEE 802 Address&quot;) recommend (quoted from RFC
+  -   2518):
+  -
+  -     &quot;The ideal solution is to obtain a 47 bit cryptographic quality
+  -     random number, and use it as the low 47 bits of the node ID, with
+  -     the most significant bit of the first octet of the node ID set to
+  -     1. This bit is the unicast/multicast bit, which will never be set
+  -     in IEEE 802 addresses obtained from network cards; hence, there can
+  -     never be a conflict between UUIDs generated by machines with and
+  -     without network cards.&quot;
+  -
+  -   This passage clearly explains the intention to use IEEE 802 multicast
+  -   addresses. Unfortunately, it incorrectly explains how to implement
+  -   this! It should instead specify the &quot;*LEAST* significant bit of the
+  -   first octet of the node ID&quot; as the multicast bit in a memory and
+  -   hexadecimal string representation of a 48-bit IEEE 802 MAC address.
+  -
+  -   Unfortunately, even the reference implementation included in the
+  -   expired IETF &quot;draft-leach-uuids-guids-01&quot; incorrectly set the
+  -   multicast bit with an OR bit operation and an incorrect mask of
+  -   0x80. Hence, several other UUID implementations found on the
+  -   Internet have inherited this bug.
+  -
+  -   Luckily, neither DCE 1.1 nor ISO/IEC 11578:1996 are affected by this
+  -   problem. They disregard the topic of missing IEEE 802 addresses
+  -   entirely, and thus avoid adopting this bug from the original draft
+  -   and code ;-)
+  -
+  -   It seems that this standards bug arises from a false interpretation,
+  -   as the multicast bit is actually the *MOST* significant bit in IEEE
+  -   802.3 (Ethernet) _transmission order_ of an IEEE 802 MAC address. The
+  -   authors were likely not aware that the bitwise order of an octet from
+  -   a MAC address memory and hexadecimal string representation is still
+  -   always from left (MSB, bit 7) to right (LSB, bit 0).
+  -
+  -   For more information, see &quot;Understanding Physical Addresses&quot; in
+  -   &quot;Ethernet -- The Definitive Guide&quot;, p.43, and the section &quot;ETHERNET
+  -   MULTICAST ADDRESSES&quot; in http://www.iana.org/assignments/ethernet-numbers.
+  -
+  -   At OSSP, we do it the intended/correct way and generate a real
+  -   IEEE 802 multicast address. Those wanting to encode broken IEEE
+  -   802 MAC addresses (as specified) can nevertheless use a brain dead
+  -   compile-time option to switch off the correct behavior. When decoding
+  -   we always use the correct behavior of course. */
+  -
+  -/* encoding */
+  -#ifdef WITH_RFC2518
+  -#define IEEE_MAC_MCBIT_ENC BM_OCTET(1,0,0,0,0,0,0,0)
+  -#else
+  -#define IEEE_MAC_MCBIT_ENC BM_OCTET(0,0,0,0,0,0,0,1)
+  -#endif
+  -#define IEEE_MAC_LOBIT_ENC BM_OCTET(0,0,0,0,0,0,1,0)
+  -
+  -/* decoding */
+  -#define IEEE_MAC_MCBIT_DEC BM_OCTET(0,0,0,0,0,0,0,1)
+  -#define IEEE_MAC_LOBIT_DEC BM_OCTET(0,0,0,0,0,0,1,0)
+  +/* IEEE 802 MAC address encoding/decoding bit fields */
+  +#define IEEE_MAC_MCBIT BM_OCTET(0,0,0,0,0,0,0,1)
+  +#define IEEE_MAC_LOBIT BM_OCTET(0,0,0,0,0,0,1,0)
+
+   /* IEEE 802 MAC address octet length */
+   #define IEEE_MAC_OCTETS 6
+  @@ -622,8 +562,8 @@
+               (unsigned int)uuid-&gt;obj.node[3],
+               (unsigned int)uuid-&gt;obj.node[4],
+               (unsigned int)uuid-&gt;obj.node[5],
+  -            (uuid-&gt;obj.node[0] &amp; IEEE_MAC_LOBIT_DEC ? &quot;local&quot; : &quot;global&quot;),
+  -            (uuid-&gt;obj.node[0] &amp; IEEE_MAC_MCBIT_DEC ? &quot;multicast&quot; : &quot;unicast&quot;));
+  +            (uuid-&gt;obj.node[0] &amp; IEEE_MAC_LOBIT ? &quot;local&quot; : &quot;global&quot;),
+  +            (uuid-&gt;obj.node[0] &amp; IEEE_MAC_MCBIT ? &quot;multicast&quot; : &quot;unicast&quot;));
+       }
+       else {
+           /* decode anything else as hexadecimal byte-string only */
+  @@ -843,8 +783,8 @@
+       if ((mode &amp; UUID_MAKE_MC) || (uuid-&gt;mac[0] &amp; BM_OCTET(1,0,0,0,0,0,0,0))) {
+           /* generate random IEEE 802 local multicast MAC address */
+           prng_data(uuid-&gt;prng, (void *)&amp;(uuid-&gt;obj.node), sizeof(uuid-&gt;obj.node));
+  -        uuid-&gt;obj.node[0] |= IEEE_MAC_MCBIT_ENC;
+  -        uuid-&gt;obj.node[0] |= IEEE_MAC_LOBIT_ENC;
+  +        uuid-&gt;obj.node[0] |= IEEE_MAC_MCBIT;
+  +        uuid-&gt;obj.node[0] |= IEEE_MAC_LOBIT;
+       }
+       else {
+           /* use real regular MAC address */
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidINSTALL"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/INSTALL (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/INSTALL                                (rev 0)
+++ freeswitch/trunk/libs/uuid/INSTALL        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+   _        ___  ____ ____  ____                _     _
+  |_|_ _   / _ \/ ___/ ___||  _ \   _   _ _   _(_) __| |
+  _|_||_| | | | \___ \___ \| |_) | | | | | | | | |/ _` |
+ |_||_|_| | |_| |___) |__) |  __/  | |_| | |_| | | (_| |
+  |_|_|_|  \___/|____/____/|_|      \__,_|\__,_|_|\__,_|
+
+  OSSP uuid - Universally Unique Identifier
+
+  INSTALLATION
+
+  To install OSSP uuid into /path/to/uuid/ perform
+  the following steps in your shell:
+
+    $ ./configure
+         --prefix=/path/to/uuid
+        [--with-dce]
+        [--with-perl[=/path/to/[bin[/perl]
+         --with-perl-compat]]
+        [--with-php]
+    $ make
+    $ make check
+    $ make install [DESTDIR=/path/to/temp/root]
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidMANIFEST"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/MANIFEST (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/MANIFEST                                (rev 0)
+++ freeswitch/trunk/libs/uuid/MANIFEST        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,83 @@
</span><ins>+AUTHORS
+BINDINGS
+ChangeLog
+HISTORY
+INSTALL
+MANIFEST
+Makefile.PL
+Makefile.in
+NEWS
+OVERVIEW
+PORTING
+README
+SEEALSO
+THANKS
+TODO
+USERS
+aclocal.m4
+config.guess
+config.h.in
+config.sub
+configure
+configure.ac
+libtool.m4
+ltmain.sh
+perl/MANIFEST
+perl/Makefile.PL
+perl/uuid.pm
+perl/uuid.pod
+perl/uuid.tm
+perl/uuid.ts
+perl/uuid.xs
+perl/uuid_compat.pm
+perl/uuid_compat.pod
+perl/uuid_compat.ts
+pgsql/Makefile
+pgsql/uuid.c
+pgsql/uuid.sql.in
+pgsql/uuid.txt
+php/Makefile.local
+php/config.m4
+php/package.xml
+php/uuid.c
+php/uuid.php4
+php/uuid.php5
+php/uuid.ts
+shtool
+uuid++.3
+uuid++.cc
+uuid++.hh
+uuid++.pod
+uuid-config.1
+uuid-config.in
+uuid-config.pod
+uuid.1
+uuid.3
+uuid.ac
+uuid.c
+uuid.h.in
+uuid.pc.in
+uuid.pod
+uuid_ac.h
+uuid_bm.h
+uuid_cli.c
+uuid_cli.pod
+uuid_dce.c
+uuid_dce.h
+uuid_mac.c
+uuid_mac.h
+uuid_md5.c
+uuid_md5.h
+uuid_prng.c
+uuid_prng.h
+uuid_sha1.c
+uuid_sha1.h
+uuid_str.c
+uuid_str.h
+uuid_time.c
+uuid_time.h
+uuid_ui128.c
+uuid_ui128.h
+uuid_ui64.c
+uuid_ui64.h
+uuid_vers.h
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidMakefilePL"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/Makefile.PL (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/Makefile.PL                                (rev 0)
+++ freeswitch/trunk/libs/uuid/Makefile.PL        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+##
+##  OSSP uuid - Universally Unique Identifier
+##  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+##  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+##
+##  This file is part of OSSP uuid, a library for the generation
+##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+##  Makefile.PL: top-level Perl ExtUtils::MakeMaker wrapper script
+##
+
+require 5.008;
+use IO::File;
+
+my $ARGS = join(&quot; &quot;, @ARGV);
+
+print &quot;++ writing Makefile\n&quot;;
+
+my $mk = new IO::File &quot;&gt;Makefile&quot; or die;
+$mk-&gt;print(&lt;&lt; &quot;EOF&quot;);
+
+PERL     = $^X
+FULLPERL = $^X
+ARGS     = $ARGS
+
+all pure_all:
+        \@if [ ! -d build ]; then mkdir build; fi
+        \@if [ ! -f build/Makefile ]; then (cd build &amp;&amp; ../configure --disable-shared); fi
+        \@if [ ! -f build/libuuid.la ]; then (cd build &amp;&amp; \$(MAKE) \$(MFLAGS) libuuid.la); fi
+        \@if [ ! -f perl/Makefile ]; then (cd perl &amp;&amp; \$(PERL) Makefile.PL \$(ARGS)); fi
+        \@cd perl &amp;&amp; \$(MAKE) \$(MFLAGS) \$\@
+
+install pure_install test:
+        \@cd perl &amp;&amp; \$(MAKE) \$(MFLAGS) \$\@
+
+clean:
+        \@cd build &amp;&amp; \$(MAKE) \$(MFLAGS) \$\@
+        \@cd perl &amp;&amp; \$(MAKE) \$(MFLAGS) \$\@
+
+distclean realclean:
+        \@cd build &amp;&amp; \$(MAKE) \$(MFLAGS) \$\@
+        \@cd perl &amp;&amp; \$(MAKE) \$(MFLAGS) \$\@
+        -rm -rf build || true
+        -rm -rf Makefile || true
+
+EOF
+
+$mk-&gt;close();
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidMakefilein"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/Makefile.in (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/Makefile.in                                (rev 0)
+++ freeswitch/trunk/libs/uuid/Makefile.in        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,357 @@
</span><ins>+##
+##  OSSP uuid - Universally Unique Identifier
+##  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+##  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+##
+##  This file is part of OSSP uuid, a library for the generation
+##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+##  Makefile.in: make(1) build procedure
+##
+
+@SET_MAKE@
+
+VPATH       = @srcdir@
+srcdir      = @srcdir@
+top_srcdir  = @top_srcdir@
+S           = $(srcdir)
+C           = .
+
+DESTDIR     =
+prefix      = @prefix@
+exec_prefix = @exec_prefix@
+datarootdir = @datarootdir@
+bindir      = @bindir@
+libdir      = @libdir@
+includedir  = @includedir@
+mandir      = @mandir@
+
+CC          = @CC@
+CXX         = @CXX@
+CPPFLAGS    = -I. -I$(S) @CPPFLAGS@ @DEFS@
+CFLAGS      = @CFLAGS@
+CXXFLAGS    = @CXXFLAGS@
+LDFLAGS     = @LDFLAGS@
+LIBS        = @LIBS@
+RM          = rm -f
+CP          = cp
+RMDIR       = rmdir
+SHTOOL      = $(S)/shtool
+LIBTOOL     = $(C)/libtool
+TRUE        = true
+POD2MAN     = pod2man
+PERL        = @PERL@
+PHP         = @PHP@
+PG_CONFIG   = @PG_CONFIG@
+
+LIB_NAME    = libuuid.la
+LIB_OBJS    = uuid.lo uuid_md5.lo uuid_sha1.lo uuid_prng.lo uuid_mac.lo uuid_time.lo uuid_ui64.lo uuid_ui128.lo uuid_str.lo
+
+DCE_NAME    = libuuid_dce.la
+DCE_OBJS    = uuid_dce.lo $(LIB_OBJS)
+
+CXX_NAME    = libuuid++.la
+CXX_OBJS    = uuid++.lo $(LIB_OBJS)
+
+PRG_NAME    = uuid
+PRG_OBJS    = uuid_cli.o
+
+MAN_NAME    = uuid.3 uuid++.3 uuid.1
+
+PERL_NAME   = $(S)/perl/blib/lib/OSSP/uuid.pm
+PERL_OBJS   = $(S)/perl/uuid.pm
+
+PHP_NAME    = $(S)/php/modules/uuid.so
+PHP_OBJS    = $(S)/php/uuid.c
+
+PGSQL_NAME  = $(S)/pgsql/libuuid.so
+PGSQL_OBJS  = $(S)/pgsql/uuid.c
+
+TARGETS     = $(LIB_NAME) @DCE_NAME@ @CXX_NAME@ $(PRG_NAME) @PERL_NAME@ @PHP_NAME@ @PGSQL_NAME@
+
+WITH_DCE         = @WITH_DCE@
+WITH_CXX         = @WITH_CXX@
+WITH_PERL        = @WITH_PERL@
+WITH_PERL_COMPAT = @WITH_PERL_COMPAT@
+WITH_PHP         = @WITH_PHP@
+WITH_PGSQL       = @WITH_PGSQL@
+
+.SUFFIXES:
+.SUFFIXES: .c .cc .o .lo
+
+all: $(TARGETS)
+
+.c.o:
+        $(CC) $(CPPFLAGS) $(CFLAGS) -c $&lt;
+
+.cc.o:
+        $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $&lt;
+
+.c.lo:
+        @$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -c $&lt;
+
+.cc.lo:
+        @$(LIBTOOL) --mode=compile $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $&lt;
+
+$(LIB_NAME): $(LIB_OBJS)
+        @$(LIBTOOL) --mode=link $(CC) -o $(LIB_NAME) $(LIB_OBJS) -rpath $(libdir) \
+            -version-info `$(SHTOOL) version -l c -d libtool $(S)/uuid_vers.h`
+
+$(DCE_NAME): $(DCE_OBJS)
+        @$(LIBTOOL) --mode=link $(CC) -o $(DCE_NAME) $(DCE_OBJS) -rpath $(libdir) \
+            -version-info `$(SHTOOL) version -l c -d libtool $(S)/uuid_vers.h`
+
+$(CXX_NAME): $(CXX_OBJS)
+        @$(LIBTOOL) --mode=link $(CXX) -o $(CXX_NAME) $(CXX_OBJS) -rpath $(libdir) \
+            -version-info `$(SHTOOL) version -l c -d libtool $(S)/uuid_vers.h`
+
+$(PRG_NAME): $(PRG_OBJS) $(LIB_NAME)
+        @$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $(PRG_NAME) $(PRG_OBJS) $(LIB_NAME) $(LIBS)
+
+$(PERL_NAME): $(PERL_OBJS) $(LIB_NAME)
+        @cd $(S)/perl &amp;&amp; $(PERL) Makefile.PL PREFIX=$(prefix) COMPAT=$(WITH_PERL_COMPAT) &amp;&amp; $(MAKE) $(MFLAGS) all
+        @touch $(PERL_NAME)
+
+$(PHP_NAME): $(PHP_OBJS) $(LIB_NAME)
+        @cd $(S)/php &amp;&amp; $(MAKE) $(MFLAGS) -f Makefile.local PHP=$(PHP)
+        @touch $(PHP_NAME)
+
+$(PGSQL_NAME): $(PGSQL_OBJS) $(LIB_NAME)
+        @cd $(S)/pgsql &amp;&amp; $(MAKE) $(MFLAGS) PG_CONFIG=$(PG_CONFIG)
+        @touch $(PGSQL_NAME)
+
+uuid.lo: $(S)/uuid.c uuid.h $(S)/uuid_md5.h $(S)/uuid_sha1.h $(S)/uuid_prng.h $(S)/uuid_mac.h $(S)/uuid_ui64.h $(S)/uuid_ui128.h $(S)/uuid_str.h $(S)/uuid_bm.h $(S)/uuid_ac.h
+uuid_mac.lo: $(S)/uuid_mac.c $(S)/uuid_mac.h
+uuid_md5.lo: $(S)/uuid_md5.c $(S)/uuid_md5.h
+uuid_sha1.lo: $(S)/uuid_sha1.c $(S)/uuid_sha1.h
+uuid_prng.lo: $(S)/uuid_prng.c $(S)/uuid_prng.h
+uuid_str.lo: $(S)/uuid_str.c $(S)/uuid_str.h
+uuid_ui64.lo: $(S)/uuid_ui64.c $(S)/uuid_ui64.h
+uuid_ui128.lo: $(S)/uuid_ui64.c $(S)/uuid_ui128.h
+uuid_dce.lo: $(S)/uuid_dce.c uuid.h $(S)/uuid_dce.h
+uuid_cli.o: $(S)/uuid_cli.c uuid.h
+uuid++.lo: $(S)/uuid++.cc $(S)/uuid++.hh
+
+man: uuid.3 uuid++.3 uuid-config.1 uuid.1
+uuid.3: uuid.pod
+        V1=`$(SHTOOL) version -l c -d short $(S)/uuid_vers.h`; \
+        V2=`$(SHTOOL) version -l c -d long $(S)/uuid_vers.h`; \
+        D=`$(SHTOOL) version -l c -d long $(S)/uuid_vers.h | sed -e 's;.*(;;' -e 's;).*;;'`; \
+        $(POD2MAN) --quotes=none \
+                   --section=3 --center=&quot;Universally Unique Identifier&quot; \
+                   --release=&quot;$$D&quot; --date=&quot;OSSP uuid $$V1&quot; $(S)/uuid.pod | \
+        sed -e &quot;s;UUID_VERSION_STR;$$V2;&quot; &gt;uuid.3
+uuid++.3: uuid++.pod
+        V1=`$(SHTOOL) version -l c -d short $(S)/uuid_vers.h`; \
+        V2=`$(SHTOOL) version -l c -d long $(S)/uuid_vers.h`; \
+        D=`$(SHTOOL) version -l c -d long $(S)/uuid_vers.h | sed -e 's;.*(;;' -e 's;).*;;'`; \
+        $(POD2MAN) --quotes=none \
+                   --section=3 --center=&quot;Universally Unique Identifier&quot; \
+                   --release=&quot;$$D&quot; --date=&quot;OSSP uuid $$V1&quot; $(S)/uuid++.pod | \
+        sed -e &quot;s;UUID_VERSION_STR;$$V2;&quot; &gt;uuid++.3
+uuid-config.1: uuid-config.pod
+        V1=`$(SHTOOL) version -l c -d short $(S)/uuid_vers.h`; \
+        V2=`$(SHTOOL) version -l c -d long $(S)/uuid_vers.h`; \
+        D=`$(SHTOOL) version -l c -d long $(S)/uuid_vers.h | sed -e 's;.*(;;' -e 's;).*;;'`; \
+        $(POD2MAN) --quotes=none \
+                   --section=1 --center=&quot;Universally Unique Identifier&quot; \
+                   --release=&quot;$$D&quot; --date=&quot;OSSP uuid $$V1&quot; $(S)/uuid-config.pod | \
+        sed -e &quot;s;UUID_VERSION_STR;$$V2;&quot; &gt;uuid-config.1
+uuid.1: uuid_cli.pod
+        V1=`$(SHTOOL) version -l c -d short $(S)/uuid_vers.h`; \
+        V2=`$(SHTOOL) version -l c -d long $(S)/uuid_vers.h`; \
+        D=`$(SHTOOL) version -l c -d long $(S)/uuid_vers.h | sed -e 's;.*(;;' -e 's;).*;;'`; \
+        $(CP) $(S)/uuid_cli.pod /tmp/uuid.pod; \
+        $(POD2MAN) --quotes=none \
+                   --section=1 --center=&quot;Universally Unique Identifier&quot; \
+                   --release=&quot;$$D&quot; --date=&quot;OSSP uuid $$V1&quot; /tmp/uuid.pod | \
+        sed -e &quot;s;UUID_VERSION_STR;$$V2;&quot; &gt;uuid.1; \
+        $(RM) /tmp/uuid.pod
+
+check: all
+        @echo &quot;==== UUID version 1 (time and node based): 4 single iterations&quot;; \
+        $(LIBTOOL) --mode=execute ./$(PRG_NAME) -v1 -n 4 -1
+        @echo &quot;==== UUID version 1 (time and node based): 4 subsequent iterations&quot;; \
+        $(LIBTOOL) --mode=execute ./$(PRG_NAME) -v1 -n 4
+        @echo &quot;==== UUID version 3 (name based, MD5): 2 times repeated&quot;; \
+        $(LIBTOOL) --mode=execute ./$(PRG_NAME) -v3 -n 2 ns:URL http://www.ossp.org/
+        @echo &quot;==== UUID version 5 (name based, SHA-1): 2 times repeated&quot;; \
+        $(LIBTOOL) --mode=execute ./$(PRG_NAME) -v5 -n 2 ns:URL http://www.ossp.org/
+        @echo &quot;==== UUID version 4 (random data based): 4 single iterations&quot;; \
+        $(LIBTOOL) --mode=execute ./$(PRG_NAME) -v4 -n 4 -1
+        @echo &quot;==== UUID version 4 (random data based): 4 subsequent iterations&quot;; \
+        $(LIBTOOL) --mode=execute ./$(PRG_NAME) -v4 -n 4
+        @echo &quot;==== UUID version 1 generation and decoding&quot;; \
+        $(LIBTOOL) --mode=execute ./$(PRG_NAME) -d `$(LIBTOOL) --mode=execute ./$(PRG_NAME) -v1`; \
+        $(LIBTOOL) --mode=execute ./$(PRG_NAME) -d `$(LIBTOOL) --mode=execute ./$(PRG_NAME) -v1 -m`
+        @echo &quot;==== UUID version 3 generation and decoding&quot;; \
+        $(LIBTOOL) --mode=execute ./$(PRG_NAME) -d `$(LIBTOOL) --mode=execute ./$(PRG_NAME) -v3 ns:URL http://www.ossp.org/`
+        @echo &quot;==== UUID version 5 generation and decoding&quot;; \
+        $(LIBTOOL) --mode=execute ./$(PRG_NAME) -d `$(LIBTOOL) --mode=execute ./$(PRG_NAME) -v5 ns:URL http://www.ossp.org/`
+        @echo &quot;==== UUID version 3 generation and decoding&quot;; \
+        $(LIBTOOL) --mode=execute ./$(PRG_NAME) -d `$(LIBTOOL) --mode=execute ./$(PRG_NAME) -v4`
+        -@if [ &quot;.$(WITH_PERL)&quot; = .yes ]; then \
+            echo &quot;==== Perl bindings to C API&quot;; \
+            (cd $(S)/perl &amp;&amp; $(MAKE) $(MFLAGS) test); \
+        fi
+        -@if [ &quot;.$(WITH_PHP)&quot; = .yes ]; then \
+            echo &quot;==== PHP bindings to C API&quot;; \
+            (cd $(S)/php &amp;&amp; $(MAKE) $(MFLAGS) -f Makefile.local test PHP=$(PHP)); \
+        fi
+        -@if [ &quot;.$(WITH_PGSQL)&quot; = .yes ]; then \
+            echo &quot;==== PGSQL bindings to C API&quot;; \
+            (cd $(S)/pgsql &amp;&amp; $(MAKE) $(MFLAGS) test PG_CONFIG=$(PG_CONFIG)); \
+        fi
+
+.PHONY: install
+install:
+        $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(prefix)
+        $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(bindir)
+        $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(includedir)
+        $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(libdir)/pkgconfig
+        $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man3
+        $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man1
+        $(SHTOOL) install -c -m 755 uuid-config $(DESTDIR)$(bindir)/
+        $(SHTOOL) install -c -m 644 $(S)/uuid-config.1 $(DESTDIR)$(mandir)/man1/
+        $(SHTOOL) install -c -m 644 $(S)/uuid.pc $(DESTDIR)$(libdir)/pkgconfig/
+        $(SHTOOL) install -c -m 644 uuid.h $(DESTDIR)$(includedir)/
+        -@if [ &quot;.$(WITH_DCE)&quot; = .yes ]; then \
+            echo &quot;$(SHTOOL) install -c -m 644 $(S)/uuid_dce.h $(DESTDIR)$(includedir)/&quot;; \
+            $(SHTOOL) install -c -m 644 $(S)/uuid_dce.h $(DESTDIR)$(includedir)/; \
+        fi
+        -@if [ &quot;.$(WITH_CXX)&quot; = .yes ]; then \
+            echo &quot;$(SHTOOL) install -c -m 644 $(S)/uuid++.hh $(DESTDIR)$(includedir)/&quot;; \
+            $(SHTOOL) install -c -m 644 $(S)/uuid++.hh $(DESTDIR)$(includedir)/; \
+        fi
+        $(SHTOOL) install -c -m 644 $(S)/uuid.3 $(DESTDIR)$(mandir)/man3/
+        -@if [ &quot;.$(WITH_CXX)&quot; = .yes ]; then \
+            echo &quot;$(SHTOOL) install -c -m 644 $(S)/uuid++.3 $(DESTDIR)$(mandir)/man3/&quot;; \
+            $(SHTOOL) install -c -m 644 $(S)/uuid++.3 $(DESTDIR)$(mandir)/man3/; \
+        fi
+        @$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 $(LIB_NAME) $(DESTDIR)$(libdir)/
+        -@if [ &quot;.$(WITH_DCE)&quot; = .yes ]; then \
+            $(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 $(DCE_NAME) $(DESTDIR)$(libdir)/; \
+        fi
+        -@if [ &quot;.$(WITH_CXX)&quot; = .yes ]; then \
+            $(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 $(CXX_NAME) $(DESTDIR)$(libdir)/; \
+        fi
+        @$(LIBTOOL) --mode=install $(SHTOOL) install -c -s -m 755 uuid $(DESTDIR)$(bindir)/
+        $(SHTOOL) install -c -m 644 $(S)/uuid.1 $(DESTDIR)$(mandir)/man1/
+        -@if [ &quot;.$(WITH_PERL)&quot; = .yes ]; then \
+            (cd $(S)/perl &amp;&amp; $(MAKE) $(MFLAGS) install DESTDIR=$(DESTDIR)); \
+        fi
+        -@if [ &quot;.$(WITH_PHP)&quot; = .yes ]; then \
+            (cd $(S)/php &amp;&amp; $(MAKE) $(MFLAGS) -f Makefile.local install EXTDIR=$(prefix)/lib/php PHP=$(PHP) DESTDIR=$(DESTDIR)); \
+        fi
+        -@if [ &quot;.$(WITH_PGSQL)&quot; = .yes ]; then \
+            (cd $(S)/pgsql &amp;&amp; $(MAKE) $(MFLAGS) install DESTDIR=$(DESTDIR) PG_CONFIG=$(PG_CONFIG)); \
+        fi
+
+.PHONY: uninstall
+uninstall:
+        -$(RM) $(DESTDIR)$(mandir)/man1/uuid.1
+        -@$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(bindir)/uuid
+        -@$(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(libdir)/$(LIB_NAME)
+        -@if [ &quot;.$(WITH_DCE)&quot; = .yes ]; then \
+            $(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(libdir)/$(DCE_NAME); \
+        fi
+        -@if [ &quot;.$(WITH_CXX)&quot; = .yes ]; then \
+            $(LIBTOOL) --mode=uninstall $(RM) $(DESTDIR)$(libdir)/$(CXX_NAME); \
+        fi
+        -$(RM) $(DESTDIR)$(mandir)/man3/uuid.3
+        -@if [ &quot;.$(WITH_CXX)&quot; = .yes ]; then \
+            echo &quot;$(RM) $(DESTDIR)$(mandir)/man3/uuid++.3&quot;; \
+            $(RM) $(DESTDIR)$(mandir)/man3/uuid++.3; \
+        fi
+        -$(RM) $(DESTDIR)$(includedir)/uuid.h
+        -@if [ &quot;.$(WITH_DCE)&quot; = .yes ]; then \
+            echo &quot;$(RM) $(DESTDIR)$(includedir)/uuid_dce.h&quot;; \
+            $(RM) $(DESTDIR)$(includedir)/uuid_dce.h; \
+        fi
+        -@if [ &quot;.$(WITH_CXX)&quot; = .yes ]; then \
+            echo &quot;$(RM) $(DESTDIR)$(includedir)/uuid++.hh&quot;; \
+            $(RM) $(DESTDIR)$(includedir)/uuid++.hh; \
+        fi
+        -$(RM) $(DESTDIR)$(libdir)/pkgconfig/uuid.pc
+        -$(RM) $(DESTDIR)$(mandir)/man1/uuid-config.1
+        -$(RM) $(DESTDIR)$(bindir)/uuid-config
+        -$(RMDIR) $(DESTDIR)$(mandir)/man1 &gt;/dev/null 2&gt;&amp;1 || $(TRUE)
+        -$(RMDIR) $(DESTDIR)$(mandir)/man3 &gt;/dev/null 2&gt;&amp;1 || $(TRUE)
+        -$(RMDIR) $(DESTDIR)$(mandir) &gt;/dev/null 2&gt;&amp;1 || $(TRUE)
+        -$(RMDIR) $(DESTDIR)$(libdir)/pkgconfig &gt;/dev/null 2&gt;&amp;1 || $(TRUE)
+        -$(RMDIR) $(DESTDIR)$(libdir) &gt;/dev/null 2&gt;&amp;1 || $(TRUE)
+        -$(RMDIR) $(DESTDIR)$(includedir) &gt;/dev/null 2&gt;&amp;1 || $(TRUE)
+        -$(RMDIR) $(DESTDIR)$(bindir) &gt;/dev/null 2&gt;&amp;1 || $(TRUE)
+        -$(RMDIR) $(DESTDIR)$(prefix) &gt;/dev/null 2&gt;&amp;1 || $(TRUE)
+
+.PHONY: clean
+clean:
+        -$(RM) $(LIB_NAME) $(LIB_OBJS)
+        -@if [ &quot;.$(WITH_DCE)&quot; = .yes ]; then \
+            echo &quot;$(RM) $(DCE_NAME) $(DCE_OBJS)&quot;; \
+            $(RM) $(DCE_NAME) $(DCE_OBJS); \
+        fi
+        -@if [ &quot;.$(WITH_CXX)&quot; = .yes ]; then \
+            echo &quot;$(RM) $(CXX_NAME) $(CXX_OBJS)&quot;; \
+            $(RM) $(CXX_NAME) $(CXX_OBJS); \
+        fi
+        -$(RM) $(PRG_NAME) $(PRG_OBJS)
+        -$(RM) -r .libs &gt;/dev/null 2&gt;&amp;1 || $(TRUE)
+        -$(RM) *.o *.lo
+        -@if [ &quot;.$(WITH_PERL)&quot; = .yes ]; then \
+            (cd $(S)/perl &amp;&amp; $(MAKE) $(MFLAGS) clean || true); \
+        fi
+        -@if [ &quot;.$(WITH_PHP)&quot; = .yes ]; then \
+            (cd $(S)/php &amp;&amp; $(MAKE) $(MFLAGS) -f Makefile.local clean || true); \
+        fi
+        -@if [ &quot;.$(WITH_PGSQL)&quot; = .yes ]; then \
+            (cd $(S)/pgsql &amp;&amp; $(MAKE) $(MFLAGS) clean PG_CONFIG=$(PG_CONFIG) || true); \
+        fi
+
+distclean: clean
+        -$(RM) config.log config.status config.cache
+        -$(RM) Makefile config.h uuid-config uuid.h uuid.pc
+        -$(RM) libtool
+        -@if [ &quot;.$(WITH_PERL)&quot; = .yes ]; then \
+            (cd $(S)/perl &amp;&amp; $(MAKE) $(MFLAGS) distclean || true; rm -f Makefile.old); \
+        fi
+        -@if [ &quot;.$(WITH_PHP)&quot; = .yes ]; then \
+            (cd $(S)/php &amp;&amp; $(MAKE) $(MFLAGS) -f Makefile.local distclean || true); \
+        fi
+        -@if [ &quot;.$(WITH_PGSQL)&quot; = .yes ]; then \
+            (cd $(S)/pgsql &amp;&amp; $(MAKE) $(MFLAGS) distclean PG_CONFIG=$(PG_CONFIG) || true); \
+        fi
+
+realclean: distclean
+        -$(RM) uuid.3 uuid.1
+        -$(RM) configure config.h.in
+        -$(RM) shtool
+        -$(RM) ltmain.sh libtool.m4 config.guess config.sub
+        -@if [ &quot;.$(WITH_PERL)&quot; = .yes ]; then \
+            (cd $(S)/perl &amp;&amp; $(MAKE) $(MFLAGS) realclean || true; rm -f Makefile.old); \
+        fi
+        -@if [ &quot;.$(WITH_PHP)&quot; = .yes ]; then \
+            (cd $(S)/php &amp;&amp; $(MAKE) $(MFLAGS) -f Makefile.local realclean || true); \
+        fi
+        -@if [ &quot;.$(WITH_PGSQL)&quot; = .yes ]; then \
+            (cd $(S)/pgsql &amp;&amp; $(MAKE) $(MFLAGS) realclean PG_CONFIG=$(PG_CONFIG) || true); \
+        fi
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidNEWS"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/NEWS (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/NEWS                                (rev 0)
+++ freeswitch/trunk/libs/uuid/NEWS        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+   _        ___  ____ ____  ____                _     _
+  |_|_ _   / _ \/ ___/ ___||  _ \   _   _ _   _(_) __| |
+  _|_||_| | | | \___ \___ \| |_) | | | | | | | | |/ _` |
+ |_||_|_| | |_| |___) |__) |  __/  | |_| | |_| | | (_| |
+  |_|_|_|  \___/|____/____/|_|      \__,_|\__,_|_|\__,_|
+
+  OSSP uuid - Universally Unique Identifier
+
+  NEWS
+
+  This is a list of major changes to OSSP uuid. For more detailed
+  change descriptions, please have a look at the ChangeLog file.
+
+  Major changes between 1.4 and 1.5
+
+    o Many internal code cleanups and fixes.
+    o Improved and fixed PostgreSQL API.
+    o Improved and fixed PHP API.
+
+  Major changes between 1.3 and 1.4
+
+    o Added PostgreSQL API.
+
+  Major changes between 1.2 and 1.3
+
+    o Added Perl TIE-style API.
+    o Added Perl Data::UUID backward compatibility API.
+    o Added C++ API.
+    o Added PHP API.
+
+  Major changes between 1.1 and 1.2
+
+    o Added support for version 5 UUIDs (name-based, SHA-1)
+
+  Major changes between 1.0 and 1.1
+
+    o Added Perl API
+
+  Major changes between 0.9 and 1.0
+
+    o Initial functionality
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidOVERVIEW"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/OVERVIEW (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/OVERVIEW                                (rev 0)
+++ freeswitch/trunk/libs/uuid/OVERVIEW        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,81 @@
</span><ins>+
+   _        ___  ____ ____  ____                _     _
+  |_|_ _   / _ \/ ___/ ___||  _ \   _   _ _   _(_) __| |
+  _|_||_| | | | \___ \___ \| |_) | | | | | | | | |/ _` |
+ |_||_|_| | |_| |___) |__) |  __/  | |_| | |_| | | (_| |
+  |_|_|_|  \___/|____/____/|_|      \__,_|\__,_|_|\__,_|
+
+  OSSP uuid - Universally Unique Identifier
+
+  OVERVIEW
+
+  A UUID consists of 128 bits (16-octets) which are split into 6
+  octet-bounded unsigned integer fields (&quot;time_low&quot;, &quot;time_mid&quot;,
+  &quot;time_hi_and_version&quot;, &quot;clk_seq_hi_res&quot;, &quot;clk_seq_low&quot; and &quot;node&quot;) and
+  where two fields are multiplexed with a fixed size 4-bit &quot;version&quot; and
+  a variable sized 2-3 bit &quot;variant&quot; field.
+
+  The UUID octets are counted from left to right 15 to 0 and the bits
+  in each octet are counted from left to right 7 to 0 (most significant
+  bit first, least significant bit last). The unsigned integer fields
+  formed out of multiple octets are stored in &quot;network byte order&quot; (most
+  significant octet first, least significant octet last). A UUID is
+  stored and transmitted from left to right, i.e., in &quot;network byte
+  order&quot; with the most significant octet first and the least significant
+  octet last.
+
+  Illustration 1:
+  (single octet array, less compact, more annotations)
+
+
+  Bits:                                                   [4]           [2-3]
+  Field:                                                version        variant
+        MSO                                           --&gt;|  |&lt;--      --&gt;| |&lt;--                                                        LSO
+           \                                             |  |            | |                                                          /
+  Octet:    15      14      13      12      11      10   |  |9       8   | | 7       6       5       4       3       2       1       0
+         +------++------++------++------++------++------++------++------++------++------++------++------++------++------++------++------+
+  UUID:  |      ||      ||      ||      ||      ||      |####   ||      |##:    ||      ||      ||      ||      ||      ||      ||      |
+         +------++------++------++------++------++------++------++------++------++------++------++------++------++------++------++------+
+  Bit:   76543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076543210765432107654321076543210
+        /|                              ||              ||              ||      ||      ||                                              |\
+     MSB |                              ||              ||              ||      ||      ||                                              | LSB
+         |&lt;----------------------------&gt;||&lt;------------&gt;||&lt;------------&gt;||&lt;----&gt;||&lt;----&gt;||&lt;--------------------------------------------&gt;|
+                                                           time_hi        clk_seq clk_seq
+  Field:           time_low                  time_mid      _and_version   _hi_res _low                         node
+  Bits:              [32]                      [16]           [16]        [5-6]     [8]                        [48]
+
+
+  Illustration 2:
+  (two octet arrays, more compact, less annotations)
+
+                                                        [4]
+                                                      version
+                                                    --&gt;|  |&lt;--
+                                                       |  |
+                                                       |  |  [16]
+                   [32]                      [16]      |  |time_hi
+                 time_low                  time_mid    | _and_version
+       |&lt;----------------------------&gt;||&lt;------------&gt;||&lt;------------&gt;|
+       |    MSO                       ||              ||  |           |
+       |   /                          ||              ||  |           |
+       |  15      14      13      12  ||  11      10  ||  |9       8  |
+       7654321076543210765432107654321076543210765432107654321076543210
+      /+------++------++------++------++------++------++------++------+~
+   MSB |      ||      ||      ||      ||      ||      |####   ||      |  ...
+       +------++------++------++------++------++------++------++------+~
+      ~+------++------++------++------++------++------++------++------+
+  ...  ##:    ||      ||      ||      ||      ||      ||      ||      | LSB
+      ~+------++------++------++------++------++------++------++------+/
+       7654321076543210765432107654321076543210765432107654321076543210
+       | | 7  ||   6  ||   5       4       3       2       1       0  |
+       | |    ||      ||                                          /   |
+       | |    ||      ||                                        LSO   |
+       |&lt;----&gt;||&lt;----&gt;||&lt;--------------------------------------------&gt;|
+       |clk_seq clk_seq                      node
+       |_hi_res _low                         [48]
+       |[5-6]    [8]
+       | |
+    --&gt;| |&lt;--
+     variant
+      [2-3]
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidPORTING"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/PORTING (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/PORTING                                (rev 0)
+++ freeswitch/trunk/libs/uuid/PORTING        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+   _        ___  ____ ____  ____                _     _
+  |_|_ _   / _ \/ ___/ ___||  _ \   _   _ _   _(_) __| |
+  _|_||_| | | | \___ \___ \| |_) | | | | | | | | |/ _` |
+ |_||_|_| | |_| |___) |__) |  __/  | |_| | |_| | | (_| |
+  |_|_|_|  \___/|____/____/|_|      \__,_|\__,_|_|\__,_|
+
+  OSSP uuid - Universally Unique Identifier
+
+  PORTING
+
+  OSSP uuid was already written with maximum portability in mind, so
+  there should be no great effort required to get it running on any Unix
+  platform with a reasonable POSIX API. Additionally, the portability
+  was tested by successfully building and running it on the following
+  particular Unix platforms (syntax is &quot;&lt;cpu&gt;-&lt;os&gt; (&lt;compiler&gt;)&quot;):
+
+      alpha-tru644.0 (cc)
+      alpha-tru645.1 (gcc, cc)
+      hppa-hpux11.11 (cc)
+      ia64-hpux11.23 (cc)
+      ix86-debian2.2 (gcc, icc)
+      ix86-debian3.0 (gcc)
+      ix86-debian3.1 (gcc)
+      ix86-freebsd4.9 (gcc)
+      ix86-freebsd5.2 (gcc, icc)
+      ix86-netbsd1.6 (gcc)
+      ix86-qnx6.2 (gcc)
+      ix86-solaris10 (gcc)
+      ix86-unixware7.1.3 (cc)
+      mips64-irix6.5 (gcc)
+      sparc64-solaris8 (gcc, forte)
+      sparc64-solaris9 (gcc)
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidREADME"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/README (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/README                                (rev 0)
+++ freeswitch/trunk/libs/uuid/README        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+   _        ___  ____ ____  ____                _     _
+  |_|_ _   / _ \/ ___/ ___||  _ \   _   _ _   _(_) __| |
+  _|_||_| | | | \___ \___ \| |_) | | | | | | | | |/ _` |
+ |_||_|_| | |_| |___) |__) |  __/  | |_| | |_| | | (_| |
+  |_|_|_|  \___/|____/____/|_|      \__,_|\__,_|_|\__,_|
+
+  OSSP uuid - Universally Unique Identifier
+  Version 1.6.2 (04-Jul-2008)
+
+  ABSTRACT
+
+  OSSP uuid is a ISO-C:1999 application programming interface (API)
+  and corresponding command line interface (CLI) for the generation of
+  DCE 1.1, ISO/IEC 11578:1996 and IETF RFC-4122 compliant Universally
+  Unique Identifier (UUID). It supports DCE 1.1 variant UUIDs of version
+  1 (time and node based), version 3 (name based, MD5), version 4
+  (random number based) and version 5 (name based, SHA-1). Additional
+  API bindings are provided for the languages ISO-C++:1998, Perl:5 and
+  PHP:4/5. Optional backward compatibility exists for the ISO-C DCE-1.1
+  and Perl Data::UUID APIs.
+
+  UUIDs are 128 bit numbers which are intended to have a high likelihood
+  of uniqueness over space and time and are computationally difficult
+  to guess. They are globally unique identifiers which can be locally
+  generated without contacting a global registration authority. UUIDs
+  are intended as unique identifiers for both mass tagging objects
+  with an extremely short lifetime and to reliably identifying very
+  persistent objects across a network.
+
+  COPYRIGHT AND LICENSE
+
+  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+
+  This file is part of OSSP uuid, a library for the generation
+  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+
+  Permission to use, copy, modify, and distribute this software for
+  any purpose with or without fee is hereby granted, provided that
+  the above copyright notice and this permission notice appear in all
+  copies.
+
+  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  SUCH DAMAGE.
+
+  HOME AND DOCUMENTATION
+
+  The documentation and latest release can be found on
+
+  o http://www.ossp.org/pkg/lib/uuid/
+  o  ftp://ftp.ossp.org/pkg/lib/uuid/
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidSEEALSO"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/SEEALSO (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/SEEALSO                                (rev 0)
+++ freeswitch/trunk/libs/uuid/SEEALSO        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+   _        ___  ____ ____  ____                _     _
+  |_|_ _   / _ \/ ___/ ___||  _ \   _   _ _   _(_) __| |
+  _|_||_| | | | \___ \___ \| |_) | | | | | | | | |/ _` |
+ |_||_|_| | |_| |___) |__) |  __/  | |_| | |_| | | (_| |
+  |_|_|_|  \___/|____/____/|_|      \__,_|\__,_|_|\__,_|
+
+  OSSP uuid - Universally Unique Identifier
+
+  SEE ALSO
+
+  Although we consider OSSP uuid the ultimate reference implementation
+  of an UUID generator, there are multiple alternatives available.
+  Following is a short reference of all currently known UUID
+  implementations for platforms with an Unix/POSIX API:
+
+  o OSSP uuid (ISO-C), OSSP::uuid (Perl)
+    http://www.ossp.org/pkg/lib/uuid/
+    http://cvs.ossp.org/ossp-pkg/uuid/
+
+  o FreeBSD libc (ISO-C)
+    http://www.freebsd.org/
+    http://www.freebsd.org/cgi/cvsweb.cgi/src/lib/libc/uuid/
+
+  o Sun Solaris libc (ISO-C), DCE::UUID (Perl/XS)
+    http://www.opensolaris.org/
+    http://cvs.opensolaris.org/source/xref/usr/src/lib/libuuid/
+
+  o APR libaprutil (ISO-C), APR::UUID (Perl/XS)
+    http://svn.apache.org/repos/asf/apr/apr-util/trunk/crypto/
+
+  o e2fsprogs/libuuid (ISO-C), UUID (Perl/XS)
+    http://e2fsprogs.sourceforge.net/
+    http://thunk.org/hg/e2fsprogs/
+
+  o Wine rpcrt4 DLL (ISO-C)
+    http://www.winehq.org/
+
+  o Data::UUID (Perl/XS)
+    http://search.cpan.org/src/AGOLOMSH/
+    http://www.cpan.org/modules/by-module/Data/
+
+  o JUG (Java/JNI)
+    http://www.doomdark.org/doomdark/proj/jug/
+
+  o Mozilla (ISO-C, ISO-C++)
+    http://www.mozilla.org/
+    http://lxr.mozilla.org/mozilla1.7/source/calendar/libxpical/token.c
+
+  o HelixPlayer (ISO-C, ISO-C++)
+    https://player.helixcommunity.org/
+    common/util/chxuuid.cpp
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidTHANKS"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/THANKS (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/THANKS                                (rev 0)
+++ freeswitch/trunk/libs/uuid/THANKS        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+   _        ___  ____ ____  ____                _     _
+  |_|_ _   / _ \/ ___/ ___||  _ \   _   _ _   _(_) __| |
+  _|_||_| | | | \___ \___ \| |_) | | | | | | | | |/ _` |
+ |_||_|_| | |_| |___) |__) |  __/  | |_| | |_| | | (_| |
+  |_|_|_|  \___/|____/____/|_|      \__,_|\__,_|_|\__,_|
+
+  OSSP uuid - Universally Unique Identifier
+
+  THANKS
+
+  Credit has to be given to the following people who contributed ideas,
+  bugfixes, hints, gave platform feedback, etc. (in alphabetical order):
+
+    o  Matthias Andree             &lt;matthias.andree@gmx.de&gt;
+    o  Neil Caunt                  &lt;retardis@gmail.com&gt; 
+    o  Neil Conway                 &lt;neilc@samurai.com&gt;
+    o  M. Daniel                   &lt;mdaniel@scdi.com&gt;
+    o  Simon &quot;janus&quot; Dassow        &lt;janus@errornet.de&gt;
+    o  Fuyuki                      &lt;fuyuki@nigredo.org&gt;
+    o  Thomas Lotterer             &lt;thomas@lotterer.net&gt;
+    o  Roman Neuhauser             &lt;neuhauser@sigpipe.cz&gt;
+    o  Hrvoje Niksic               &lt;hniksic@xemacs.org&gt;
+    o  Piotr Roszatycki            &lt;dexter@debian.org&gt;
+    o  Hiroshi Saito               &lt;z-saito@guitar.ocn.ne.jp&gt;
+    o  Michael Schloh              &lt;michael@schloh.com&gt;
+    o  Guerry Semones              &lt;guerry@tsunamiresearch.com&gt;
+    o  David Wheeler               &lt;david@justatheory.com&gt;
+    o  Wu Yongwei                  &lt;wuyongwei@gmail.com&gt;
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidTODO"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/TODO (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/TODO                                (rev 0)
+++ freeswitch/trunk/libs/uuid/TODO        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+   _        ___  ____ ____  ____                _     _
+  |_|_ _   / _ \/ ___/ ___||  _ \   _   _ _   _(_) __| |
+  _|_||_| | | | \___ \___ \| |_) | | | | | | | | |/ _` |
+ |_||_|_| | |_| |___) |__) |  __/  | |_| | |_| | | (_| |
+  |_|_|_|  \___/|____/____/|_|      \__,_|\__,_|_|\__,_|
+
+  OSSP uuid - Universally Unique Identifier
+
+  TODO
+  ====
+
+  - &lt;none&gt;
+
+  CANDO
+  =====
+
+  - allow to re-create version 1 UUIDs by specifying time, etc.
+  - getopt_long support for CLI?
+  - a more sophisticated test suite with UUID references?!
+  - more platform support in uuid_mac.c?!
+  - global memory locking according to standard hints??
+  - persistent/non-volatile state writing according to standard hints??
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidUSERS"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/USERS (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/USERS                                (rev 0)
+++ freeswitch/trunk/libs/uuid/USERS        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+   _        ___  ____ ____  ____                _     _
+  |_|_ _   / _ \/ ___/ ___||  _ \   _   _ _   _(_) __| |
+  _|_||_| | | | \___ \___ \| |_) | | | | | | | | |/ _` |
+ |_||_|_| | |_| |___) |__) |  __/  | |_| | |_| | | (_| |
+  |_|_|_|  \___/|____/____/|_|      \__,_|\__,_|_|\__,_|
+
+  OSSP uuid - Universally Unique Identifier
+
+  USERS
+
+  OSSP uuid is known to be used by at least the following
+  Open Source software packages:
+
+  o PostgreSQL
+    Relational Database Management System (RDBMS)
+    http://www.postgresql.org/
+
+  o Aegis
+    Software Configuration Management (SCM) System
+    http://aegis.sourceforge.net/
+
+  o Heartbeat
+    Core component of the High-Availability Linux (Linux-HA) project
+    http://linux-ha.org/heartbeat/
+
+  o GAT
+    Grid Application Toolkit (GAT) 
+    https://www.gridlab.org/WorkPackages/wp-1/ 
+
+  o Menes
+    High-Level C++ Library for mutexes, networking, etc.
+    http://www.saurik.com/
+    http://svn.saurik.com/repos/menes/trunk/
+
+  o OpenAether OAPR
+    C++ wrapper for NSPR
+    http://www.openaether.org/oapr.html
+
+  o Gauche Scheme Interpreter, UUID extension
+    http://cvs.sourceforge.jp/cgi-bin/viewcvs.cgi/gauche/Gauche-uuid/
+    http://www.shiro.dreamhost.com/scheme/gauche/
+
+  o Guile Extension Examples (GEE)
+    https://gna.org/projects/gee
+
+  o CGI::Session::ID::uuid
+    UUID based ID generator backend for CGI::Session
+    http://www.cpan.org/modules/by-authors/id/RSE/ 
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidacincludem4"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/acinclude.m4 (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/acinclude.m4                                (rev 0)
+++ freeswitch/trunk/libs/uuid/acinclude.m4        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,352 @@
</span><ins>+dnl ##
+dnl ##  SA - OSSP Socket Abstraction Library
+dnl ##  Copyright (c) 2001-2003 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+dnl ##  Copyright (c) 2001-2003 The OSSP Project &lt;http://www.ossp.org/&gt;
+dnl ##  Copyright (c) 2001-2003 Cable &amp; Wireless Deutschland &lt;http://www.cw.com/de/&gt;
+dnl ##
+dnl ##  This file is part of OSSP SA, a socket abstraction library which
+dnl ##  can be found at http://www.ossp.org/pkg/sa/.
+dnl ##
+dnl ##  Permission to use, copy, modify, and distribute this software for
+dnl ##  any purpose with or without fee is hereby granted, provided that
+dnl ##  the above copyright notice and this permission notice appear in all
+dnl ##  copies.
+dnl ##
+dnl ##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+dnl ##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+dnl ##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+dnl ##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+dnl ##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+dnl ##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+dnl ##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+dnl ##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+dnl ##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+dnl ##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+dnl ##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+dnl ##  SUCH DAMAGE.
+dnl ##
+dnl ##  aclocal.m4: GNU Autoconf local macro definitions
+dnl ##
+
+dnl ##
+dnl ##  Check whether compiler option works
+dnl ##
+dnl ##  configure.in:
+dnl ##    AC_COMPILER_OPTION(&lt;name&gt;, &lt;display&gt;, &lt;option&gt;,
+dnl ##                       &lt;action-success&gt;, &lt;action-failure&gt;)
+dnl ##
+
+AC_DEFUN([AC_COMPILER_OPTION],[dnl
+AC_MSG_CHECKING(whether compiler option(s) $2 work)
+AC_CACHE_VAL(ac_cv_compiler_option_$1,[
+SAVE_CFLAGS=&quot;$CFLAGS&quot;
+CFLAGS=&quot;$CFLAGS $3&quot;
+AC_TRY_COMPILE([],[], ac_cv_compiler_option_$1=yes, ac_cv_compiler_option_$1=no)
+CFLAGS=&quot;$SAVE_CFLAGS&quot;
+])dnl
+if test &quot;.$ac_cv_compiler_option_$1&quot; = .yes; then
+    ifelse([$4], , :, [$4])
+else
+    ifelse([$5], , :, [$5])
+fi
+AC_MSG_RESULT([$ac_cv_compiler_option_$1])
+])dnl
+
+dnl ##
+dnl ##  Debugging Support
+dnl ##
+dnl ##  configure.in:
+dnl ##    AC_CHECK_DEBUGGING
+dnl ##
+
+AC_DEFUN([AC_CHECK_DEBUGGING],[dnl
+AC_ARG_ENABLE(debug,dnl
+[  --enable-debug          build for debugging (default=no)],
+[dnl
+if test &quot;.$ac_cv_prog_gcc&quot; = &quot;.yes&quot;; then
+    case &quot;$CFLAGS&quot; in
+        *-O* ) ;;
+           * ) CFLAGS=&quot;$CFLAGS -O2&quot; ;;
+    esac
+    case &quot;$CFLAGS&quot; in
+        *-g* ) ;;
+           * ) CFLAGS=&quot;$CFLAGS -g&quot; ;;
+    esac
+    case &quot;$CFLAGS&quot; in
+        *-pipe* ) ;;
+              * ) AC_COMPILER_OPTION(pipe, -pipe, -pipe, CFLAGS=&quot;$CFLAGS -pipe&quot;) ;;
+    esac
+    AC_COMPILER_OPTION(defdbg, -DDEBUG, -DDEBUG, CFLAGS=&quot;$CFLAGS -DDEBUG&quot;)
+    CFLAGS=&quot;$CFLAGS -pedantic&quot;
+    CFLAGS=&quot;$CFLAGS -Wall&quot;
+    WMORE=&quot;-Wshadow -Wpointer-arith -Wcast-align -Winline&quot;
+    WMORE=&quot;$WMORE -Wmissing-prototypes -Wmissing-declarations -Wnested-externs&quot;
+    AC_COMPILER_OPTION(wmore, -W&lt;xxx&gt;, $WMORE, CFLAGS=&quot;$CFLAGS $WMORE&quot;)
+    AC_COMPILER_OPTION(wnolonglong, -Wno-long-long, -Wno-long-long, CFLAGS=&quot;$CFLAGS -Wno-long-long&quot;)
+else
+    case &quot;$CFLAGS&quot; in
+        *-g* ) ;;
+           * ) CFLAGS=&quot;$CFLAGS -g&quot; ;;
+    esac
+fi
+msg=&quot;enabled&quot;
+],[
+if test &quot;.$ac_cv_prog_gcc&quot; = &quot;.yes&quot;; then
+case &quot;$CFLAGS&quot; in
+    *-pipe* ) ;;
+          * ) AC_COMPILER_OPTION(pipe, -pipe, -pipe, CFLAGS=&quot;$CFLAGS -pipe&quot;) ;;
+esac
+fi
+case &quot;$CFLAGS&quot; in
+    *-g* ) CFLAGS=`echo &quot;$CFLAGS&quot; |\
+                   sed -e 's/ -g / /g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` ;;
+esac
+case &quot;$CXXFLAGS&quot; in
+    *-g* ) CXXFLAGS=`echo &quot;$CXXFLAGS&quot; |\
+                     sed -e 's/ -g / /g' -e 's/ -g$//' -e 's/^-g //g' -e 's/^-g$//'` ;;
+esac
+msg=disabled
+])dnl
+AC_MSG_CHECKING(for compilation debug mode)
+AC_MSG_RESULT([$msg])
+if test &quot;.$msg&quot; = .enabled; then
+    enable_shared=no
+fi
+])
+
+dnl ##
+dnl ##  Check for C99 va_copy() implementation
+dnl ##  (and provide fallback implementation if neccessary)
+dnl ##
+dnl ##  configure.in:
+dnl ##    AC_CHECK_VA_COPY
+dnl ##  foo.c:
+dnl ##    #include &quot;config.h&quot;
+dnl ##    [...]
+dnl ##    va_copy(d,s)
+dnl ##
+dnl ##  This check is rather complex: first because we really have to
+dnl ##  try various possible implementations in sequence and second, we
+dnl ##  cannot define a macro in config.h with parameters directly.
+dnl ##
+
+dnl #   test program for va_copy() implementation
+changequote(&lt;&lt;,&gt;&gt;)
+m4_define(__va_copy_test, &lt;&lt;[
+#include &lt;stdlib.h&gt;
+#include &lt;stdarg.h&gt;
+#include &lt;string.h&gt;
+#define DO_VA_COPY(d, s) $1
+void test(char *str, ...)
+{
+    va_list ap, ap2;
+    int i;
+    va_start(ap, str);
+    DO_VA_COPY(ap2, ap);
+    for (i = 1; i &lt;= 9; i++) {
+        int k = (int)va_arg(ap, int);
+        if (k != i)
+            abort();
+    }
+    DO_VA_COPY(ap, ap2);
+    for (i = 1; i &lt;= 9; i++) {
+        int k = (int)va_arg(ap, int);
+        if (k != i)
+            abort();
+    }
+    va_end(ap);
+}
+int main(int argc, char *argv[])
+{
+    test(&quot;test&quot;, 1, 2, 3, 4, 5, 6, 7, 8, 9);
+    exit(0);
+}
+]&gt;&gt;)
+changequote([,])
+
+dnl #   test driver for va_copy() implementation
+m4_define(__va_copy_check, [
+    AH_VERBATIM($1,
+[/* Predefined possible va_copy() implementation (id: $1) */
+#define __VA_COPY_USE_$1(d, s) $2])
+    if test &quot;.$ac_cv_va_copy&quot; = .; then
+        AC_TRY_RUN(__va_copy_test($2), [ac_cv_va_copy=&quot;$1&quot;])
+    fi
+])
+
+dnl #   Autoconf check for va_copy() implementation checking
+AC_DEFUN([AC_CHECK_VA_COPY],[
+  dnl #   provide Autoconf display check message
+  AC_MSG_CHECKING(for va_copy() function)
+  dnl #   check for various implementations in priorized sequence   
+  AC_CACHE_VAL(ac_cv_va_copy, [
+    ac_cv_va_copy=&quot;&quot;
+    dnl #   1. check for standardized C99 macro
+    __va_copy_check(C99, [va_copy((d), (s))])
+    dnl #   2. check for alternative/deprecated GCC macro
+    __va_copy_check(GCM, [VA_COPY((d), (s))])
+    dnl #   3. check for internal GCC macro (high-level define)
+    __va_copy_check(GCH, [__va_copy((d), (s))])
+    dnl #   4. check for internal GCC macro (built-in function)
+    __va_copy_check(GCB, [__builtin_va_copy((d), (s))])
+    dnl #   5. check for assignment approach (assuming va_list is a struct)
+    __va_copy_check(ASS, [do { (d) = (s); } while (0)])
+    dnl #   6. check for assignment approach (assuming va_list is a pointer)
+    __va_copy_check(ASP, [do { *(d) = *(s); } while (0)])
+    dnl #   7. check for memory copying approach (assuming va_list is a struct)
+    __va_copy_check(CPS, [memcpy((void *)&amp;(d), (void *)&amp;(s), sizeof((s)))])
+    dnl #   8. check for memory copying approach (assuming va_list is a pointer)
+    __va_copy_check(CPP, [memcpy((void *)(d), (void *)(s), sizeof(*(s)))])
+    if test &quot;.$ac_cv_va_copy&quot; = .; then
+        AC_ERROR([no working implementation found])
+    fi
+  ])
+  dnl #   optionally activate the fallback implementation
+  if test &quot;.$ac_cv_va_copy&quot; = &quot;.C99&quot;; then
+      AC_DEFINE(HAVE_VA_COPY, 1, [Define if va_copy() macro exists (and no fallback implementation is required)])
+  fi
+  dnl #   declare which fallback implementation to actually use
+  AC_DEFINE_UNQUOTED([__VA_COPY_USE], [__VA_COPY_USE_$ac_cv_va_copy],
+      [Define to id of used va_copy() implementation])
+  dnl #   provide activation hook for fallback implementation
+  AH_VERBATIM([__VA_COPY_ACTIVATION],
+[/* Optional va_copy() implementation activation */
+#ifndef HAVE_VA_COPY
+#define va_copy(d, s) __VA_COPY_USE(d, s)
+#endif
+])
+  dnl #   provide Autoconf display result message
+  if test &quot;.$ac_cv_va_copy&quot; = &quot;.C99&quot;; then
+      AC_MSG_RESULT([yes])
+  else
+      AC_MSG_RESULT([no (using fallback implementation)])
+  fi
+])
+
+dnl ##
+dnl ##  Check for an external/extension library.
+dnl ##  - is aware of &lt;libname&gt;-config style scripts
+dnl ##  - searches under standard paths include, lib, etc.
+dnl ##  - searches under subareas like .libs, etc.
+dnl ##
+dnl ##  configure.in:
+dnl ##      AC_CHECK_EXTLIB(&lt;realname&gt;, &lt;libname&gt;, &lt;func&gt;, &lt;header&gt;,
+dnl ##                      [&lt;success-action&gt; [, &lt;fail-action&gt;]])
+dnl ##  Makefile.in:
+dnl ##      CFLAGS  = @CFLAGS@
+dnl ##      LDFLAGS = @LDFLAGS@
+dnl ##      LIBS    = @LIBS@
+dnl ##  shell:
+dnl ##      $ ./configure --with-&lt;libname&gt;[=DIR]
+dnl ##
+
+AC_DEFUN([AC_CHECK_EXTLIB],[dnl
+AC_ARG_WITH($2, [dnl
+[  --with-]m4_substr([$2[[=DIR]]                     ], 0, 19)[build with external $1 library (default=no)]], [dnl
+    if test &quot;.$with_$2&quot; = .yes; then
+        #   via config script in PATH
+        $2_version=`($2-config --version) 2&gt;/dev/null`
+        if test &quot;.$$2_version&quot; != .; then
+            CPPFLAGS=&quot;$CPPFLAGS `$2-config --cflags`&quot;
+            CFLAGS=&quot;$CFLAGS `$2-config --cflags`&quot;
+            LDFLAGS=&quot;$LDFLAGS `$2-config --ldflags`&quot;
+        fi
+    else
+        if test -d &quot;$with_$2&quot;; then
+            found=0
+            #   via config script
+            for dir in $with_$2/bin $with_$2; do
+                if test -f &quot;$dir/$2-config&quot; &amp;&amp; test ! -f &quot;$dir/$2-config.in&quot;; then
+                    $2_version=`($dir/$2-config --version) 2&gt;/dev/null`
+                    if test &quot;.$$2_version&quot; != .; then
+                        CPPFLAGS=&quot;$CPPFLAGS `$dir/$2-config --cflags`&quot;
+                        CFLAGS=&quot;$CFLAGS `$dir/$2-config --cflags`&quot;
+                        LDFLAGS=&quot;$LDFLAGS `$dir/$2-config --ldflags`&quot;
+                        found=1
+                        break
+                    fi
+                fi
+            done
+            #   in standard sub-areas
+            if test &quot;.$found&quot; = .0; then
+                for dir in $with_$2/include/$2 $with_$2/include $with_$2; do
+                    if test -f &quot;$dir/$4&quot;; then
+                        CPPFLAGS=&quot;$CPPFLAGS -I$dir&quot;
+                        CFLAGS=&quot;$CFLAGS -I$dir&quot;
+                        found=1
+                        break
+                    fi
+                done
+                for dir in $with_$2/lib/$2 $with_$2/lib $with_$2; do
+                    if test -f &quot;$dir/lib$2.la&quot; &amp;&amp; test -d &quot;$dir/.libs&quot;; then
+                        LDFLAGS=&quot;$LDFLAGS -L$dir -L$dir/.libs&quot;
+                        found=1
+                        break
+                    elif test -f &quot;$dir/lib$2.a&quot; || test -f &quot;$dir/lib$2.so&quot;; then
+                        LDFLAGS=&quot;$LDFLAGS -L$dir&quot;
+                        found=1
+                        break
+                    fi
+                done
+            fi
+            #   in any sub-area
+            if test &quot;.$found&quot; = .0; then
+changequote(, )dnl
+                for file in x `find $with_$2 -name &quot;$4&quot; -type f -print`; do
+                    test .$file = .x &amp;&amp; continue
+                    dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'`
+                    CPPFLAGS=&quot;$CPPFLAGS -I$dir&quot;
+                    CFLAGS=&quot;$CFLAGS -I$dir&quot;
+                done
+                for file in x `find $with_$2 -name &quot;lib$2.[aso]&quot; -type f -print`; do
+                    test .$file = .x &amp;&amp; continue
+                    dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'`
+                    LDFLAGS=&quot;$LDFLAGS -L$dir&quot;
+                done
+changequote([, ])dnl
+            fi
+        fi
+    fi
+    AC_HAVE_HEADERS($4)
+    AC_CHECK_LIB($2, $3)
+    with_$2=yes
+    ac_var=&quot;ac_cv_header_`echo $4 | sed 'y%./+-%__p_%'`&quot;
+    eval &quot;ac_val=\$$ac_var&quot;
+    if test &quot;.$ac_val&quot; != .yes; then
+        with_$2=no
+    fi
+    if test &quot;.$ac_cv_lib_$2_$3&quot; != .yes; then
+        with_$2=no
+    fi
+    if test &quot;.$with_$2&quot; = .no; then
+        AC_ERROR([Unable to find $1 library])
+    fi
+    ], [dnl
+if test &quot;.$with_$2&quot; = .; then
+    with_$2=no
+fi
+    ])dnl
+AC_MSG_CHECKING(whether to build against external $1 library)
+if test &quot;.$with_$2&quot; = .yes; then
+    ifelse([$5], , :, [$5])
+else
+    ifelse([$6], , :, [$6])
+fi
+AC_MSG_RESULT([$with_$2])
+])dnl
+
+dnl ##
+dnl ##  Check whether to activate Dmalloc
+dnl ##
+dnl ##  configure.in:
+dnl ##    AC_CHECK_DMALLOC
+dnl ##
+
+AC_DEFUN([AC_CHECK_DMALLOC],[dnl
+AC_CHECK_EXTLIB(Dmalloc, dmalloc, dmalloc_debug, dmalloc.h,
+                AC_DEFINE(WITH_DMALLOC, 1, [define if building with Dmalloc]))
+if test &quot;.$with_dmalloc&quot; = .yes; then
+    CFLAGS=`echo &quot;X$CFLAGS&quot; | sed -e 's;^X;;' -e 's; -Wredundant-decls;;'`
+fi
+])dnl
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidconfighin"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/config.h.in (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/config.h.in                                (rev 0)
+++ freeswitch/trunk/libs/uuid/config.h.in        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,212 @@
</span><ins>+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Predefined possible va_copy() implementation (id: ASP) */
+#define __VA_COPY_USE_ASP(d, s) do { *(d) = *(s); } while (0)
+
+/* Predefined possible va_copy() implementation (id: ASS) */
+#define __VA_COPY_USE_ASS(d, s) do { (d) = (s); } while (0)
+
+/* Predefined possible va_copy() implementation (id: C99) */
+#define __VA_COPY_USE_C99(d, s) va_copy((d), (s))
+
+/* Predefined possible va_copy() implementation (id: CPP) */
+#define __VA_COPY_USE_CPP(d, s) memcpy((void *)(d), (void *)(s), sizeof(*(s)))
+
+/* Predefined possible va_copy() implementation (id: CPS) */
+#define __VA_COPY_USE_CPS(d, s) memcpy((void *)&amp;(d), (void *)&amp;(s), sizeof((s)))
+
+/* Predefined possible va_copy() implementation (id: GCB) */
+#define __VA_COPY_USE_GCB(d, s) __builtin_va_copy((d), (s))
+
+/* Predefined possible va_copy() implementation (id: GCH) */
+#define __VA_COPY_USE_GCH(d, s) __va_copy((d), (s))
+
+/* Predefined possible va_copy() implementation (id: GCM) */
+#define __VA_COPY_USE_GCM(d, s) VA_COPY((d), (s))
+
+/* Define to 1 if you have the &lt;arpa/inet.h&gt; header file. */
+#undef HAVE_ARPA_INET_H
+
+/* Define to 1 if you have the `clock_gettime' function. */
+#undef HAVE_CLOCK_GETTIME
+
+/* Define to 1 if you have the &lt;dlfcn.h&gt; header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the &lt;dmalloc.h&gt; header file. */
+#undef HAVE_DMALLOC_H
+
+/* Define to 1 if you have the `getifaddrs' function. */
+#undef HAVE_GETIFADDRS
+
+/* Define to 1 if you have the `gettimeofday' function. */
+#undef HAVE_GETTIMEOFDAY
+
+/* Define to 1 if you have the &lt;ifaddrs.h&gt; header file. */
+#undef HAVE_IFADDRS_H
+
+/* Define to 1 if you have the &lt;inttypes.h&gt; header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `dmalloc' library (-ldmalloc). */
+#undef HAVE_LIBDMALLOC
+
+/* Define to 1 if you have the `nsl' library (-lnsl). */
+#undef HAVE_LIBNSL
+
+/* Define to 1 if you have the `socket' library (-lsocket). */
+#undef HAVE_LIBSOCKET
+
+/* Define to 1 if the system has the type `long double'. */
+#undef HAVE_LONG_DOUBLE
+
+/* Define to 1 if the system has the type `long long'. */
+#undef HAVE_LONG_LONG
+
+/* Define to 1 if you have the &lt;memory.h&gt; header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `nanosleep' function. */
+#undef HAVE_NANOSLEEP
+
+/* Define to 1 if you have the &lt;netdb.h&gt; header file. */
+#undef HAVE_NETDB_H
+
+/* Define to 1 if you have the &lt;netinet/in.h&gt; header file. */
+#undef HAVE_NETINET_IN_H
+
+/* Define to 1 if you have the &lt;net/if_arp.h&gt; header file. */
+#undef HAVE_NET_IF_ARP_H
+
+/* Define to 1 if you have the &lt;net/if_dl.h&gt; header file. */
+#undef HAVE_NET_IF_DL_H
+
+/* Define to 1 if you have the &lt;net/if.h&gt; header file. */
+#undef HAVE_NET_IF_H
+
+/* Define to 1 if you have the `Sleep' function. */
+#undef HAVE_SLEEP
+
+/* Define to 1 if you have the &lt;stdint.h&gt; header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the &lt;stdlib.h&gt; header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the &lt;strings.h&gt; header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the &lt;string.h&gt; header file. */
+#undef HAVE_STRING_H
+
+/* define if exists &quot;struct timeval&quot; */
+#undef HAVE_STRUCT_TIMEVAL
+
+/* Define to 1 if you have the &lt;sys/ioctl.h&gt; header file. */
+#undef HAVE_SYS_IOCTL_H
+
+/* Define to 1 if you have the &lt;sys/param.h&gt; header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the &lt;sys/select.h&gt; header file. */
+#undef HAVE_SYS_SELECT_H
+
+/* Define to 1 if you have the &lt;sys/socket.h&gt; header file. */
+#undef HAVE_SYS_SOCKET_H
+
+/* Define to 1 if you have the &lt;sys/sockio.h&gt; header file. */
+#undef HAVE_SYS_SOCKIO_H
+
+/* Define to 1 if you have the &lt;sys/stat.h&gt; header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the &lt;sys/time.h&gt; header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the &lt;sys/types.h&gt; header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the &lt;unistd.h&gt; header file. */
+#undef HAVE_UNISTD_H
+
+/* Define if va_copy() macro exists (and no fallback implementation is
+   required) */
+#undef HAVE_VA_COPY
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* The size of `char', as computed by sizeof. */
+#undef SIZEOF_CHAR
+
+/* The size of `int', as computed by sizeof. */
+#undef SIZEOF_INT
+
+/* The size of `long', as computed by sizeof. */
+#undef SIZEOF_LONG
+
+/* The size of `long long', as computed by sizeof. */
+#undef SIZEOF_LONG_LONG
+
+/* The size of `short', as computed by sizeof. */
+#undef SIZEOF_SHORT
+
+/* The size of `unsigned char', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_CHAR
+
+/* The size of `unsigned int', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_INT
+
+/* The size of `unsigned long', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_LONG
+
+/* The size of `unsigned long long', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_LONG_LONG
+
+/* The size of `unsigned short', as computed by sizeof. */
+#undef SIZEOF_UNSIGNED_SHORT
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* whether to build C++ bindings to C API */
+#undef WITH_CXX
+
+/* whether to build DCE 1.1 backward compatibility API */
+#undef WITH_DCE
+
+/* define if building with Dmalloc */
+#undef WITH_DMALLOC
+
+/* whether to build Perl bindings to C API */
+#undef WITH_PERL
+
+/* whether to build Perl compatibility API */
+#undef WITH_PERL_COMPAT
+
+/* whether to build PostgreSQL bindings to C API */
+#undef WITH_PGSQL
+
+/* whether to build PHP bindings to C API */
+#undef WITH_PHP
+
+/* Optional va_copy() implementation activation */
+#ifndef HAVE_VA_COPY
+#define va_copy(d, s) __VA_COPY_USE(d, s)
+#endif
+
+
+/* Define to id of used va_copy() implementation */
+#undef __VA_COPY_USE
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidconfigureac"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/configure.ac (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/configure.ac                                (rev 0)
+++ freeswitch/trunk/libs/uuid/configure.ac        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+dnl ##
+dnl ##  OSSP uuid - Universally Unique Identifier
+dnl ##  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+dnl ##  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+dnl ##
+dnl ##  This file is part of OSSP uuid, a library for the generation
+dnl ##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+dnl ##
+dnl ##  Permission to use, copy, modify, and distribute this software for
+dnl ##  any purpose with or without fee is hereby granted, provided that
+dnl ##  the above copyright notice and this permission notice appear in all
+dnl ##  copies.
+dnl ##
+dnl ##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+dnl ##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+dnl ##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+dnl ##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+dnl ##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+dnl ##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+dnl ##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+dnl ##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+dnl ##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+dnl ##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+dnl ##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+dnl ##  SUCH DAMAGE.
+dnl ##
+dnl ##  configure.ac: GNU Autoconf source script
+dnl ##
+
+AC_PREREQ(2.53)
+AC_INIT
+UUID_VERSION_RAW=`$ac_confdir/shtool version -l c -d short uuid_vers.h`
+UUID_VERSION_STR=`$ac_confdir/shtool version -l c -d long  uuid_vers.h`
+UUID_VERSION_HEX=`$ac_confdir/shtool version -l c -d hex   uuid_vers.h`
+$ac_confdir/shtool echo -e \
+    &quot;Configuring %BOSSP uuid%b (Universally Unique Identifier), version %B${UUID_VERSION_STR}%b&quot;
+AC_SUBST(UUID_VERSION_RAW)
+AC_SUBST(UUID_VERSION_STR)
+AC_SUBST(UUID_VERSION_HEX)
+
+AC_PROG_MAKE_SET
+AC_PROG_CC
+AC_CHECK_DEBUGGING
+AC_CHECK_DMALLOC
+
+with_tags=&quot;&quot;
+sinclude(libtool.m4)
+AC_PROG_LIBTOOL
+
+sinclude(uuid.ac)
+UUID_CHECK_ALL
+
+AC_CONFIG_HEADERS(config.h)
+AC_CONFIG_FILES([Makefile uuid-config uuid.pc uuid.h])
+AC_CONFIG_COMMANDS([adjustment], [chmod a-w uuid.h; chmod a+x uuid-config])
+AC_OUTPUT
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidperlMANIFEST"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/perl/MANIFEST (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/perl/MANIFEST                                (rev 0)
+++ freeswitch/trunk/libs/uuid/perl/MANIFEST        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+MANIFEST
+Makefile.PL
+uuid.xs
+uuid.tm
+uuid.pm
+uuid.pod
+uuid.ts
+uuid_compat.pm
+uuid_compat.pod
+uuid_compat.ts
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidperlMakefilePL"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/perl/Makefile.PL (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/perl/Makefile.PL                                (rev 0)
+++ freeswitch/trunk/libs/uuid/perl/Makefile.PL        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,68 @@
</span><ins>+##
+##  OSSP uuid - Universally Unique Identifier
+##  Copyright (c) 2004-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+##  Copyright (c) 2004-2007 The OSSP Project &lt;http://www.ossp.org/&gt;
+##
+##  This file is part of OSSP uuid, a library for the generation
+##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+##  Makefile.PL: Perl MakeMaker build source procedure
+##
+
+require 5.008;
+
+use Config;
+use ExtUtils::MakeMaker;
+
+#   determine source directory
+my ($srcdir) = map { my $d = $_; $d =~ s/\/libuuid\.la$//; $d }
+               grep { -f $_ } (&quot;../libuuid.la&quot;, glob(&quot;../*/libuuid.la&quot;))
+    or die &quot;no source directory found (where libuuid.la is located)&quot;;
+
+#   determine extra build options
+my $compat = 0;
+@ARGV = grep { $_ =~ m/^COMPAT=(\d+)$/i ? ($compat = $1, 0) : 1 } @ARGV;
+
+#   generate Makefile
+WriteMakefile(
+    NAME              =&gt; 'OSSP::uuid',
+    VERSION_FROM      =&gt; 'uuid.pm',
+    ABSTRACT_FROM     =&gt; 'uuid.pod',
+    PREREQ_PM         =&gt; {},
+    LIBS              =&gt; [ &quot;-L$srcdir/.libs -L$srcdir -luuid&quot; ],
+    DEFINE            =&gt; '',
+    INC               =&gt; &quot;-I. -I$srcdir&quot;,
+    PM                =&gt; { 'uuid.pm'   =&gt; '$(INST_LIBDIR)/uuid.pm',
+                           'uuid.pod'  =&gt; '$(INST_LIBDIR)/uuid.pod',
+                           ($compat ? ('uuid_compat.pm'  =&gt; '$(INST_LIBDIR)/../Data/UUID.pm')  : ()),
+                           ($compat ? ('uuid_compat.pod' =&gt; '$(INST_LIBDIR)/../Data/UUID.pod') : ()), },
+    MAN3PODS          =&gt; { 'uuid.pod' =&gt; '$(INST_MAN3DIR)/OSSP::uuid.3',
+                           ($compat ? ('uuid_compat.pod' =&gt; '$(INST_MAN3DIR)/Data::UUID.3') : ()), },
+    TYPEMAPS          =&gt; [ 'uuid.tm' ],
+    test              =&gt; { TESTS =&gt; 'uuid.ts' . ($compat ? ' uuid_compat.ts' : '') },
+    NO_META           =&gt; 1,
+    #    cruel hack to workaround the conflict between OSSP uuid's
+    #    uuid_create() function and one from FreeBSD's libc
+    ((   &quot;$Config{'osname'}$Config{'osvers'}&quot; =~ m/^freebsd[56]\./
+      and $Config{'ld'} =~ m/cc$/ and -f &quot;/usr/include/uuid.h&quot;) ?
+      ( LDDLFLAGS =&gt; $Config{'lddlflags'} . ' -Wl,-Bsymbolic') : ())
+);
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidperluuidpm"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/perl/uuid.pm (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/perl/uuid.pm                                (rev 0)
+++ freeswitch/trunk/libs/uuid/perl/uuid.pm        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,334 @@
</span><ins>+##
+##  OSSP uuid - Universally Unique Identifier
+##  Copyright (c) 2004-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+##  Copyright (c) 2004-2007 The OSSP Project &lt;http://www.ossp.org/&gt;
+##
+##  This file is part of OSSP uuid, a library for the generation
+##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+##  uuid.pm: Perl Binding (Perl part)
+##
+
+##
+##  High-Level Perl Module TIE-style API
+##  (just a functionality-reduced TIE wrapper around the OO-style API)
+##
+
+package OSSP::uuid::tie;
+
+use 5.008;
+use strict;
+use warnings;
+use Carp;
+
+#   inhert from Tie::Scalar
+require Tie::Scalar;
+our @ISA = qw(Tie::Scalar);
+
+#   helper function
+sub mode_sanity {
+    my ($mode) = @_;
+    if (not (    defined($mode)
+             and ref($mode) eq 'ARRAY'
+             and (   (@{$mode} == 1 and $mode-&gt;[0] =~ m|^v[14]$|)
+                  or (@{$mode} == 3 and $mode-&gt;[0] =~ m|^v[35]$|)))) {
+        return (undef, &quot;invalid UUID generation mode specification&quot;);
+    }
+    if ($mode-&gt;[0] =~ m|^v[35]$|) {
+        my $uuid_ns = new OSSP::uuid;
+        $uuid_ns-&gt;load($mode-&gt;[1])
+            or return (undef, &quot;failed to load UUID $mode-&gt;[0] namespace&quot;);
+        $mode-&gt;[1] = $uuid_ns;
+    }
+    return ($mode, undef);
+}
+
+#   constructor
+sub TIESCALAR {
+    my ($class, @args) = @_;
+    my $self = {};
+    bless ($self, $class);
+    $self-&gt;{-uuid} = new OSSP::uuid
+       or croak &quot;failed to create OSSP::uuid object&quot;;
+    my ($mode, $error) = mode_sanity(defined($args[0]) ? [ @args ] : [ &quot;v1&quot; ]);
+    croak $error if defined($error);
+    $self-&gt;{-mode} = $mode;
+    return $self;
+}
+
+#   destructor
+sub DESTROY {
+    my ($self) = @_;
+    delete $self-&gt;{-uuid};
+    delete $self-&gt;{-mode};
+    return;
+}
+
+#   fetch value from scalar
+#   (applied semantic: export UUID in string format)
+sub FETCH {
+    my ($self) = @_;
+    $self-&gt;{-uuid}-&gt;make(@{$self-&gt;{-mode}})
+       or croak &quot;failed to generate new UUID&quot;;
+    my $value = $self-&gt;{-uuid}-&gt;export(&quot;str&quot;)
+       or croak &quot;failed to export new UUID&quot;;
+    return $value;
+}
+
+#   store value into scalar
+#   (applied semantic: configure new UUID generation mode)
+sub STORE {
+    my ($self, $value) = @_;
+    my ($mode, $error) = mode_sanity($value);
+    croak $error if defined($error);
+    $self-&gt;{-mode} = $mode;
+    return;
+}
+
+##
+##  High-Level Perl Module OO-style API
+##  (just an OO wrapper around the C-style API)
+##
+
+package OSSP::uuid;
+
+use 5.008;
+use strict;
+use warnings;
+use Carp;
+use XSLoader;
+use Exporter;
+
+#   API version
+our $VERSION = do { my @v = ('1.6.2' =~ m/\d+/g); sprintf(&quot;%d.&quot;.(&quot;%02d&quot;x$#v), @v); };
+
+#   API inheritance
+our @ISA = qw(Exporter);
+
+#   API symbols
+my $symbols = {
+    'const' =&gt; [qw(
+        UUID_VERSION
+        UUID_LEN_BIN
+        UUID_LEN_STR
+        UUID_LEN_SIV
+        UUID_RC_OK
+        UUID_RC_ARG
+        UUID_RC_MEM
+        UUID_RC_SYS
+        UUID_RC_INT
+        UUID_RC_IMP
+        UUID_MAKE_V1
+        UUID_MAKE_V3
+        UUID_MAKE_V4
+        UUID_MAKE_V5
+        UUID_MAKE_MC
+        UUID_FMT_BIN
+        UUID_FMT_STR
+        UUID_FMT_SIV
+        UUID_FMT_TXT
+    )],
+    'func' =&gt; [qw(
+        uuid_create
+        uuid_destroy
+        uuid_load
+        uuid_make
+        uuid_isnil
+        uuid_compare
+        uuid_import
+        uuid_export
+        uuid_error
+        uuid_version
+    )]
+};
+
+#   API symbol exportation
+our %EXPORT_TAGS = (
+    'all'   =&gt; [ @{$symbols-&gt;{'const'}}, @{$symbols-&gt;{'func'}} ],
+    'const' =&gt; [ @{$symbols-&gt;{'const'}} ],
+    'func'  =&gt; [ @{$symbols-&gt;{'func'}}  ]
+);
+our @EXPORT_OK = @{$EXPORT_TAGS{'all'}};
+our @EXPORT    = ();
+
+#   constructor
+sub new {
+    my $proto = shift;
+    my $class = ref($proto) || $proto;
+    my $self = {};
+    bless ($self, $class);
+    $self-&gt;{-uuid} = undef;
+    $self-&gt;{-rc}   = $self-&gt;UUID_RC_OK;
+    my $rc = uuid_create($self-&gt;{-uuid});
+    if ($rc != $self-&gt;UUID_RC_OK) {
+        croak(sprintf(&quot;OSSP::uuid::new: uuid_create: %s (%d)&quot;, uuid_error($rc), $rc));
+        return undef;
+    }
+    return $self;
+}
+
+#   destructor
+sub DESTROY ($) {
+    my ($self) = @_;
+    $self-&gt;{-rc} = uuid_destroy($self-&gt;{-uuid}) if (defined($self-&gt;{-uuid}));
+    if ($self-&gt;{-rc} != $self-&gt;UUID_RC_OK) {
+        carp(sprintf(&quot;OSSP::uuid::DESTROY: uuid_destroy: %s (%d)&quot;, uuid_error($self-&gt;{-rc}), $self-&gt;{-rc}));
+        return;
+    }
+    $self-&gt;{-uuid} = undef;
+    $self-&gt;{-rc}   = undef;
+    return;
+}
+
+sub load ($$) {
+    my ($self, $name) = @_;
+    $self-&gt;{-rc} = uuid_load($self-&gt;{-uuid}, $name);
+    return ($self-&gt;{-rc} == $self-&gt;UUID_RC_OK);
+}
+
+sub make ($$;@) {
+    my ($self, $mode, @valist) = @_;
+    my $mode_code = 0;
+    foreach my $spec (split(/,/, $mode)) {
+        if    ($spec eq 'v1') { $mode_code |= $self-&gt;UUID_MAKE_V1; }
+        elsif ($spec eq 'v3') { $mode_code |= $self-&gt;UUID_MAKE_V3; }
+        elsif ($spec eq 'v4') { $mode_code |= $self-&gt;UUID_MAKE_V4; }
+        elsif ($spec eq 'v5') { $mode_code |= $self-&gt;UUID_MAKE_V5; }
+        elsif ($spec eq 'mc') { $mode_code |= $self-&gt;UUID_MAKE_MC; }
+        else  { croak(&quot;invalid mode specification \&quot;$spec\&quot;&quot;); }
+    }
+    if (($mode_code &amp; $self-&gt;UUID_MAKE_V3) or ($mode_code &amp; $self-&gt;UUID_MAKE_V5)) {
+        if (not (ref($valist[0]) and $valist[0]-&gt;isa(&quot;OSSP::uuid&quot;))) {
+            croak(&quot;UUID_MAKE_V3/UUID_MAKE_V5 requires namespace argument to be OSSP::uuid object&quot;);
+        }
+        my $ns   = $valist[0]-&gt;{-uuid};
+        my $name = $valist[1];
+        $self-&gt;{-rc} = uuid_make($self-&gt;{-uuid}, $mode_code, $ns, $name);
+    }
+    else {
+        $self-&gt;{-rc} = uuid_make($self-&gt;{-uuid}, $mode_code);
+    }
+    return ($self-&gt;{-rc} == $self-&gt;UUID_RC_OK);
+}
+
+sub isnil ($) {
+    my ($self) = @_;
+    my $result;
+    $self-&gt;{-rc} = uuid_isnil($self-&gt;{-uuid}, $result);
+    return ($self-&gt;{-rc} == $self-&gt;UUID_RC_OK ? $result : undef);
+}
+
+sub compare ($$) {
+    my ($self, $other) = @_;
+    my $result = 0;
+    if (not (ref($other) and $other-&gt;isa(&quot;OSSP::uuid&quot;))) {
+        croak(&quot;argument has to an OSSP::uuid object&quot;);
+    }
+    $self-&gt;{-rc} = uuid_compare($self-&gt;{-uuid}, $other-&gt;{-uuid}, $result);
+    return ($self-&gt;{-rc} == $self-&gt;UUID_RC_OK ? $result : undef);
+}
+
+sub import {
+    #   ATTENTION: The OSSP uuid API function &quot;import&quot; conflicts with
+    #   the standardized &quot;import&quot; method the Perl world expects from
+    #   their modules. In order to keep the Perl binding consist
+    #   with the C API, we solve the conflict under run-time by
+    #   distinguishing between the two types of &quot;import&quot; calls.
+    if (defined($_[0]) and ref($_[0]) =~ m/^OSSP::uuid/) {
+        #   the regular OSSP::uuid &quot;import&quot; method
+        croak(&quot;import method expects 3 or 4 arguments&quot;) if (@_ &lt; 3 or @_ &gt; 4); # emulate prototype
+        my ($self, $fmt, $data_ptr, $data_len) = @_;
+        if    ($fmt eq 'bin') { $fmt = $self-&gt;UUID_FMT_BIN; }
+        elsif ($fmt eq 'str') { $fmt = $self-&gt;UUID_FMT_STR; }
+        elsif ($fmt eq 'siv') { $fmt = $self-&gt;UUID_FMT_SIV; }
+        elsif ($fmt eq 'txt') { $fmt = $self-&gt;UUID_FMT_TXT; }
+        else  { croak(&quot;invalid format \&quot;$fmt\&quot;&quot;); }
+        $data_len ||= length($data_ptr); # functional redudant, but Perl dislikes undef value here
+        $self-&gt;{-rc} = uuid_import($self-&gt;{-uuid}, $fmt, $data_ptr, $data_len);
+        return ($self-&gt;{-rc} == $self-&gt;UUID_RC_OK);
+    }
+    else {
+        #   the special Perl &quot;import&quot; method
+        #   (usually inherited from the Exporter)
+        no strict &quot;refs&quot;;
+        return OSSP::uuid-&gt;export_to_level(1, @_);
+    }
+}
+
+sub export {
+    #   ATTENTION: The OSSP uuid API function &quot;export&quot; conflicts with
+    #   the standardized &quot;export&quot; method the Perl world expects from
+    #   their modules. In order to keep the Perl binding consist
+    #   with the C API, we solve the conflict under run-time by
+    #   distinguishing between the two types of &quot;export&quot; calls.
+    if (defined($_[0]) and ref($_[0]) =~ m/^OSSP::uuid/) {
+        #   the regular OSSP::uuid &quot;export&quot; method
+        croak(&quot;export method expects 2 arguments&quot;) if (@_ != 2); # emulate prototype
+        my ($self, $fmt) = @_;
+        my $data_ptr;
+        if    ($fmt eq 'bin') { $fmt = $self-&gt;UUID_FMT_BIN; }
+        elsif ($fmt eq 'str') { $fmt = $self-&gt;UUID_FMT_STR; }
+        elsif ($fmt eq 'siv') { $fmt = $self-&gt;UUID_FMT_SIV; }
+        elsif ($fmt eq 'txt') { $fmt = $self-&gt;UUID_FMT_TXT; }
+        else  { croak(&quot;invalid format \&quot;$fmt\&quot;&quot;); }
+        $self-&gt;{-rc} = uuid_export($self-&gt;{-uuid}, $fmt, $data_ptr, undef);
+        return ($self-&gt;{-rc} == $self-&gt;UUID_RC_OK ? $data_ptr : undef);
+    }
+    else {
+        #   the special Perl &quot;export&quot; method
+        #   (usually inherited from the Exporter)
+        return Exporter::export(@_);
+    }
+}
+
+sub error ($;$) {
+    my ($self, $rc) = @_;
+    $rc = $self-&gt;{-rc} if (not defined($rc));
+    return wantarray ? (uuid_error($rc), $rc) : uuid_error($rc);
+}
+
+sub version (;$) {
+    my ($self) = @_;
+    return uuid_version();
+}
+
+##
+##  Low-Level Perl XS C-style API
+##  (actually just the activation of the XS part)
+##
+
+#   auto-loading constants
+sub AUTOLOAD {
+    my $constname;
+    our $AUTOLOAD;
+    ($constname = $AUTOLOAD) =~ s/.*:://;
+    croak &quot;&amp;OSSP::uuid::constant not defined&quot; if ($constname eq 'constant');
+    my ($error, $val) = constant($constname);
+    croak $error if ($error);
+    { no strict 'refs'; *$AUTOLOAD = sub { $val }; }
+    goto &amp;$AUTOLOAD;
+}
+
+#   static-loading functions
+XSLoader::load('OSSP::uuid', $VERSION);
+
+1;
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidperluuidpod"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/perl/uuid.pod (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/perl/uuid.pod                                (rev 0)
+++ freeswitch/trunk/libs/uuid/perl/uuid.pod        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,207 @@
</span><ins>+##
+##  OSSP uuid - Universally Unique Identifier
+##  Copyright (c) 2004-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+##  Copyright (c) 2004-2007 The OSSP Project &lt;http://www.ossp.org/&gt;
+##
+##  This file is part of OSSP uuid, a library for the generation
+##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+##  uuid.pod: Perl Binding (Perl/POD part)
+##
+
+=pod
+
+=head1 NAME
+
+OSSP::uuid - B&lt;OSSP uuid&gt; Perl Binding
+
+=head1 DESCRIPTION
+
+B&lt;OSSP uuid&gt; is a ISO-C:1999 application programming interface (API)
+and corresponding command line interface (CLI) for the generation of
+DCE 1.1, ISO/IEC 11578:1996 and RFC 4122 compliant I&lt;Universally Unique
+Identifier&gt; (UUID). It supports DCE 1.1 variant UUIDs of version 1 (time
+and node based), version 3 (name based, MD5), version 4 (random number
+based) and version 5 (name based, SHA-1). Additional API bindings are
+provided for the languages ISO-C++:1998, Perl:5 and PHP:4/5. Optional
+backward compatibility exists for the ISO-C DCE-1.1 and Perl Data::UUID
+APIs.
+
+B&lt;OSSP::uuid&gt; is the Perl binding to the B&lt;OSSP uuid&gt; API.
+Three variants are provided:
+
+=head2 TIE-STYLE API
+
+The TIE-style API is a functionality-reduced wrapper around the OO-style
+API and intended for very high-level convenience programming:
+
+=over 4
+
+=item C&lt;use OSSP::uuid;&gt;
+
+=item B&lt;tie&gt;C&lt; my $uuid, 'OSSP::uuid::tie', $mode, ...;&gt;
+
+=item C&lt;$uuid = [ $mode, ... ];&gt;
+
+=item C&lt;print &quot;UUID=$uuid\n&quot;;&gt;
+
+=item C&lt;untie $uuid;&gt;
+
+=back
+
+=head2 OO-STYLE API
+
+The OO-style API is a wrapper around the C-style API and intended for
+high-level regular programming.
+
+=over 4
+
+=item C&lt;use OSSP::uuid;&gt;
+
+=item C&lt;my $uuid = &gt;B&lt;new&gt;C&lt; OSSP::uuid;&gt;
+
+=item C&lt;$uuid-E&lt;gt&gt;&gt;B&lt;load&gt;C&lt;($name);&gt;
+
+=item C&lt;$uuid-E&lt;gt&gt;&gt;B&lt;make&gt;C&lt;($mode, ...);&gt;
+
+=item C&lt;$result = $uuid-E&lt;gt&gt;&gt;B&lt;isnil&gt;C&lt;();&gt;
+
+=item C&lt;$result = $uuid-E&lt;gt&gt;&gt;B&lt;compare&gt;C&lt;($uuid2);&gt;
+
+=item C&lt;$uuid-E&lt;gt&gt;&gt;B&lt;import&gt;C&lt;($fmt, $data_ptr);&gt;
+
+=item C&lt;$data_ptr = $uuid-E&lt;gt&gt;&gt;B&lt;export&gt;C&lt;($fmt);&gt;
+
+=item C&lt;[(]$str[, $rc)] = $uuid-E&lt;gt&gt;&gt;B&lt;error&gt;C&lt;();&gt;
+
+=item C&lt;$ver = $uuid-E&lt;gt&gt;&gt;B&lt;version&gt;C&lt;();&gt;
+
+=item C&lt;undef $uuid;&gt;
+
+=back
+
+Additionally, the strings C&lt;&quot;v1&quot;&gt;, C&lt;&quot;v3&quot;&gt;, C&lt;&quot;v4&quot;&gt;, C&lt;&quot;v5&quot;&gt; and C&lt;&quot;mc&quot;&gt;
+can be used in C&lt;$mode&gt; and the strings C&lt;&quot;bin&quot;&gt;, C&lt;&quot;str&quot;&gt;, and C&lt;&quot;txt&quot;&gt;
+can be used for C&lt;$fmt&gt;.
+
+=head2 C-STYLE API
+
+The C-style API is a direct mapping
+of the B&lt;OSSP uuid&gt; ISO-C API to Perl and is intended for low-level
+programming. See uuid(3) for a description of the functions and
+their expected arguments.
+
+=over 4
+
+=item C&lt;use OSSP::uuid qw(:all);&gt;
+
+=item C&lt;my $uuid; $rc = &gt;B&lt;uuid_create&gt;C&lt;($uuid);&gt;
+
+=item C&lt;$rc = &gt;B&lt;uuid_load&gt;C&lt;($uuid, $name);&gt;
+
+=item C&lt;$rc = &gt;B&lt;uuid_make&gt;C&lt;($uuid, $mode, ...);&gt;
+
+=item C&lt;$rc = &gt;B&lt;uuid_isnil&gt;C&lt;($uuid, $result);&gt;
+
+=item C&lt;$rc = &gt;B&lt;uuid_compare&gt;C&lt;($uuid, $uuid2, $result);&gt;
+
+=item C&lt;$rc = &gt;B&lt;uuid_import&gt;C&lt;($uuid, $fmt, $data_ptr, $data_len);&gt;
+
+=item C&lt;$rc = &gt;B&lt;uuid_export&gt;C&lt;($uuid, $fmt, $data_ptr, $data_len);&gt;
+
+=item C&lt;$str = &gt;B&lt;uuid_error&gt;C&lt;($rc);&gt;
+
+=item C&lt;$ver = &gt;B&lt;uuid_version&gt;C&lt;();&gt;
+
+=item C&lt;$rc = &gt;B&lt;uuid_destroy&gt;C&lt;($uuid);&gt;
+
+=back
+
+Additionally, the following constants are exported for use in C&lt;$rc&gt;, C&lt;$mode&gt;, C&lt;$fmt&gt; and C&lt;$ver&gt;:
+
+C&lt;UUID_VERSION&gt;,
+C&lt;UUID_LEN_BIN&gt;,
+C&lt;UUID_LEN_STR&gt;,
+C&lt;UUID_RC_OK&gt;,
+C&lt;UUID_RC_ARG&gt;,
+C&lt;UUID_RC_MEM&gt;,
+C&lt;UUID_RC_SYS&gt;,
+C&lt;UUID_RC_INT&gt;,
+C&lt;UUID_RC_IMP&gt;,
+C&lt;UUID_MAKE_V1&gt;,
+C&lt;UUID_MAKE_V3&gt;,
+C&lt;UUID_MAKE_V4&gt;,
+C&lt;UUID_MAKE_V5&gt;,
+C&lt;UUID_MAKE_MC&gt;,
+C&lt;UUID_FMT_BIN&gt;,
+C&lt;UUID_FMT_STR&gt;,
+C&lt;UUID_FMT_SIV&gt;,
+C&lt;UUID_FMT_TXT&gt;.
+
+=head1 EXAMPLES
+
+The following two examples create the version 3 UUID
+C&lt;02d9e6d5-9467-382e-8f9b-9300a64ac3cd&gt;, both via the OO-style and the
+C-style API. Error handling is omitted here for easier reading, but has
+to be added for production-quality code.
+
+  #   TIE-style API (very high-level)
+  use OSSP::uuid;
+  tie my $uuid, 'OSSP::uuid::tie';
+  $uuid = [ &quot;v1&quot; ];
+  print &quot;UUIDs: $uuid, $uuid, $uuid\n&quot;;
+  $uuid = [ &quot;v3&quot;, &quot;ns:URL&quot;, &quot;http://www.ossp.org/&quot; ];
+  print &quot;UUIDs: $uuid, $uuid, $uuid\n&quot;;
+  untie $uuid;
+
+  #   OO-style API (high-level)
+  use OSSP::uuid;
+  my $uuid    = new OSSP::uuid;
+  my $uuid_ns = new OSSP::uuid;
+  $uuid_ns-&gt;load(&quot;ns:URL&quot;);
+  $uuid-&gt;make(&quot;v3&quot;, $uuid_ns, &quot;http://www.ossp.org/&quot;);
+  undef $uuid_ns;
+  my $str = $uuid-&gt;export(&quot;str&quot;);
+  undef $uuid;
+  print &quot;$str\n&quot;;
+
+  #   C-style API (low-level)
+  use OSSP::uuid qw(:all);
+  my $uuid;    uuid_create($uuid);
+  my $uuid_ns; uuid_create($uuid_ns);
+  uuid_load($uuid_ns, &quot;ns:URL&quot;);
+  uuid_make($uuid, UUID_MAKE_V3, $uuid_ns, &quot;http://www.ossp.org/&quot;);
+  uuid_destroy($uuid_ns);
+  my $str; uuid_export($uuid, UUID_FMT_STR, $str, undef);
+  uuid_destroy($uuid);
+  print &quot;$str\n&quot;;
+
+=head1 SEE ALSO
+
+uuid(1), uuid-config(1), uuid(3).
+
+=head1 HISTORY
+
+The Perl binding B&lt;OSSP::uuid&gt; to B&lt;OSSP uuid&gt; was implemented in
+November 2004 by Ralf S. Engelschall E&lt;lt&gt;rse@engelschall.comE&lt;gt&gt;.
+
+=cut
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidperluuidtm"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/perl/uuid.tm (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/perl/uuid.tm                                (rev 0)
+++ freeswitch/trunk/libs/uuid/perl/uuid.tm        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+##
+##  OSSP uuid - Universally Unique Identifier
+##  Copyright (c) 2004-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+##  Copyright (c) 2004-2007 The OSSP Project &lt;http://www.ossp.org/&gt;
+##
+##  This file is part of OSSP uuid, a library for the generation
+##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+##  uuid.tm: Perl XS typemap for xsubpp(1)
+##
+
+TYPEMAP
+uuid_t *        T_PTRREF
+uuid_t **       T_PTRREF
+uuid_rc_t       T_IV
+uuid_fmt_t      T_IV
+int *           T_PV
+size_t *        T_PV
+const void *    T_PV
+void **         T_PV
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidperluuidts"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/perl/uuid.ts (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/perl/uuid.ts                                (rev 0)
+++ freeswitch/trunk/libs/uuid/perl/uuid.ts        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,171 @@
</span><ins>+##
+##  OSSP uuid - Universally Unique Identifier
+##  Copyright (c) 2004-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+##  Copyright (c) 2004-2007 The OSSP Project &lt;http://www.ossp.org/&gt;
+##
+##  This file is part of OSSP uuid, a library for the generation
+##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+##  uuid.ts: Perl Binding (Perl test suite part)
+##
+
+use Test::More tests =&gt; 36;
+
+##
+##  Module Loading
+##
+
+BEGIN {
+    use_ok('OSSP::uuid');
+};
+BEGIN {
+    use OSSP::uuid qw(:all);
+    ok(defined(UUID_VERSION), &quot;UUID_VERSION&quot;);
+    ok(UUID_RC_OK == 0, &quot;UUID_RC_OK&quot;);
+};
+
+##
+##  C-Style API
+##
+
+my ($rc, $result, $uuid, $uuid_ns, $str, $ptr, $len);
+
+$rc = uuid_create($uuid);
+ok($rc == UUID_RC_OK, &quot;uuid_create (1)&quot;);
+$rc = uuid_create($uuid_ns);
+ok($rc == UUID_RC_OK, &quot;uuid_create (2)&quot;);
+
+$rc = uuid_isnil($uuid, $result);
+ok(($rc == UUID_RC_OK and $result == 1), &quot;uuid_isnil (1)&quot;);
+$rc = uuid_isnil($uuid_ns, $result);
+ok(($rc == UUID_RC_OK and $result == 1), &quot;uuid_isnil (2)&quot;);
+$rc = uuid_compare($uuid, $uuid_ns, $result);
+ok(($rc == UUID_RC_OK and $result == 0), &quot;uuid_compare (1)&quot;);
+$rc = uuid_export($uuid, UUID_FMT_STR, $ptr, $len);
+ok((    $rc == UUID_RC_OK
+    and $ptr eq &quot;00000000-0000-0000-0000-000000000000&quot;
+    and $len == UUID_LEN_STR), &quot;uuid_export (1)&quot;);
+
+$rc = uuid_load($uuid_ns, &quot;ns:URL&quot;);
+ok($rc == UUID_RC_OK, &quot;uuid_load (1)&quot;);
+$rc = uuid_export($uuid_ns, UUID_FMT_STR, $ptr, $len);
+ok((    $rc == UUID_RC_OK
+    and $ptr eq &quot;6ba7b811-9dad-11d1-80b4-00c04fd430c8&quot;
+    and $len == UUID_LEN_STR), &quot;uuid_export (2)&quot;);
+
+$rc = uuid_make($uuid, UUID_MAKE_V3, $uuid_ns, &quot;http://www.ossp.org/&quot;);
+ok($rc == UUID_RC_OK, &quot;uuid_make (1)&quot;);
+$rc = uuid_export($uuid, UUID_FMT_STR, $ptr, $len);
+ok((    $rc == UUID_RC_OK
+    and $ptr eq &quot;02d9e6d5-9467-382e-8f9b-9300a64ac3cd&quot;
+    and $len == UUID_LEN_STR), &quot;uuid_export (3)&quot;);
+
+$rc = uuid_export($uuid, UUID_FMT_BIN, $ptr, $len);
+ok((    $rc == UUID_RC_OK
+    and $len == UUID_LEN_BIN), &quot;uuid_export (4)&quot;);
+$rc = uuid_import($uuid_ns, UUID_FMT_BIN, $ptr, $len);
+ok($rc == UUID_RC_OK, &quot;uuid_import (1)&quot;);
+$rc = uuid_export($uuid_ns, UUID_FMT_STR, $ptr, $len);
+ok((    $rc == UUID_RC_OK
+    and $ptr eq &quot;02d9e6d5-9467-382e-8f9b-9300a64ac3cd&quot;
+    and $len == UUID_LEN_STR), &quot;uuid_export (5)&quot;);
+$rc = uuid_export($uuid_ns, UUID_FMT_SIV, $ptr, $len);
+ok((    $rc == UUID_RC_OK
+    and $ptr eq &quot;3789866285607910888100818383505376205&quot;
+    and $len &lt;= UUID_LEN_SIV), &quot;uuid_export (6)&quot;);
+
+$rc = uuid_destroy($uuid_ns);
+ok($rc == UUID_RC_OK, &quot;uuid_destroy (1)&quot;);
+$rc = uuid_destroy($uuid);
+ok($rc == UUID_RC_OK, &quot;uuid_destroy (2)&quot;);
+
+##
+##  OO-style API
+##
+
+$uuid = new OSSP::uuid;
+ok(defined($uuid), &quot;new OSSP::uuid (1)&quot;);
+$uuid_ns = new OSSP::uuid;
+ok(defined($uuid_ns), &quot;new OSSP::uuid (2)&quot;);
+
+$rc = $uuid-&gt;isnil();
+ok((defined($rc) and $rc == 1), &quot;isnil (1)&quot;);
+$rc = $uuid_ns-&gt;isnil();
+ok((defined($rc) and $rc == 1), &quot;isnil (2)&quot;);
+
+$rc = $uuid-&gt;compare($uuid_ns);
+ok((defined($rc) and $rc == 0), &quot;compare (1)&quot;);
+
+$ptr = $uuid-&gt;export(&quot;str&quot;);
+ok((    defined($ptr)
+    and $ptr eq &quot;00000000-0000-0000-0000-000000000000&quot;
+    and length($ptr) == UUID_LEN_STR), &quot;export (1)&quot;);
+
+$rc = $uuid_ns-&gt;load(&quot;ns:URL&quot;);
+ok(defined($rc), &quot;uuid_load (1)&quot;);
+$ptr = $uuid_ns-&gt;export(&quot;str&quot;);
+ok((    defined($ptr)
+    and $ptr eq &quot;6ba7b811-9dad-11d1-80b4-00c04fd430c8&quot;
+    and length($ptr) == UUID_LEN_STR), &quot;export (2)&quot;);
+
+$rc = $uuid-&gt;make(&quot;v3&quot;, $uuid_ns, &quot;http://www.ossp.org/&quot;);
+ok(defined($rc), &quot;make (1)&quot;);
+$ptr = $uuid-&gt;export(&quot;str&quot;);
+ok((    defined($ptr)
+    and $ptr eq &quot;02d9e6d5-9467-382e-8f9b-9300a64ac3cd&quot;
+    and length($ptr) == UUID_LEN_STR), &quot;export (3)&quot;);
+
+$ptr = $uuid-&gt;export(&quot;bin&quot;);
+ok((    defined($ptr)
+    and length($ptr) == UUID_LEN_BIN), &quot;export (4)&quot;);
+$rc = $uuid_ns-&gt;import(&quot;bin&quot;, $ptr);
+ok(defined($rc), &quot;import (1)&quot;);
+$ptr = $uuid_ns-&gt;export(&quot;str&quot;);
+ok((    defined($ptr)
+    and $ptr eq &quot;02d9e6d5-9467-382e-8f9b-9300a64ac3cd&quot;
+    and length($ptr) == UUID_LEN_STR), &quot;export (5)&quot;);
+
+undef $uuid;
+undef $uuid_ns;
+
+##
+##  TIE API
+##
+
+$uuid = new OSSP::uuid;
+
+tie my $var, 'OSSP::uuid::tie';
+
+my $val_get1 = $var;
+my $val_get2 = $var;
+ok($val_get1 ne $val_get2, &quot;subsequent generation&quot;);
+
+$uuid-&gt;import(&quot;str&quot;, $val_get1);
+my $val_cmp1 = $uuid-&gt;export(&quot;str&quot;);
+$uuid-&gt;import(&quot;str&quot;, $val_get2);
+my $val_cmp2 = $uuid-&gt;export(&quot;str&quot;);
+ok($val_get1 eq $val_cmp1, &quot;validity comparison 1&quot;);
+ok($val_get2 eq $val_cmp2, &quot;validity comparison 2&quot;);
+
+$var = [ &quot;v3&quot;, &quot;ns:URL&quot;, &quot;http://www.ossp.org/&quot; ];
+$val_get1 = $var;
+ok($val_get1 eq &quot;02d9e6d5-9467-382e-8f9b-9300a64ac3cd&quot;, &quot;generation of UUID v3&quot;);
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidperluuidxs"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/perl/uuid.xs (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/perl/uuid.xs                                (rev 0)
+++ freeswitch/trunk/libs/uuid/perl/uuid.xs        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,236 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2007 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid.xs: Perl Binding (Perl/XS part)
+*/
+
+#include &quot;uuid.h&quot;
+
+#include &quot;EXTERN.h&quot;
+#include &quot;perl.h&quot;
+#include &quot;XSUB.h&quot;
+
+MODULE = OSSP::uuid PACKAGE = OSSP::uuid
+
+void
+constant(sv)
+    PREINIT:
+        dXSTARG;
+        STRLEN          len;
+        int             i;
+        static struct {
+            const char *name;
+            int         value;
+        } constant_table[] = {
+            { &quot;UUID_VERSION&quot;, UUID_VERSION },
+            { &quot;UUID_LEN_BIN&quot;, UUID_LEN_BIN },
+            { &quot;UUID_LEN_STR&quot;, UUID_LEN_STR },
+            { &quot;UUID_LEN_SIV&quot;, UUID_LEN_SIV },
+            { &quot;UUID_RC_OK&quot;,   UUID_RC_OK   },
+            { &quot;UUID_RC_ARG&quot;,  UUID_RC_ARG  },
+            { &quot;UUID_RC_MEM&quot;,  UUID_RC_MEM  },
+            { &quot;UUID_RC_SYS&quot;,  UUID_RC_SYS  },
+            { &quot;UUID_RC_INT&quot;,  UUID_RC_INT  },
+            { &quot;UUID_RC_IMP&quot;,  UUID_RC_IMP  },
+            { &quot;UUID_MAKE_V1&quot;, UUID_MAKE_V1 },
+            { &quot;UUID_MAKE_V3&quot;, UUID_MAKE_V3 },
+            { &quot;UUID_MAKE_V4&quot;, UUID_MAKE_V4 },
+            { &quot;UUID_MAKE_V5&quot;, UUID_MAKE_V5 },
+            { &quot;UUID_MAKE_MC&quot;, UUID_MAKE_MC },
+            { &quot;UUID_FMT_BIN&quot;, UUID_FMT_BIN },
+            { &quot;UUID_FMT_STR&quot;, UUID_FMT_STR },
+            { &quot;UUID_FMT_SIV&quot;, UUID_FMT_SIV },
+            { &quot;UUID_FMT_TXT&quot;, UUID_FMT_TXT }
+        };
+    INPUT:
+        SV             *sv;
+        const char     *s = SvPV(sv, len);
+    PPCODE:
+        for (i = 0; i &lt; sizeof(constant_table)/sizeof(constant_table[0]); i++) {
+            if (strcmp(s, constant_table[i].name) == 0) {
+                EXTEND(SP, 1);
+                PUSHs(&amp;PL_sv_undef);
+                PUSHi(constant_table[i].value);
+                break;
+            }
+        }
+        if (i == sizeof(constant_table)/sizeof(constant_table[0])) {
+            sv = sv_2mortal(newSVpvf(&quot;unknown contant OSSP::uuid::%s&quot;, s));
+            PUSHs(sv);
+        }
+
+
+uuid_rc_t
+uuid_create(uuid)
+    PROTOTYPE:
+        $
+    INPUT:
+        uuid_t *&amp;uuid = NO_INIT
+    CODE:
+        RETVAL = uuid_create(&amp;uuid);
+    OUTPUT:
+        uuid
+        RETVAL
+
+uuid_rc_t
+uuid_destroy(uuid)
+    PROTOTYPE:
+        $
+    INPUT:
+        uuid_t *uuid
+    CODE:
+        RETVAL = uuid_destroy(uuid);
+    OUTPUT:
+        RETVAL
+
+uuid_rc_t
+uuid_load(uuid,name)
+    PROTOTYPE:
+        $$
+    INPUT:
+        uuid_t *uuid
+        const char *name
+    CODE:
+        RETVAL = uuid_load(uuid, name);
+    OUTPUT:
+        RETVAL
+
+uuid_rc_t
+uuid_make(uuid,mode,...)
+    PROTOTYPE:
+        $$;$$
+    INPUT:
+        uuid_t *uuid
+        unsigned int mode
+    PREINIT:
+        uuid_t *ns;
+        const char *name;
+    CODE:
+        if ((mode &amp; UUID_MAKE_V3) || (mode &amp; UUID_MAKE_V5)) {
+            if (items != 4)
+                croak(&quot;mode UUID_MAKE_V3/UUID_MAKE_V5 requires two additional arguments to uuid_make()&quot;);
+                if (!SvROK(ST(2)))
+                croak(&quot;mode UUID_MAKE_V3/UUID_MAKE_V5 requires a UUID object as namespace&quot;);
+            ns   = INT2PTR(uuid_t *, SvIV((SV*)SvRV(ST(2))));
+            name = (const char *)SvPV_nolen(ST(3));
+            RETVAL = uuid_make(uuid, mode, ns, name);
+        }
+        else {
+            if (items != 2)
+                croak(&quot;invalid number of arguments to uuid_make()&quot;);
+            RETVAL = uuid_make(uuid, mode);
+        }
+    OUTPUT:
+        RETVAL
+
+uuid_rc_t
+uuid_isnil(uuid,result)
+    PROTOTYPE:
+        $$
+    INPUT:
+        uuid_t *uuid
+        int &amp;result = NO_INIT
+    CODE:
+        RETVAL = uuid_isnil(uuid, &amp;result);
+    OUTPUT:
+        result
+        RETVAL
+
+uuid_rc_t
+uuid_compare(uuid,uuid2,result)
+    PROTOTYPE:
+        $$$
+    INPUT:
+        uuid_t *uuid
+        uuid_t *uuid2
+        int &amp;result = NO_INIT
+    CODE:
+        RETVAL = uuid_compare(uuid, uuid2, &amp;result);
+    OUTPUT:
+        result
+        RETVAL
+
+uuid_rc_t
+uuid_import(uuid,fmt,data_ptr,data_len)
+    PROTOTYPE:
+        $$$$
+    INPUT:
+        uuid_t *uuid
+        uuid_fmt_t fmt
+        const void *data_ptr
+        size_t data_len
+    CODE:
+        if (ST(3) == &amp;PL_sv_undef)
+            data_len = sv_len(ST(2));
+        RETVAL = uuid_import(uuid, fmt, data_ptr, data_len);
+    OUTPUT:
+        RETVAL
+
+uuid_rc_t
+uuid_export(uuid,fmt,data_ptr,data_len)
+    PROTOTYPE:
+        $$$$
+    INPUT:
+        uuid_t *uuid
+        uuid_fmt_t fmt
+        void *&amp;data_ptr = NO_INIT
+        size_t &amp;data_len = NO_INIT
+    PPCODE:
+        data_ptr = NULL;
+        data_len = 0;
+        RETVAL = uuid_export(uuid, fmt, &amp;data_ptr, &amp;data_len);
+        if (RETVAL == UUID_RC_OK) {
+            if (fmt == UUID_FMT_SIV)
+                data_len = strlen((char *)data_ptr);
+            else if (fmt == UUID_FMT_STR || fmt == UUID_FMT_TXT)
+                data_len--; /* Perl doesn't wish NUL-termination on strings */
+            sv_setpvn(ST(2), data_ptr, data_len);
+            free(data_ptr);
+            if (ST(3) != &amp;PL_sv_undef)
+                sv_setuv(ST(3), (UV)data_len);
+        }
+        PUSHi((IV)RETVAL);
+
+char *
+uuid_error(rc)
+    PROTOTYPE:
+        $
+    INPUT:
+        uuid_rc_t rc
+    CODE:
+        RETVAL = uuid_error(rc);
+    OUTPUT:
+        RETVAL
+
+unsigned long
+uuid_version()
+    PROTOTYPE:
+    INPUT:
+    CODE:
+        RETVAL = uuid_version();
+    OUTPUT:
+        RETVAL
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidperluuid_compatpm"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/perl/uuid_compat.pm (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/perl/uuid_compat.pm                                (rev 0)
+++ freeswitch/trunk/libs/uuid/perl/uuid_compat.pm        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,176 @@
</span><ins>+##
+##  OSSP uuid - Universally Unique Identifier
+##  Copyright (c) 2004-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+##  Copyright (c) 2004-2007 The OSSP Project &lt;http://www.ossp.org/&gt;
+##  Copyright (c) 2004 Piotr Roszatycki &lt;dexter@debian.org&gt;
+##
+##  This file is part of OSSP uuid, a library for the generation
+##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+##  uuid_compat.pm: Data::UUID Backward Compatibility Perl API
+##
+
+package Data::UUID;
+
+use 5.006;
+use warnings;
+use strict;
+
+use OSSP::uuid;
+use MIME::Base64 qw();
+
+require Exporter;
+
+our @ISA     = qw(Exporter);
+our @EXPORT  = qw(NameSpace_DNS NameSpace_OID NameSpace_URL NameSpace_X500);
+
+our $VERSION = do { my @v = ('1.6.2' =~ m/\d+/g); sprintf(&quot;%d.&quot;.(&quot;%02d&quot;x$#v), @v); };
+
+sub new {
+    my $class = shift;
+    my $self = bless {}, $class;
+    return $self;
+}
+
+sub create {
+    my ($self) = @_;
+    my $uuid = OSSP::uuid-&gt;new;
+    $uuid-&gt;make('v4');
+    return $uuid-&gt;export('bin');
+}
+
+sub create_from_name {
+    my ($self, $nsid, $name) = @_;
+    my $uuid = OSSP::uuid-&gt;new;
+    my $nsiduuid = OSSP::uuid-&gt;new;
+    $nsiduuid-&gt;import('bin', $nsiduuid);
+    $uuid = OSSP::uuid-&gt;new;
+    $uuid-&gt;make('v3', $nsiduuid, $name);
+    return $uuid-&gt;export('bin');
+}
+
+sub to_string {
+    my ($self, $bin) = @_;
+    my $uuid = OSSP::uuid-&gt;new;
+    $uuid-&gt;import('bin', $bin);
+    return $uuid-&gt;export('str');
+}
+
+sub to_hexstring {
+    my ($self, $bin) = @_;
+    my $uuid = OSSP::uuid-&gt;new;
+    $uuid-&gt;import('bin', $bin);
+    (my $string = '0x' . $uuid-&gt;export('str')) =~ s/-//g;
+    return $string;
+}
+
+sub to_b64string {
+    my ($self, $bin) = @_;
+    return MIME::Base64::encode_base64($bin, '');
+}
+
+sub from_string {
+    my ($self, $str) = @_;
+    my $uuid = OSSP::uuid-&gt;new;
+    $uuid-&gt;import('str',
+          $str =~ /^0x/
+        ? join '-', unpack('x2 a8 a4 a4 a4 a12', $str)
+        : $str
+    );
+    return $uuid-&gt;export('bin');
+}
+
+sub from_hexstring {
+    my ($self, $str) = @_;
+    my $uuid = OSSP::uuid-&gt;new;
+    $uuid-&gt;import('str', join '-', unpack('x2 a8 a4 a4 a4 a12', $str));
+    return $uuid-&gt;export('bin');
+}
+
+sub from_b64string {
+    my ($self, $b64) = @_;
+    return MIME::Base64::decode_base64($b64);
+}
+
+sub compare {
+    my ($self, $bin1, $bin2) = @_;
+    my $uuid1 = OSSP::uuid-&gt;new;
+    my $uuid2 = OSSP::uuid-&gt;new;
+    $uuid1-&gt;import('bin', $bin1);
+    $uuid2-&gt;import('bin', $bin2);
+    return $uuid1-&gt;compare($uuid2);
+}
+
+my %NS = (
+    'NameSpace_DNS'  =&gt; 'ns:DNS',
+    'NameSpace_URL'  =&gt; 'ns:URL',
+    'NameSpace_OID'  =&gt; 'ns:OID',
+    'NameSpace_X500' =&gt; 'ns:X500',
+);
+
+while (my ($k, $v) = each %NS) {
+    no strict 'refs';
+    *{$k} = sub () {
+        my $uuid = OSSP::uuid-&gt;new;
+        $uuid-&gt;load($v);
+        return $uuid-&gt;export('bin');
+    };
+}
+
+sub constant {
+    my ($self, $arg) = @_;
+    my $uuid = OSSP::uuid-&gt;new;
+    $uuid-&gt;load($NS{$arg} || 'nil');
+    return $uuid-&gt;export('bin');
+}
+
+sub create_str {
+    my $self = shift;
+    return $self-&gt;to_string($self-&gt;create);
+}
+
+sub create_hex {
+    my $self = shift;
+    return $self-&gt;to_hexstring($self-&gt;create);
+}
+
+sub create_b64 {
+    my $self = shift;
+    return $self-&gt;to_b64string($self-&gt;create);
+}
+
+sub create_from_name_str {
+    my $self = shift;
+    return $self-&gt;to_string($self-&gt;create_from_name(@_));
+}
+
+sub create_from_name_hex {
+    my $self = shift;
+    return $self-&gt;to_hexstring($self-&gt;create_from_name(@_));
+}
+
+sub create_from_name_b64 {
+    my $self = shift;
+    return $self-&gt;to_b64string($self-&gt;create_from_name(@_));
+}
+
+1;
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidperluuid_compatpod"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/perl/uuid_compat.pod (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/perl/uuid_compat.pod                                (rev 0)
+++ freeswitch/trunk/libs/uuid/perl/uuid_compat.pod        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+##
+##  OSSP uuid - Universally Unique Identifier
+##  Copyright (c) 2004-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+##  Copyright (c) 2004-2007 The OSSP Project &lt;http://www.ossp.org/&gt;
+##
+##  This file is part of OSSP uuid, a library for the generation
+##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+##  uuid_compat.pod: Data::UUID Backward Compatibility Perl API (Perl/POD part)
+##
+
+=pod
+
+=head1 NAME
+
+Data::UUID - B&lt;OSSP uuid&gt; Backward Compatibility Perl Binding
+
+=head1 DESCRIPTION
+
+B&lt;Data::UUID&gt; is the B&lt;OSSP uuid&gt; backward compatibility Perl binding
+to the API of the original B&lt;Data::UUID&gt; module. It allows other
+B&lt;Data::UUID&gt; based Perl modules to run with B&lt;OSSP::uuid&gt; without
+changes.
+
+=head1 SEE ALSO
+
+B&lt;OSSP::uuid&gt;.
+
+=head1 HISTORY
+
+The backward compatibility Perl binding B&lt;Data::UUID&gt; for B&lt;OSSP
+uuid&gt; was originally implemented in 2004 by Piotr Roszatycki
+E&lt;lt&gt;dexter@debian.orgE&lt;gt&gt;. It was later cleaned up and speed optimized
+in December 2005 by David Wheeler E&lt;lt&gt;david@justatheory.comE&lt;gt&gt;.
+
+=cut
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidperluuid_compatts"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/perl/uuid_compat.ts (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/perl/uuid_compat.ts                                (rev 0)
+++ freeswitch/trunk/libs/uuid/perl/uuid_compat.ts        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+##
+##  OSSP uuid - Universally Unique Identifier
+##  Copyright (c) 2004-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+##  Copyright (c) 2004-2007 The OSSP Project &lt;http://www.ossp.org/&gt;
+##  Copyright (c) 2004 Piotr Roszatycki &lt;dexter@debian.org&gt;
+##
+##  This file is part of OSSP uuid, a library for the generation
+##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+##  uuid_compat.ts: Data::UUID Backward Compatibility Perl API (Perl test suite part)
+##
+
+use Test::More tests =&gt; 14;
+
+BEGIN {
+    use_ok('Data::UUID');
+    use Data::UUID;
+};
+
+ok($ug = new Data::UUID);
+
+ok($uuid1 = $ug-&gt;create());
+ok($uuid2 = $ug-&gt;to_hexstring($uuid1));
+ok($uuid3 = $ug-&gt;from_string($uuid2));
+ok($ug-&gt;compare($uuid1, $uuid3) == 0);
+
+ok($uuid4 = $ug-&gt;to_b64string($uuid1));
+ok($uuid5 = $ug-&gt;to_b64string($uuid3));
+ok($uuid4 eq $uuid5);
+
+ok($uuid6 = $ug-&gt;from_b64string($uuid5));
+ok($ug-&gt;compare($uuid6, $uuid1) == 0);
+
+ok($uuid7 = NameSpace_URL);
+ok($uuid8 = $ug-&gt;from_string(&quot;6ba7b811-9dad-11d1-80b4-00c04fd430c8&quot;));
+ok($ug-&gt;compare($uuid7, $uuid8) == 0);
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidpgsqlMakefile"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/pgsql/Makefile (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/pgsql/Makefile                                (rev 0)
+++ freeswitch/trunk/libs/uuid/pgsql/Makefile        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+##
+##  Makefile for PostgreSQL extension module
+##
+
+#   NOTICE: This requires GNU make as the PostgreSQL PGXS build
+#   environment is based on GNU make features!
+#
+#   NOTICE: Usually one would just use &quot;PGXS := $(shell pg_config
+#   --pgxs)&quot; followed by &quot;include $(PGXS)&quot; as the template. The problem
+#   just is that this way (at least still under PostgreSQL 8.1) one
+#   cannot pass the &quot;-L../.libs -luuid&quot; to the command which links the
+#   DSO. Hence we fiddle around with the Makefiles which &quot;PGXS&quot; uses
+#   itself ourself.
+
+PG_CONFIG         ?= pg_config
+PGXS              := $(shell $(PG_CONFIG) --pgxs)
+POSTGRES          := $(shell $(PG_CONFIG) --bindir)/postgres
+top_builddir      := $(dir $(PGXS))../..
+include           $(top_builddir)/src/Makefile.global
+    
+NAME              = uuid
+OBJS              = uuid.o
+SO_MAJOR_VERSION  = 1
+SO_MINOR_VERSION  = 0
+
+override CPPFLAGS := -I.. $(CPPFLAGS)
+SHLIB_LINK        := -L../.libs -luuid
+SHLIB_LINK        += $(shell test $(shell uname -s) = FreeBSD &amp;&amp; echo &quot;-Wl,-Bsymbolic&quot;)
+SHLIB_LINK        += $(shell test $(shell uname -s) = Darwin &amp;&amp; echo &quot;-bundle_loader $(POSTGRES)&quot;)
+rpath             :=
+
+all: uuid.sql all-lib
+
+enable_shared     = yes
+include           $(top_builddir)/src/Makefile.shlib
+
+uuid.sql: uuid.sql.in
+        sed -e 's;MODULE_PATHNAME;$(DESTDIR)$(pkglibdir)/uuid$(DLSUFFIX);g' &lt;uuid.sql.in &gt;uuid.sql
+
+install: all
+        $(mkinstalldirs) $(DESTDIR)$(pkglibdir)
+        $(mkinstalldirs) $(DESTDIR)$(datadir)
+        $(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/uuid$(DLSUFFIX)
+        $(INSTALL_DATA) uuid.sql $(DESTDIR)$(datadir)/uuid.sql
+
+uninstall:
+        -rm -f $(DESTDIR)$(pkglibdir)/uuid$(DLSUFFIX)
+        -rm -f $(DESTDIR)$(datadir)/uuid.sql
+
+clean distclean: clean-lib
+        rm -f $(OBJS)
+        rm -f uuid.sql
+
+realclean: distclean
+
+test:
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidpgsqluuidc"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/pgsql/uuid.c (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/pgsql/uuid.c                                (rev 0)
+++ freeswitch/trunk/libs/uuid/pgsql/uuid.c        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,436 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2007 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid.c: PostgreSQL Binding (C part)
+*/
+
+/*  own headers */
+#include &quot;uuid.h&quot;
+
+/*  PostgreSQL (part 1/2) headers */
+#include &quot;postgres.h&quot;
+
+/*  system headers */
+#include &lt;string.h&gt;
+
+/*  PostgreSQL (part 2/2) headers */
+#include &quot;fmgr.h&quot;
+#include &quot;lib/stringinfo.h&quot;
+#include &quot;access/hash.h&quot;
+
+/*  PostgreSQL module magic cookie
+    (PostgreSQL &gt;= 8.2 only) */
+#ifdef PG_MODULE_MAGIC
+PG_MODULE_MAGIC;
+#endif
+
+/* internal UUID datum data structure */
+typedef struct {
+    unsigned char uuid_bin[UUID_LEN_BIN];
+} uuid_datum_t;
+
+/* forward declarations */
+Datum pg_uuid_in     (PG_FUNCTION_ARGS);
+Datum pg_uuid_out    (PG_FUNCTION_ARGS);
+Datum pg_uuid_recv   (PG_FUNCTION_ARGS);
+Datum pg_uuid_send   (PG_FUNCTION_ARGS);
+Datum pg_uuid_hash   (PG_FUNCTION_ARGS);
+Datum pg_uuid_make   (PG_FUNCTION_ARGS);
+Datum pg_uuid_eq     (PG_FUNCTION_ARGS);
+Datum pg_uuid_ne     (PG_FUNCTION_ARGS);
+Datum pg_uuid_lt     (PG_FUNCTION_ARGS);
+Datum pg_uuid_gt     (PG_FUNCTION_ARGS);
+Datum pg_uuid_le     (PG_FUNCTION_ARGS);
+Datum pg_uuid_ge     (PG_FUNCTION_ARGS);
+Datum pg_uuid_cmp    (PG_FUNCTION_ARGS);
+
+/* API function: uuid_in */
+PG_FUNCTION_INFO_V1(pg_uuid_in);
+Datum pg_uuid_in(PG_FUNCTION_ARGS)
+{
+    char *uuid_str;
+    uuid_datum_t *uuid_datum;
+    uuid_rc_t rc;
+    uuid_t *uuid;
+    void *vp;
+    size_t len;
+
+    /* sanity check input argument */
+    if ((uuid_str = PG_GETARG_CSTRING(0)) == NULL)
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;invalid UUID string&quot;)));
+    if ((len = strlen(uuid_str)) != UUID_LEN_STR)
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;invalid UUID string length %d (expected %d)&quot;, (int)len, UUID_LEN_STR)));
+
+    /* import as string representation */
+    if ((rc = uuid_create(&amp;uuid)) != UUID_RC_OK)
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;failed to create UUID object: %s&quot;, uuid_error(rc))));
+    if ((rc = uuid_import(uuid, UUID_FMT_STR, uuid_str, len)) != UUID_RC_OK) {
+        uuid_destroy(uuid);
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;failed to import UUID string representation: %s&quot;, uuid_error(rc))));
+    }
+
+    /* export as binary representation */
+    if ((uuid_datum = (uuid_datum_t *)palloc(sizeof(uuid_datum_t))) == NULL) {
+        uuid_destroy(uuid);
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;failed to allocate UUID datum&quot;)));
+    }
+    vp = &amp;(uuid_datum-&gt;uuid_bin);
+    len = sizeof(uuid_datum-&gt;uuid_bin);
+    if ((rc = uuid_export(uuid, UUID_FMT_BIN, &amp;vp, &amp;len)) != UUID_RC_OK) {
+        uuid_destroy(uuid);
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;failed to export UUID binary representation: %s&quot;, uuid_error(rc))));
+    }
+    uuid_destroy(uuid);
+
+    /* return UUID datum */
+    PG_RETURN_POINTER(uuid_datum);
+}
+
+/* API function: uuid_out */
+PG_FUNCTION_INFO_V1(pg_uuid_out);
+Datum pg_uuid_out(PG_FUNCTION_ARGS)
+{
+    uuid_datum_t *uuid_datum;
+    uuid_rc_t rc;
+    uuid_t *uuid;
+    char *uuid_str;
+    void *vp;
+    size_t len;
+
+    /* sanity check input argument */
+    if ((uuid_datum = (uuid_datum_t *)PG_GETARG_POINTER(0)) == NULL)
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;invalid UUID datum&quot;)));
+
+    /* import as binary representation */
+    if ((rc = uuid_create(&amp;uuid)) != UUID_RC_OK)
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;failed to create UUID object: %s&quot;, uuid_error(rc))));
+    if ((rc = uuid_import(uuid, UUID_FMT_BIN, uuid_datum-&gt;uuid_bin, sizeof(uuid_datum-&gt;uuid_bin))) != UUID_RC_OK) {
+        uuid_destroy(uuid);
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;failed to import UUID binary representation: %s&quot;, uuid_error(rc))));
+    }
+
+    /* export as string representation */
+    len = UUID_LEN_STR+1;
+    if ((vp = uuid_str = (char *)palloc(len)) == NULL) {
+        uuid_destroy(uuid);
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;failed to allocate UUID string&quot;)));
+    }
+    if ((rc = uuid_export(uuid, UUID_FMT_STR, &amp;vp, &amp;len)) != UUID_RC_OK) {
+        uuid_destroy(uuid);
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;failed to export UUID string representation: %s&quot;, uuid_error(rc))));
+    }
+    uuid_destroy(uuid);
+
+    /* return UUID string */
+    PG_RETURN_CSTRING(uuid_str);
+}
+
+/* API function: uuid_recv */
+PG_FUNCTION_INFO_V1(pg_uuid_recv);
+Datum pg_uuid_recv(PG_FUNCTION_ARGS)
+{
+    StringInfo uuid_internal;
+    uuid_datum_t *uuid_datum;
+
+    /* sanity check input argument */
+    if ((uuid_internal = (StringInfo)PG_GETARG_POINTER(0)) == NULL)
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;invalid UUID StringInfo object&quot;)));
+    if (uuid_internal-&gt;len != UUID_LEN_BIN)
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;invalid UUID binary length %d (expected %d)&quot;, uuid_internal-&gt;len, UUID_LEN_BIN)));
+
+    /* import as binary representation */
+    if ((uuid_datum = (uuid_datum_t *)palloc(sizeof(uuid_datum_t))) == NULL)
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;failed to allocate UUID datum&quot;)));
+    memcpy(uuid_datum-&gt;uuid_bin, uuid_internal-&gt;data, uuid_internal-&gt;len);
+
+    /* return UUID datum */
+    PG_RETURN_POINTER(uuid_datum);
+}
+
+/* API function: uuid_send */
+PG_FUNCTION_INFO_V1(pg_uuid_send);
+Datum pg_uuid_send(PG_FUNCTION_ARGS)
+{
+    uuid_datum_t *uuid_datum;
+    bytea *uuid_bytea;
+
+    /* sanity check input argument */
+    if ((uuid_datum = (uuid_datum_t *)PG_GETARG_POINTER(0)) == NULL)
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;invalid UUID datum&quot;)));
+
+    /* export as binary representation */
+    if ((uuid_bytea = (bytea *)palloc(VARHDRSZ + UUID_LEN_BIN)) == NULL)
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;failed to allocate UUID bytea&quot;)));
+#if defined(SET_VARSIZE) /* PostgreSQL &gt;= 8.3 */
+    SET_VARSIZE(uuid_bytea, VARHDRSZ + UUID_LEN_BIN);
+#else
+    uuid_bytea-&gt;vl_len = VARHDRSZ + UUID_LEN_BIN;
+#endif
+    memcpy(uuid_bytea-&gt;vl_dat, uuid_datum-&gt;uuid_bin, UUID_LEN_BIN);
+
+    /* return UUID bytea */
+    PG_RETURN_BYTEA_P(uuid_bytea);
+}
+
+/* API function: uuid_make */
+PG_FUNCTION_INFO_V1(pg_uuid_make);
+Datum pg_uuid_make(PG_FUNCTION_ARGS)
+{
+    uuid_t *uuid;
+    uuid_t *uuid_ns;
+    uuid_rc_t rc;
+    int version;
+    unsigned int mode = 0;
+    uuid_datum_t *uuid_datum;
+    char *str_ns;
+    char *str_name;
+    void *vp;
+    size_t len;
+
+    /* sanity check input argument */
+    version = (int)PG_GETARG_INT32(0);
+    switch (version) {
+        case 1: mode = UUID_MAKE_V1; break;
+        case 3: mode = UUID_MAKE_V3; break;
+        case 4: mode = UUID_MAKE_V4; break;
+        case 5: mode = UUID_MAKE_V5; break;
+        default:
+            ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                    errmsg(&quot;invalid UUID version %d (expected 1, 3, 4 or 5)&quot;, version)));
+    }
+    if (   ((mode &amp; (UUID_MAKE_V1|UUID_MAKE_V4)) &amp;&amp; PG_NARGS() != 1)
+        || ((mode &amp; (UUID_MAKE_V3|UUID_MAKE_V5)) &amp;&amp; PG_NARGS() != 3))
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;invalid number (%d) of arguments&quot;, PG_NARGS())));
+
+    /* make a new UUID */
+    if ((rc = uuid_create(&amp;uuid)) != UUID_RC_OK)
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;failed to create UUID object: %s&quot;, uuid_error(rc))));
+    if (version == 3 || version == 5) {
+        if ((str_ns = PG_GETARG_CSTRING(1)) == NULL)
+            ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                    errmsg(&quot;invalid namespace UUID string&quot;)));
+        if ((str_name = PG_GETARG_CSTRING(2)) == NULL)
+            ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                    errmsg(&quot;invalid name string&quot;)));
+        if ((rc = uuid_create(&amp;uuid_ns)) != UUID_RC_OK)
+            ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                    errmsg(&quot;failed to create UUID namespace object: %s&quot;, uuid_error(rc))));
+        if ((rc = uuid_load(uuid_ns, str_ns)) != UUID_RC_OK) {
+            if ((rc = uuid_import(uuid_ns, UUID_FMT_STR, str_ns, strlen(str_ns))) != UUID_RC_OK)
+                ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                        errmsg(&quot;failed to import UUID namespace: %s&quot;, uuid_error(rc))));
+        }
+        if ((rc = uuid_make(uuid, mode, uuid_ns, str_name)) != UUID_RC_OK) {
+            uuid_destroy(uuid);
+            ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                    errmsg(&quot;failed to make v%d UUID: %s&quot;, version, uuid_error(rc))));
+        }
+        uuid_destroy(uuid_ns);
+    }
+    else {
+        if ((rc = uuid_make(uuid, mode)) != UUID_RC_OK) {
+            uuid_destroy(uuid);
+            ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                    errmsg(&quot;failed to make v%d UUID: %s&quot;, version, uuid_error(rc))));
+        }
+    }
+
+    /* export as binary representation */
+    if ((uuid_datum = (uuid_datum_t *)palloc(sizeof(uuid_datum_t))) == NULL) {
+        uuid_destroy(uuid);
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;failed to allocate UUID datum&quot;)));
+    }
+    vp = &amp;(uuid_datum-&gt;uuid_bin);
+    len = sizeof(uuid_datum-&gt;uuid_bin);
+    if ((rc = uuid_export(uuid, UUID_FMT_BIN, &amp;vp, &amp;len)) != UUID_RC_OK) {
+        uuid_destroy(uuid);
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;failed to export UUID binary representation: %s&quot;, uuid_error(rc))));
+    }
+    uuid_destroy(uuid);
+    PG_RETURN_POINTER(uuid_datum);
+}
+
+/* API function: uuid_hash */
+PG_FUNCTION_INFO_V1(pg_uuid_hash);
+Datum pg_uuid_hash(PG_FUNCTION_ARGS)
+{
+    uuid_datum_t *uuid_datum;
+
+    /* sanity check input argument */
+    if ((uuid_datum = (uuid_datum_t *)PG_GETARG_POINTER(0)) == NULL)
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;invalid UUID datum argument&quot;)));
+
+    /* return hash value of the UUID */
+    PG_RETURN_INT32(hash_any(uuid_datum-&gt;uuid_bin, sizeof(uuid_datum-&gt;uuid_bin)));
+}
+
+/* INTERNAL function: _uuid_cmp */
+static int _uuid_cmp(PG_FUNCTION_ARGS)
+{
+    uuid_datum_t *uuid_datum1;
+    uuid_datum_t *uuid_datum2;
+    uuid_t *uuid1;
+    uuid_t *uuid2;
+    uuid_rc_t rc;
+    int result;
+
+    /* sanity check input argument */
+    if ((uuid_datum1 = (uuid_datum_t *)PG_GETARG_POINTER(0)) == NULL)
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;invalid first UUID datum argument&quot;)));
+    if ((uuid_datum2 = (uuid_datum_t *)PG_GETARG_POINTER(1)) == NULL)
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;invalid second UUID datum argument&quot;)));
+
+    /* load both UUIDs */
+    if ((rc = uuid_create(&amp;uuid1)) != UUID_RC_OK)
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;failed to create UUID object: %s&quot;, uuid_error(rc))));
+    if ((rc = uuid_create(&amp;uuid2)) != UUID_RC_OK) {
+        uuid_destroy(uuid1);
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;failed to create UUID object: %s&quot;, uuid_error(rc))));
+    }
+    if ((rc = uuid_import(uuid1, UUID_FMT_BIN, uuid_datum1-&gt;uuid_bin, sizeof(uuid_datum1-&gt;uuid_bin))) != UUID_RC_OK) {
+        uuid_destroy(uuid1);
+        uuid_destroy(uuid2);
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;failed to import UUID: %s&quot;, uuid_error(rc))));
+    }
+    if ((rc = uuid_import(uuid2, UUID_FMT_BIN, uuid_datum2-&gt;uuid_bin, sizeof(uuid_datum2-&gt;uuid_bin))) != UUID_RC_OK) {
+        uuid_destroy(uuid1);
+        uuid_destroy(uuid2);
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;failed to import UUID: %s&quot;, uuid_error(rc))));
+    }
+
+    /* compare UUIDs */
+    if ((rc = uuid_compare(uuid1, uuid2, &amp;result)) != UUID_RC_OK) {
+        uuid_destroy(uuid1);
+        uuid_destroy(uuid2);
+        ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION),
+                errmsg(&quot;failed to compare UUID objects: %s&quot;, uuid_error(rc))));
+    }
+
+    /* cleanup */
+    uuid_destroy(uuid1);
+    uuid_destroy(uuid2);
+
+    /* return result */
+    return result;
+}
+
+/* API function: uuid_eq */
+PG_FUNCTION_INFO_V1(pg_uuid_eq);
+Datum pg_uuid_eq(PG_FUNCTION_ARGS)
+{
+    int rc;
+
+    rc = _uuid_cmp(fcinfo);
+    PG_RETURN_BOOL(rc == 0);
+}
+
+/* API function: uuid_ne */
+PG_FUNCTION_INFO_V1(pg_uuid_ne);
+Datum pg_uuid_ne(PG_FUNCTION_ARGS)
+{
+    int rc;
+
+    rc = _uuid_cmp(fcinfo);
+    PG_RETURN_BOOL(rc != 0);
+}
+
+/* API function: uuid_lt */
+PG_FUNCTION_INFO_V1(pg_uuid_lt);
+Datum pg_uuid_lt(PG_FUNCTION_ARGS)
+{
+    int rc;
+
+    rc = _uuid_cmp(fcinfo);
+    PG_RETURN_BOOL(rc == -1);
+}
+
+/* API function: uuid_gt */
+PG_FUNCTION_INFO_V1(pg_uuid_gt);
+Datum pg_uuid_gt(PG_FUNCTION_ARGS)
+{
+    int rc;
+
+    rc = _uuid_cmp(fcinfo);
+    PG_RETURN_BOOL(rc == 1);
+}
+
+/* API function: uuid_le */
+PG_FUNCTION_INFO_V1(pg_uuid_le);
+Datum pg_uuid_le(PG_FUNCTION_ARGS)
+{
+    int rc;
+
+    rc = _uuid_cmp(fcinfo);
+    PG_RETURN_BOOL(rc &lt; 1);
+}
+
+/* API function: uuid_ge */
+PG_FUNCTION_INFO_V1(pg_uuid_ge);
+Datum pg_uuid_ge(PG_FUNCTION_ARGS)
+{
+    int rc;
+
+    rc = _uuid_cmp(fcinfo);
+    PG_RETURN_BOOL(rc &gt; -1);
+}
+
+/* API function: uuid_cmp */
+PG_FUNCTION_INFO_V1(pg_uuid_cmp);
+Datum pg_uuid_cmp(PG_FUNCTION_ARGS)
+{
+    int rc;
+
+    rc = _uuid_cmp(fcinfo);
+    PG_RETURN_INT32(rc);
+}
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidpgsqluuidsqlin"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/pgsql/uuid.sql.in (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/pgsql/uuid.sql.in                                (rev 0)
+++ freeswitch/trunk/libs/uuid/pgsql/uuid.sql.in        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,244 @@
</span><ins>+--
+--  OSSP uuid - Universally Unique Identifier
+--  Copyright (c) 2004-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+--  Copyright (c) 2004-2007 The OSSP Project &lt;http://www.ossp.org/&gt;
+--
+--  This file is part of OSSP uuid, a library for the generation
+--  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+--
+--  Permission to use, copy, modify, and distribute this software for
+--  any purpose with or without fee is hereby granted, provided that
+--  the above copyright notice and this permission notice appear in all
+--  copies.
+--
+--  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+--  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+--  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+--  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+--  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+--  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+--  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+--  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+--  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+--  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+--  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+--  SUCH DAMAGE.
+--
+--  uuid.sql: PostgreSQL Binding (SQL part)
+--
+
+--
+--  prolog
+--
+
+SET search_path TO public;
+SET client_min_messages TO warning;
+
+DROP FUNCTION uuid_in(CSTRING)                    CASCADE;
+DROP FUNCTION uuid_out(uuid)                      CASCADE;
+DROP FUNCTION uuid_recv(INTERNAL)                 CASCADE;
+DROP FUNCTION uuid_send(uuid)                     CASCADE;
+DROP TYPE     uuid                                CASCADE;
+DROP CAST     (CSTRING AS uuid)                   CASCADE;
+DROP CAST     (uuid AS CSTRING)                   CASCADE;
+
+DROP FUNCTION uuid(CSTRING)                       CASCADE;
+DROP FUNCTION uuid(INTEGER)                       CASCADE;
+DROP FUNCTION uuid(INTEGER, CSTRING, CSTRING)     CASCADE;
+
+DROP FUNCTION uuid_eq(uuid)                       CASCADE;
+DROP FUNCTION uuid_ne(uuid)                       CASCADE;
+DROP FUNCTION uuid_lt(uuid, uuid)                 CASCADE;
+DROP FUNCTION uuid_gt(uuid, uuid)                 CASCADE;
+DROP FUNCTION uuid_le(uuid, uuid)                 CASCADE;
+DROP FUNCTION uuid_ge(uuid, uuid)                 CASCADE;
+DROP OPERATOR =(uuid,uuid)                        CASCADE;
+DROP OPERATOR &lt;&gt;(uuid,uuid)                       CASCADE;
+DROP OPERATOR &lt;(uuid,uuid)                        CASCADE;
+DROP OPERATOR &gt;(uuid,uuid)                        CASCADE;
+DROP OPERATOR &lt;=(uuid,uuid)                       CASCADE;
+DROP OPERATOR &gt;=(uuid,uuid)                       CASCADE;
+
+DROP FUNCTION uuid_hash(uuid)                     CASCADE;
+DROP FUNCTION uuid_cmp(uuid, uuid)                CASCADE;
+DROP OPERATOR CLASS uuid_ops USING hash           CASCADE;
+DROP OPERATOR CLASS uuid_ops USING btree          CASCADE;
+
+BEGIN;
+
+--
+--  the UUID data type
+--
+
+CREATE FUNCTION
+    uuid_in(CSTRING) RETURNS uuid
+    STRICT
+    LANGUAGE C AS 'MODULE_PATHNAME', 'pg_uuid_in';
+
+CREATE FUNCTION
+    uuid_out(uuid) RETURNS CSTRING
+    STRICT
+    LANGUAGE C AS 'MODULE_PATHNAME', 'pg_uuid_out';
+
+CREATE FUNCTION
+    uuid_recv(INTERNAL) RETURNS uuid
+    STRICT
+    LANGUAGE C AS 'MODULE_PATHNAME', 'pg_uuid_recv';
+
+CREATE FUNCTION
+    uuid_send(uuid) RETURNS BYTEA
+    STRICT
+    LANGUAGE C AS 'MODULE_PATHNAME', 'pg_uuid_send';
+
+CREATE TYPE uuid (
+    INPUT   = uuid_in,   -- for SQL input
+    OUTPUT  = uuid_out,  -- for SQL output
+    RECEIVE = uuid_recv, -- for DB input
+    SEND    = uuid_send, -- for DB output
+    DEFAULT = 'uuid(1)',
+    INTERNALLENGTH = 16,
+    ALIGNMENT = char
+);
+
+COMMENT ON TYPE uuid
+    IS 'UUID type';
+
+-- CREATE CAST (CSTRING AS uuid)
+--     WITH FUNCTION uuid_in(CSTRING) AS ASSIGNMENT;
+-- 
+-- CREATE CAST (uuid AS CSTRING)
+--     WITH FUNCTION uuid_out(uuid)   AS ASSIGNMENT;
+
+--
+--  the UUID constructor function
+--
+
+CREATE FUNCTION
+    uuid(CSTRING) RETURNS uuid
+    IMMUTABLE STRICT
+    LANGUAGE C AS 'MODULE_PATHNAME', 'pg_uuid_in';
+
+CREATE FUNCTION
+    uuid(INTEGER) RETURNS uuid
+    VOLATILE CALLED ON NULL INPUT
+    LANGUAGE C AS 'MODULE_PATHNAME', 'pg_uuid_make';
+
+CREATE FUNCTION
+    uuid(INTEGER, CSTRING, CSTRING) RETURNS uuid
+    VOLATILE CALLED ON NULL INPUT
+    LANGUAGE C AS 'MODULE_PATHNAME', 'pg_uuid_make';
+
+--
+--  the UUID operators
+--
+
+CREATE FUNCTION
+    uuid_eq(uuid, uuid) RETURNS BOOL
+    IMMUTABLE STRICT
+    LANGUAGE C AS 'MODULE_PATHNAME', 'pg_uuid_eq';
+
+CREATE FUNCTION
+    uuid_ne(uuid, uuid) RETURNS BOOL
+    IMMUTABLE STRICT
+    LANGUAGE C AS 'MODULE_PATHNAME', 'pg_uuid_ne';
+
+CREATE FUNCTION
+    uuid_lt(uuid, uuid) RETURNS BOOL
+    IMMUTABLE STRICT
+    LANGUAGE C AS 'MODULE_PATHNAME', 'pg_uuid_lt';
+
+CREATE FUNCTION
+    uuid_gt(uuid, uuid) RETURNS BOOL
+    IMMUTABLE STRICT
+    LANGUAGE C AS 'MODULE_PATHNAME', 'pg_uuid_gt';
+
+CREATE FUNCTION
+    uuid_le(uuid, uuid) RETURNS BOOL
+    IMMUTABLE STRICT
+    LANGUAGE C AS 'MODULE_PATHNAME', 'pg_uuid_le';
+
+CREATE FUNCTION
+    uuid_ge(uuid, uuid) RETURNS BOOL
+    IMMUTABLE STRICT
+    LANGUAGE C AS 'MODULE_PATHNAME', 'pg_uuid_ge';
+
+CREATE OPERATOR = (
+    leftarg    = uuid,
+    rightarg   = uuid,
+    negator    = &lt;&gt;,
+    procedure  = uuid_eq
+);
+
+CREATE OPERATOR &lt;&gt; (
+    leftarg    = uuid,
+    rightarg   = uuid,
+    negator    = =,
+    procedure  = uuid_ne
+);
+
+CREATE OPERATOR &lt; (
+    leftarg    = uuid,
+    rightarg   = uuid,
+    commutator = &gt;,
+    negator    = &gt;=,
+    procedure  = uuid_lt
+);
+
+CREATE OPERATOR &gt; (
+    leftarg    = uuid,
+    rightarg   = uuid,
+    commutator = &lt;,
+    negator    = &lt;=,
+    procedure  = uuid_gt
+);
+
+CREATE OPERATOR &lt;= (
+    leftarg    = uuid,
+    rightarg   = uuid,
+    commutator = &gt;=,
+    negator    = &gt;,
+    procedure  = uuid_le
+);
+
+CREATE OPERATOR &gt;= (
+    leftarg    = uuid,
+    rightarg   = uuid,
+    commutator = &lt;=,
+    negator    = &lt;,
+    procedure  = uuid_ge
+);
+
+--
+--  the UUID support for indexing
+--
+
+CREATE FUNCTION
+    uuid_hash(uuid) RETURNS INTEGER
+    IMMUTABLE STRICT
+    LANGUAGE C AS 'MODULE_PATHNAME', 'pg_uuid_hash';
+
+CREATE FUNCTION
+    uuid_cmp(uuid, uuid) RETURNS INTEGER
+    IMMUTABLE STRICT
+    LANGUAGE C AS 'MODULE_PATHNAME', 'pg_uuid_cmp';
+
+CREATE OPERATOR CLASS uuid_ops
+    DEFAULT FOR TYPE uuid USING hash AS
+    OPERATOR 1 =,   -- 1: equal
+    FUNCTION 1 uuid_hash(uuid);
+
+CREATE OPERATOR CLASS uuid_ops
+    DEFAULT FOR TYPE uuid USING btree AS
+    OPERATOR 1 &lt;,   -- 1: less than
+    OPERATOR 2 &lt;=,  -- 2: less than or equal
+    OPERATOR 3 =,   -- 3: equal
+    OPERATOR 4 &gt;=,  -- 4: greater than or equal
+    OPERATOR 5 &gt;,   -- 5: greater than
+    FUNCTION 1 uuid_cmp(uuid, uuid);
+
+--
+--  epilog
+--
+
+COMMIT;
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidpgsqluuidtxt"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/pgsql/uuid.txt (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/pgsql/uuid.txt                                (rev 0)
+++ freeswitch/trunk/libs/uuid/pgsql/uuid.txt        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+
+  OSSP uuid bindings for PostgreSQL
+  =================================
+
+  This is the OSSP uuid binding for the PostgreSQL RDBMS, providing
+  native UUID data type support.
+
+  Installation
+  ------------
+
+  In order to install the OSSP uuid binding into the PostgreSQL database
+  &lt;database&gt; one has run:
+
+  $ &lt;prefix&gt;/bin/psql \
+    -d &lt;database&gt; \
+    -U postgresql \
+    -f &lt;prefix&gt;/share/postgresql/uuid.sql
+
+  Usage
+  -----
+
+  psql -d &lt;database&gt;
+  psql&gt; CREATE TABLE test (id UUID DEFAULT uuid(1), name TEXT);
+  psql&gt; INSERT INTO test (name) VALUES
+        ('foo');
+  psql&gt; INSERT INTO test (id, name) VALUES
+        (uuid(1), 'bar');
+  psql&gt; INSERT INTO test (id, name) VALUES
+        (uuid(3, 'ns:URL', 'http://www.ossp.org/'), 'baz');
+  psql&gt; INSERT INTO test (id, name) VALUES
+        (uuid(3, '6ba7b811-9dad-11d1-80b4-00c04fd430c8',
+                 'http://www.ossp.org/'), 'quux');
+  psql&gt; SELECT uuid(4);
+  psql&gt; SELECT * FROM test WHERE id = uuid(3, 'ns:URL', 'http://www.ossp.org/');
+  psql&gt; DROP TABLE test;
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidphpMakefilelocal"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/php/Makefile.local (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/php/Makefile.local                                (rev 0)
+++ freeswitch/trunk/libs/uuid/php/Makefile.local        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,71 @@
</span><ins>+##
+##  OSSP uuid - Universally Unique Identifier
+##  Copyright (c) 2004-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+##  Copyright (c) 2004-2007 The OSSP Project &lt;http://www.ossp.org/&gt;
+##
+##  This file is part of OSSP uuid, a library for the generation
+##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+##  Makefile.local: PHP/Zend API build procedure (language: make)
+##
+
+PHP     = php
+EXTDIR  = `$(PHP)-config --extension-dir`
+DESTDIR =
+
+all: build
+
+config:
+        @if [ ! -f ./configure ]; then $(PHP)ize 2&gt;/dev/null; fi
+        @if [ ! -f ./Makefile ]; then ./configure --with-php-config=$(PHP)-config; fi
+
+build: config
+        @$(MAKE) $(MFLAGS) -f Makefile
+
+test: build
+        @version=`$(PHP)-config --version | sed -e 's;^\([0-9]\).*$$;\1;'`; \
+        $(PHP) -q -d &quot;safe_mode=0&quot; -d &quot;extension_dir=./&quot; uuid.ts $$version
+
+install: build
+        @version=`$(PHP)-config --version | sed -e 's;^\([0-9]\).*$$;\1;'`; extdir=&quot;$(EXTDIR)&quot;; \
+        echo &quot;installing PHP$$version API into $$extdir&quot;; \
+        ./build/shtool mkdir -f -p -m 755 $(DESTDIR)$$extdir; \
+        ./build/shtool install -c -m 755 modules/uuid.so $(DESTDIR)$$extdir/uuid.so; \
+        ./build/shtool install -c -m 644 uuid.php$$version $(DESTDIR)$$extdir/uuid.php
+
+clean:
+        @$(MAKE) $(MFLAGS) -f Makefile clean || true
+
+distclean: clean
+        -rm -f Makefile .deps
+        -rm -f config.status configure.lineno
+        -rm -f config.h config.log
+        -rm -f *.core *~
+
+realclean: distclean
+        -rm -rf autom4te.cache build include modules
+        -rm -f Makefile.fragments Makefile.objects Makefile.global
+        -rm -f acinclude.m4 aclocal.m4
+        -rm -f config.guess config.h.in config.nice config.sub
+        -rm -f configure configure.in 
+        -rm -f install-sh libtool ltmain.sh missing mkinstalldirs
+        -rm -f run-tests.php
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidphpconfigm4"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/php/config.m4 (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/php/config.m4                                (rev 0)
+++ freeswitch/trunk/libs/uuid/php/config.m4        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+dnl
+dnl  OSSP uuid - Universally Unique Identifier
+dnl  Copyright (c) 2004-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+dnl  Copyright (c) 2004-2007 The OSSP Project &lt;http://www.ossp.org/&gt;
+dnl
+dnl  This file is part of OSSP uuid, a library for the generation
+dnl  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+dnl
+dnl  Permission to use, copy, modify, and distribute this software for
+dnl  any purpose with or without fee is hereby granted, provided that
+dnl  the above copyright notice and this permission notice appear in all
+dnl  copies.
+dnl
+dnl  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+dnl  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+dnl  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+dnl  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+dnl  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+dnl  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+dnl  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+dnl  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+dnl  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+dnl  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+dnl  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+dnl  SUCH DAMAGE.
+dnl
+dnl  config.m4: PHP/Zend API build-time configuration (language: m4)
+dnl
+
+PHP_ARG_ENABLE(uuid, OSSP uuid module,
+[  --enable-uuid             Enable OSSP uuid extension module.])
+
+if test &quot;$PHP_UUID&quot; != &quot;no&quot;; then
+    PHP_NEW_EXTENSION(uuid, uuid.c, $ext_shared)
+    AC_DEFINE(HAVE_UUID, 1, [Have OSSP uuid library])
+    PHP_ADD_LIBPATH([..], )
+    PHP_ADD_LIBRARY([uuid],, UUID_SHARED_LIBADD)
+    PHP_ADD_INCLUDE([..])
+    PHP_SUBST(UUID_SHARED_LIBADD)
+
+    dnl  avoid linking conflict with a potentially existing uuid_create(3) in libc
+    AC_CHECK_FUNC(uuid_create,[
+        SAVE_LDFLAGS=&quot;$LDFLAGS&quot;
+        LDFLAGS=&quot;$LDFLAGS -Wl,-Bsymbolic&quot;
+        AC_TRY_LINK([],[], [EXTRA_LDFLAGS=&quot;$EXTRA_LDFLAGS -Wl,-Bsymbolic&quot;])
+        LDFLAGS=&quot;$SAVE_LDFLAGS&quot;])
+fi
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidphppackagexml"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/php/package.xml (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/php/package.xml                                (rev 0)
+++ freeswitch/trunk/libs/uuid/php/package.xml        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot; ?&gt;
+&lt;package&gt;
+  &lt;name&gt;uuid&lt;/name&gt;
+  &lt;summary&gt;Universally Unique Identifiers (UUID) extension&lt;/summary&gt;
+  &lt;description&gt;
+    UUID is a PHP extension for the creation
+    of Universally Unique Identifiers (UUID).
+  &lt;/description&gt;
+  &lt;license&gt;MIT-Style License&lt;/license&gt;
+  &lt;maintainers&gt;
+    &lt;maintainer&gt;
+      &lt;user&gt;rse&lt;/user&gt;
+      &lt;name&gt;Ralf S. Engelschall&lt;/name&gt;
+      &lt;email&gt;rse@engelschall.com&lt;/email&gt;
+    &lt;/maintainer&gt;
+  &lt;/maintainers&gt;
+    &lt;release&gt;
+      &lt;version&gt;1.0&lt;/version&gt;
+      &lt;date&gt;2003-05-17&lt;/date&gt;
+      &lt;state&gt;unstable&lt;/state&gt;
+    &lt;/release&gt;
+  &lt;configureoptions&gt;
+    &lt;configureoption name=&quot;with-uuid&quot; default=&quot;autodetect&quot; prompt=&quot;path to OSSP uuid?&quot;/&gt;
+  &lt;/configureoptions&gt;
+  &lt;filelist&gt;
+    &lt;dir role=&quot;src&quot; name=&quot;/&quot;&gt;
+      &lt;file role=&quot;src&quot;&gt;Makefile.local&lt;/file&gt;
+      &lt;file role=&quot;src&quot;&gt;config.m4&lt;/file&gt;
+      &lt;file role=&quot;src&quot;&gt;uuid.c&lt;/file&gt;
+      &lt;file role=&quot;php&quot;&gt;uuid.php4&lt;/file&gt;
+      &lt;file role=&quot;php&quot;&gt;uuid.php5&lt;/file&gt;
+      &lt;file role=&quot;src&quot;&gt;uuid.ts&lt;/file&gt;
+    &lt;/dir&gt;
+  &lt;/filelist&gt;
+&lt;/package&gt;
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidphpuuidc"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/php/uuid.c (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/php/uuid.c                                (rev 0)
+++ freeswitch/trunk/libs/uuid/php/uuid.c        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,531 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2007 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid.c: PHP/Zend API (language: C)
+*/
+
+#ifdef HAVE_CONFIG_H
+#include &quot;config.h&quot;
+#endif
+
+#include &quot;uuid.h&quot;
+#include &quot;php.h&quot;
+#include &quot;ext/standard/info.h&quot;
+
+/* context structure */
+typedef struct {
+    uuid_t *uuid;
+} ctx_t;
+
+/* context implicit destruction */
+static void ctx_destructor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
+{
+    ctx_t *ctx = (ctx_t *)rsrc-&gt;ptr;
+
+    if (ctx != NULL) {
+        if (ctx-&gt;uuid != NULL) {
+            uuid_destroy(ctx-&gt;uuid);
+            ctx-&gt;uuid = NULL;
+        }
+        free(ctx);
+    }
+    return;
+}
+
+/* context resource identification */
+static int ctx_id;               /* internal number */
+#define ctx_name &quot;UUID context&quot;  /* external name   */
+
+/* module initialization */
+PHP_MINIT_FUNCTION(uuid)
+{
+    /* register resource identifier */
+    ctx_id = zend_register_list_destructors_ex(
+        ctx_destructor, NULL, ctx_name, module_number);
+
+    /* register API constants */
+    REGISTER_LONG_CONSTANT(&quot;UUID_VERSION&quot;, UUID_VERSION, CONST_CS|CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT(&quot;UUID_LEN_BIN&quot;, UUID_LEN_BIN, CONST_CS|CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT(&quot;UUID_LEN_STR&quot;, UUID_LEN_STR, CONST_CS|CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT(&quot;UUID_LEN_SIV&quot;, UUID_LEN_SIV, CONST_CS|CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT(&quot;UUID_RC_OK&quot;,   UUID_RC_OK,   CONST_CS|CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT(&quot;UUID_RC_ARG&quot;,  UUID_RC_ARG,  CONST_CS|CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT(&quot;UUID_RC_MEM&quot;,  UUID_RC_MEM,  CONST_CS|CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT(&quot;UUID_RC_SYS&quot;,  UUID_RC_SYS,  CONST_CS|CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT(&quot;UUID_RC_INT&quot;,  UUID_RC_INT,  CONST_CS|CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT(&quot;UUID_RC_IMP&quot;,  UUID_RC_IMP,  CONST_CS|CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT(&quot;UUID_MAKE_V1&quot;, UUID_MAKE_V1, CONST_CS|CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT(&quot;UUID_MAKE_V3&quot;, UUID_MAKE_V3, CONST_CS|CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT(&quot;UUID_MAKE_V4&quot;, UUID_MAKE_V4, CONST_CS|CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT(&quot;UUID_MAKE_V5&quot;, UUID_MAKE_V5, CONST_CS|CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT(&quot;UUID_MAKE_MC&quot;, UUID_MAKE_MC, CONST_CS|CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT(&quot;UUID_FMT_BIN&quot;, UUID_FMT_BIN, CONST_CS|CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT(&quot;UUID_FMT_STR&quot;, UUID_FMT_STR, CONST_CS|CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT(&quot;UUID_FMT_SIV&quot;, UUID_FMT_SIV, CONST_CS|CONST_PERSISTENT);
+    REGISTER_LONG_CONSTANT(&quot;UUID_FMT_TXT&quot;, UUID_FMT_TXT, CONST_CS|CONST_PERSISTENT);
+
+    return SUCCESS;
+}
+
+/* module shutdown */
+PHP_MSHUTDOWN_FUNCTION(uuid)
+{
+    return SUCCESS;
+}
+
+/* module information */
+PHP_MINFO_FUNCTION(uuid)
+{
+    char version[32];
+
+    /* provide PHP module information */
+    sprintf(version, &quot;%lx&quot;, uuid_version());
+    php_info_print_table_start();
+    php_info_print_table_row(2, &quot;UUID (Universally Unique Identifier) Support&quot;, &quot;enabled&quot;);
+    php_info_print_table_row(2, &quot;UUID Library Version&quot;, version);
+    php_info_print_table_end();
+
+    return;
+}
+
+/* API FUNCTION:
+   proto rc uuid_create(ctx)
+   $rc = uuid_create(&amp;$uuid);
+   create UUID context */
+PHP_FUNCTION(uuid_create)
+{
+    zval *z_ctx;
+    ctx_t *ctx;
+    uuid_rc_t rc;
+
+    /* parse parameters */
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;z&quot;, &amp;z_ctx) == FAILURE)
+        RETURN_LONG((long)UUID_RC_ARG);
+
+    /* post-process and sanity check parameters */
+    if (!PZVAL_IS_REF(z_ctx)) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_create: parameter wasn't passed by reference&quot;);
+        RETURN_LONG((long)UUID_RC_ARG);
+    }
+
+    /* perform operation */
+    if ((ctx = (ctx_t *)malloc(sizeof(ctx_t))) == NULL)
+        RETURN_LONG((long)UUID_RC_MEM);
+    if ((rc = uuid_create(&amp;ctx-&gt;uuid)) != UUID_RC_OK) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_create: %s&quot;, uuid_error(rc));
+        RETURN_LONG((long)rc);
+    }
+    ZEND_REGISTER_RESOURCE(z_ctx, ctx, ctx_id);
+
+    RETURN_LONG((long)rc);
+}
+
+/* API FUNCTION:
+   proto rc uuid_destroy(ctx)
+   $rc = uuid_destroy($uuid);
+   destroy UUID context */
+PHP_FUNCTION(uuid_destroy)
+{
+    zval *z_ctx;
+    ctx_t *ctx;
+    uuid_rc_t rc;
+
+    /* parse parameters */
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;r&quot;, &amp;z_ctx) == FAILURE)
+        RETURN_LONG((long)UUID_RC_ARG);
+
+    /* post-process and sanity check parameters */
+    ZEND_FETCH_RESOURCE(ctx, ctx_t *, &amp;z_ctx, -1, ctx_name, ctx_id);
+    if (ctx == NULL || ctx-&gt;uuid == NULL) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_destroy: invalid context&quot;);
+        RETURN_LONG((long)UUID_RC_ARG);
+    }
+
+    /* perform operation */
+    if ((rc = uuid_destroy(ctx-&gt;uuid)) != UUID_RC_OK) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_destroy: %s&quot;, uuid_error(rc));
+        RETURN_LONG((long)rc);
+    }
+    ctx-&gt;uuid = NULL;
+
+    RETURN_LONG((long)rc);
+}
+
+/* API FUNCTION:
+   proto rc uuid_clone(ctx, &amp;ctx2)
+   $rc = uuid_clone($uuid, &amp;$uuid);
+   clone UUID context */
+PHP_FUNCTION(uuid_clone)
+{
+    zval *z_ctx;
+    ctx_t *ctx;
+    zval *z_clone;
+    ctx_t *clone;
+    uuid_rc_t rc;
+
+    /* parse parameters */
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;rz&quot;, &amp;z_ctx, &amp;z_clone) == FAILURE)
+        RETURN_LONG((long)UUID_RC_ARG);
+
+    /* post-process and sanity check parameters */
+    ZEND_FETCH_RESOURCE(ctx, ctx_t *, &amp;z_ctx, -1, ctx_name, ctx_id);
+    if (ctx == NULL || ctx-&gt;uuid == NULL) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_clone: invalid context&quot;);
+        RETURN_LONG((long)UUID_RC_ARG);
+    }
+    if (!PZVAL_IS_REF(z_clone)) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_clone: clone parameter wasn't passed by reference&quot;);
+        RETURN_LONG((long)UUID_RC_ARG);
+    }
+
+    /* perform operation */
+    if ((clone = (ctx_t *)malloc(sizeof(ctx_t))) == NULL)
+        RETURN_LONG((long)UUID_RC_MEM);
+    if ((rc = uuid_clone(ctx-&gt;uuid, &amp;clone-&gt;uuid)) != UUID_RC_OK) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_clone: %s&quot;, uuid_error(rc));
+        RETURN_LONG((long)rc);
+    }
+    ZEND_REGISTER_RESOURCE(z_clone, clone, ctx_id);
+
+    RETURN_LONG((long)rc);
+}
+
+/* API FUNCTION:
+   proto rc uuid_load(ctx, name)
+   $rc = uuid_name($uuid, $name);
+   load an existing UUID */
+PHP_FUNCTION(uuid_load)
+{
+    zval *z_ctx;
+    ctx_t *ctx;
+    char *name;
+    size_t name_len;
+    uuid_rc_t rc;
+
+    /* parse parameters */
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;rs&quot;, &amp;z_ctx, &amp;name, &amp;name_len) == FAILURE)
+        RETURN_LONG((long)UUID_RC_ARG);
+
+    /* post-process and sanity check parameters */
+    ZEND_FETCH_RESOURCE(ctx, ctx_t *, &amp;z_ctx, -1, ctx_name, ctx_id);
+    if (ctx == NULL || ctx-&gt;uuid == NULL) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_load: invalid context&quot;);
+        RETURN_LONG((long)UUID_RC_ARG);
+    }
+
+    /* perform operation */
+    if ((rc = uuid_load(ctx-&gt;uuid, name)) != UUID_RC_OK) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_load: %s&quot;, uuid_error(rc));
+        RETURN_LONG((long)rc);
+    }
+
+    RETURN_LONG((long)rc);
+}
+
+/* API FUNCTION:
+   proto rc uuid_make(ctx, mode[, ..., ...])
+   $rc = uuid_make($uuid, $mode[, ..., ...]);
+   make a new UUID */
+PHP_FUNCTION(uuid_make)
+{
+    zval *z_ctx;
+    ctx_t *ctx;
+    uuid_rc_t rc;
+    long z_mode;
+    unsigned long mode;
+    zval *z_ctx_ns;
+    ctx_t *ctx_ns;
+    char *url;
+    size_t url_len;
+
+    /* parse parameters */
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;rl|rs&quot;, &amp;z_ctx, &amp;z_mode, &amp;z_ctx_ns, &amp;url, &amp;url_len) == FAILURE)
+        RETURN_LONG((long)UUID_RC_ARG);
+
+    /* post-process and sanity check parameters */
+    ZEND_FETCH_RESOURCE(ctx, ctx_t *, &amp;z_ctx, -1, ctx_name, ctx_id);
+    if (ctx == NULL || ctx-&gt;uuid == NULL) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_make: invalid context&quot;);
+        RETURN_LONG((long)UUID_RC_ARG);
+    }
+    mode = (unsigned long)z_mode;
+
+    /* perform operation */
+    if (ZEND_NUM_ARGS() == 2 &amp;&amp; ((mode &amp; UUID_MAKE_V1) || (mode &amp; UUID_MAKE_V4))) {
+        if ((rc = uuid_make(ctx-&gt;uuid, mode)) != UUID_RC_OK) {
+            php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_make: %s&quot;, uuid_error(rc));
+            RETURN_LONG((long)rc);
+        }
+    }
+    else if (ZEND_NUM_ARGS() == 4 &amp;&amp; ((mode &amp; UUID_MAKE_V3) || (mode &amp; UUID_MAKE_V5))) {
+        ZEND_FETCH_RESOURCE(ctx_ns, ctx_t *, &amp;z_ctx_ns, -1, ctx_name, ctx_id);
+        if (ctx_ns == NULL) {
+            php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_make: invalid namespace context&quot;);
+            RETURN_LONG((long)UUID_RC_ARG);
+        }
+        if (url == NULL) {
+            php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_make: invalid URL&quot;);
+            RETURN_LONG((long)UUID_RC_ARG);
+        }
+        if ((rc = uuid_make(ctx-&gt;uuid, mode, ctx_ns-&gt;uuid, url)) != UUID_RC_OK) {
+            php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_make: %s&quot;, uuid_error(rc));
+            RETURN_LONG((long)rc);
+        }
+    }
+    else {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_make: invalid mode&quot;);
+        RETURN_LONG((long)UUID_RC_ARG);
+    }
+
+    RETURN_LONG((long)rc);
+}
+
+/* API FUNCTION:
+   proto rc uuid_isnil(ctx, result)
+   $rc = uuid_isnil($uuid, &amp;$result);
+   compare UUID for being Nil UUID */
+PHP_FUNCTION(uuid_isnil)
+{
+    zval *z_ctx;
+    ctx_t *ctx;
+    uuid_rc_t rc;
+    zval *z_result;
+    int result;
+
+    /* parse parameters */
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;rz&quot;, &amp;z_ctx, &amp;z_result) == FAILURE)
+        RETURN_LONG((long)UUID_RC_ARG);
+
+    /* post-process and sanity check parameters */
+    ZEND_FETCH_RESOURCE(ctx, ctx_t *, &amp;z_ctx, -1, ctx_name, ctx_id);
+    if (ctx == NULL || ctx-&gt;uuid == NULL) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_isnil: invalid context&quot;);
+        RETURN_LONG((long)UUID_RC_ARG);
+    }
+    if (!PZVAL_IS_REF(z_result)) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_isnil: result parameter wasn't passed by reference&quot;);
+        RETURN_LONG((long)UUID_RC_ARG);
+    }
+
+    /* perform operation */
+    if ((rc = uuid_isnil(ctx-&gt;uuid, &amp;result)) != UUID_RC_OK) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_isnil: %s&quot;, uuid_error(rc));
+        RETURN_LONG((long)rc);
+    }
+    ZVAL_LONG(z_result, (long)result);
+
+    RETURN_LONG((long)rc);
+}
+
+/* API FUNCTION:
+   proto rc uuid_compare(ctx, ctx2, result)
+   $rc = uuid_compare($uuid, $uuid2, &amp;$result);
+   compare two UUIDs */
+PHP_FUNCTION(uuid_compare)
+{
+    zval *z_ctx;
+    ctx_t *ctx;
+    zval *z_ctx2;
+    ctx_t *ctx2;
+    uuid_rc_t rc;
+    zval *z_result;
+    int result;
+
+    /* parse parameters */
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;rrz&quot;, &amp;z_ctx, &amp;z_ctx2, &amp;z_result) == FAILURE)
+        RETURN_LONG((long)UUID_RC_ARG);
+
+    /* post-process and sanity check parameters */
+    ZEND_FETCH_RESOURCE(ctx, ctx_t *, &amp;z_ctx, -1, ctx_name, ctx_id);
+    if (ctx == NULL || ctx-&gt;uuid == NULL) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_compare: invalid context&quot;);
+        RETURN_LONG((long)UUID_RC_ARG);
+    }
+    ZEND_FETCH_RESOURCE(ctx2, ctx_t *, &amp;z_ctx2, -1, ctx_name, ctx_id);
+    if (ctx2 == NULL || ctx2-&gt;uuid) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_compare: invalid context&quot;);
+        RETURN_LONG((long)UUID_RC_ARG);
+    }
+    if (!PZVAL_IS_REF(z_result)) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_compare: result parameter wasn't passed by reference&quot;);
+        RETURN_LONG((long)UUID_RC_ARG);
+    }
+
+    /* perform operation */
+    if ((rc = uuid_compare(ctx-&gt;uuid, ctx2-&gt;uuid, &amp;result)) != UUID_RC_OK) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_compare: %s&quot;, uuid_error(rc));
+        RETURN_LONG((long)rc);
+    }
+    ZVAL_LONG(z_result, (long)result);
+
+    RETURN_LONG((long)rc);
+}
+
+/* API FUNCTION:
+   proto rc uuid_import(ctx, fmt, data)
+   $rc = uuid_import($ctx, $fmt, $data);
+   import UUID from variable */
+PHP_FUNCTION(uuid_import)
+{
+    zval *z_ctx;
+    ctx_t *ctx;
+    long z_fmt;
+    unsigned long fmt;
+    zval *z_data;
+    uuid_rc_t rc;
+    void *data_ptr;
+    size_t data_len;
+
+    /* parse parameters */
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;rls&quot;, &amp;z_ctx, &amp;z_fmt, &amp;data_ptr, &amp;data_len) == FAILURE)
+        RETURN_LONG((long)UUID_RC_ARG);
+
+    /* post-process and sanity check parameters */
+    ZEND_FETCH_RESOURCE(ctx, ctx_t *, &amp;z_ctx, -1, ctx_name, ctx_id);
+    if (ctx == NULL || ctx-&gt;uuid == NULL) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_import: invalid context&quot;);
+        RETURN_LONG((long)UUID_RC_ARG);
+    }
+    fmt = (unsigned long)z_fmt;
+
+    /* perform operation */
+    if ((rc = uuid_import(ctx-&gt;uuid, fmt, data_ptr, data_len)) != UUID_RC_OK) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_import: %s&quot;, uuid_error(rc));
+        RETURN_LONG((long)rc);
+    }
+
+    RETURN_LONG((long)rc);
+}
+
+/* API FUNCTION:
+   proto rc uuid_export(ctx, fmt, data)
+   $rc = uuid_error($ctx, $fmt, &amp;$data);
+   export UUID into variable */
+PHP_FUNCTION(uuid_export)
+{
+    zval *z_ctx;
+    ctx_t *ctx;
+    long z_fmt;
+    unsigned long fmt;
+    zval *z_data;
+    uuid_rc_t rc;
+    void *data_ptr;
+    size_t data_len;
+
+    /* parse parameters */
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;rlz&quot;, &amp;z_ctx, &amp;z_fmt, &amp;z_data) == FAILURE)
+        RETURN_LONG((long)UUID_RC_ARG);
+
+    /* post-process and sanity check parameters */
+    ZEND_FETCH_RESOURCE(ctx, ctx_t *, &amp;z_ctx, -1, ctx_name, ctx_id);
+    if (ctx == NULL || ctx-&gt;uuid == NULL) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_export: invalid context&quot;);
+        RETURN_LONG((long)UUID_RC_ARG);
+    }
+    fmt = (unsigned long)z_fmt;
+    if (!PZVAL_IS_REF(z_data)) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_export: data parameter wasn't passed by reference&quot;);
+        RETURN_LONG((long)UUID_RC_ARG);
+    }
+
+    /* perform operation */
+    data_ptr = NULL;
+    data_len = 0;
+    if ((rc = uuid_export(ctx-&gt;uuid, fmt, &amp;data_ptr, &amp;data_len)) != UUID_RC_OK) {
+        php_error_docref(NULL TSRMLS_CC, E_WARNING, &quot;uuid_export: %s&quot;, uuid_error(rc));
+        RETURN_LONG((long)rc);
+    }
+    if (fmt == UUID_FMT_SIV)
+        data_len = strlen((char *)data_ptr);
+    else if (fmt == UUID_FMT_STR || fmt == UUID_FMT_TXT)
+        data_len--; /* PHP doesn't wish NUL-termination on strings */
+    ZVAL_STRINGL(z_data, data_ptr, data_len, 1);
+    free(data_ptr);
+
+    RETURN_LONG((long)rc);
+}
+
+/* API FUNCTION:
+   proto rc uuid_error(ctx)
+   $error = uuid_error($rc);
+   return error string corresponding to error return code */
+PHP_FUNCTION(uuid_error)
+{
+    int z_rc;
+    uuid_rc_t rc;
+    char *error;
+
+    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, &quot;l&quot;, &amp;z_rc) == FAILURE)
+        RETURN_NULL();
+    rc = (uuid_rc_t)z_rc;
+    if ((error = uuid_error(rc)) == NULL)
+        RETURN_NULL();
+    RETURN_STRING(error, 1);
+}
+
+/* API FUNCTION:
+   proto int uuid_version()
+   $version = uuid_version();
+   return library version number */
+PHP_FUNCTION(uuid_version)
+{
+    RETURN_LONG((long)uuid_version());
+}
+
+/* module function table */
+static function_entry uuid_functions[] = {
+    PHP_FE(uuid_create,  NULL)
+    PHP_FE(uuid_destroy, NULL)
+    PHP_FE(uuid_clone,   NULL)
+    PHP_FE(uuid_load,    NULL)
+    PHP_FE(uuid_make,    NULL)
+    PHP_FE(uuid_isnil,   NULL)
+    PHP_FE(uuid_compare, NULL)
+    PHP_FE(uuid_import,  NULL)
+    PHP_FE(uuid_export,  NULL)
+    PHP_FE(uuid_error,   NULL)
+    PHP_FE(uuid_version, NULL)
+    { NULL, NULL, NULL }
+};
+
+/* module entry table */
+zend_module_entry uuid_module_entry = {
+    STANDARD_MODULE_HEADER,
+    &quot;uuid&quot;,
+    uuid_functions,
+    PHP_MINIT(uuid),
+    PHP_MSHUTDOWN(uuid),
+    NULL,
+    NULL,
+    PHP_MINFO(uuid),
+    NO_VERSION_YET,
+    STANDARD_MODULE_PROPERTIES
+};
+
+#ifdef COMPILE_DL_UUID
+ZEND_GET_MODULE(uuid)
+#endif
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidphpuuidphp4"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/php/uuid.php4 (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/php/uuid.php4                                (rev 0)
+++ freeswitch/trunk/libs/uuid/php/uuid.php4        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,78 @@
</span><ins>+&lt;?php
+##
+##  OSSP uuid - Universally Unique Identifier
+##  Copyright (c) 2004-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+##  Copyright (c) 2004-2007 The OSSP Project &lt;http://www.ossp.org/&gt;
+##
+##  This file is part of OSSP uuid, a library for the generation
+##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+##  uuid.php: PHP/Zend API (language: php 4.x)
+##
+
+class UUID {
+    var $uuid = null;
+    function UUID() {
+        uuid_create(&amp;$this-&gt;uuid);
+    }
+    function clone() {
+        $clone = new UUID;
+        uuid_clone($this-&gt;uuid, &amp;$clone-&gt;uuid);
+        return $clone;
+    }
+    function load($name) {
+        uuid_load($this-&gt;uuid, $name);
+    }
+    function make($fmt, $ns = null, $url = null) {
+        if (func_num_args() == 3) {
+            uuid_make($this-&gt;uuid, $fmt, $ns-&gt;uuid, $url);
+        }
+        else {
+            uuid_make($this-&gt;uuid, $fmt);
+        }
+    }
+    function isnil() {
+        $result = 0;
+        uuid_isnil($this-&gt;uuid, &amp;$result);
+        return $result;
+    }
+    function compare($other) {
+        $result = 0;
+        uuid_compare($this-&gt;uuid, $other-&gt;uuid, &amp;$result);
+        return $result;
+    }
+    function import($fmt, $data) {
+        uuid_import($this-&gt;uuid, $fmt, $data);
+    }
+    function export($fmt) {
+        $data = &quot;&quot;;
+        uuid_export($this-&gt;uuid, $fmt, &amp;$data);
+        return $data;
+    }
+    function error($rc) {
+        return uuid_error($this-&gt;uuid, $rc);
+    }
+    function version() {
+        return uuid_version();
+    }
+}
+
+?&gt;
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidphpuuidphp5"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/php/uuid.php5 (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/php/uuid.php5                                (rev 0)
+++ freeswitch/trunk/libs/uuid/php/uuid.php5        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,81 @@
</span><ins>+&lt;?php
+##
+##  OSSP uuid - Universally Unique Identifier
+##  Copyright (c) 2004-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+##  Copyright (c) 2004-2007 The OSSP Project &lt;http://www.ossp.org/&gt;
+##
+##  This file is part of OSSP uuid, a library for the generation
+##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+##  uuid.php: PHP/Zend API (language: php 5.x)
+##
+
+class UUID {
+    private $uuid = null;
+    public function __construct() {
+        uuid_create(&amp;$this-&gt;uuid);
+    }
+    public function __destruct() {
+        uuid_destroy($this-&gt;uuid);
+    }
+    public function __clone() {
+        $uuid = null;
+        uuid_clone($this-&gt;uuid, &amp;$uuid);
+        $this-&gt;uuid = $uuid;
+    }
+    public function load($name) {
+        uuid_load($this-&gt;uuid, $name);
+    }
+    public function make($fmt, $ns = null, $url = null) {
+        if (func_num_args() == 3) {
+            uuid_make($this-&gt;uuid, $fmt, $ns-&gt;uuid, $url);
+        }
+        else {
+            uuid_make($this-&gt;uuid, $fmt);
+        }
+    }
+    public function isnil() {
+        $result = 0;
+        uuid_isnil($this-&gt;uuid, &amp;$result);
+        return $result;
+    }
+    public function compare($other) {
+        $result = 0;
+        uuid_compare($this-&gt;uuid, $other-&gt;uuid, &amp;$result);
+        return $result;
+    }
+    public function import($fmt, $data) {
+        uuid_import($this-&gt;uuid, $fmt, $data);
+    }
+    public function export($fmt) {
+        $data = &quot;&quot;;
+        uuid_export($this-&gt;uuid, $fmt, &amp;$data);
+        return $data;
+    }
+    public function error($rc) {
+        return uuid_error($this-&gt;uuid, $rc);
+    }
+    public function version() {
+        return uuid_version();
+    }
+}
+
+?&gt;
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidphpuuidts"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/php/uuid.ts (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/php/uuid.ts                                (rev 0)
+++ freeswitch/trunk/libs/uuid/php/uuid.ts        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,161 @@
</span><ins>+&lt;?php
+##
+##  OSSP uuid - Universally Unique Identifier
+##  Copyright (c) 2004-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+##  Copyright (c) 2004-2007 The OSSP Project &lt;http://www.ossp.org/&gt;
+##
+##  This file is part of OSSP uuid, a library for the generation
+##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+##  uuid.ts: PHP/Zend API test procedure (language: php)
+##
+
+##
+##  INITIALIZATION
+##
+
+$php_version = $argv[1];
+
+print &quot;++ loading DSO uuid.so (low-level API)\n&quot;;
+if (!extension_loaded('uuid')) {
+    dl('modules/uuid.so');
+}
+
+print &quot;++ loading PHP uuid.php${php_version} (high-level API)\n&quot;;
+require &quot;uuid.php${php_version}&quot;;
+
+print &quot;++ establishing assertion environment\n&quot;;
+assert_options(ASSERT_ACTIVE, 1);
+assert_options(ASSERT_WARNING, 0);
+assert_options(ASSERT_QUIET_EVAL, 1);
+function my_assert_handler($file, $line, $code)
+{
+    echo &quot;ASSERTION FAILED: $file: $line: $code\n&quot;;
+    exit(1);
+}
+assert_options(ASSERT_CALLBACK, 'my_assert_handler');
+
+##
+##  LOW-LEVEL API TESTING
+##
+
+print &quot;++ testing low-level C-style API:\n&quot;;
+
+$uuid = 42;
+$rc = uuid_create(&amp;$uuid);
+assert('$rc == 0');
+assert('$uuid != 42');
+
+$rc = uuid_make($uuid, UUID_MAKE_V1);
+assert('$rc == 0');
+
+$str = &quot;foo&quot;;
+$rc = uuid_export($uuid, UUID_FMT_STR, &amp;$str);
+assert('$rc == 0');
+assert('$str != &quot;foo&quot;');
+print &quot;UUID: $str\n&quot;;
+
+$uuid_ns = 42;
+$rc = uuid_create(&amp;$uuid_ns);
+assert('$rc == 0');
+
+$rc = uuid_load($uuid_ns, &quot;ns:URL&quot;);
+assert('$rc == 0');
+
+$rc = uuid_make($uuid, UUID_MAKE_V3, $uuid_ns, &quot;http://www.ossp.org/&quot;);
+assert('$rc == 0');
+
+$str = &quot;bar&quot;;
+$rc = uuid_export($uuid, UUID_FMT_STR, &amp;$str);
+assert('$rc == 0');
+assert('$str != &quot;bar&quot;');
+#assert('$str == &quot;02d9e6d5-9467-382e-8f9b-9300a64ac3cd&quot;');
+print &quot;UUID: $str\n&quot;;
+
+$rc = uuid_destroy($uuid);
+assert('$rc == 0');
+
+$rc = uuid_create(&amp;$uuid);
+assert('$rc == 0');
+
+$rc = uuid_import($uuid, UUID_FMT_STR, $str);
+assert('$rc == 0');
+
+$str = &quot;baz&quot;;
+$rc = uuid_export($uuid, UUID_FMT_STR, &amp;$str);
+assert('$rc == 0');
+assert('$str != &quot;baz&quot;');
+#assert('$str == &quot;02d9e6d5-9467-382e-8f9b-9300a64ac3cd&quot;');
+print &quot;UUID: $str\n&quot;;
+
+$clone = null;
+$rc = uuid_clone($uuid, &amp;$clone);
+assert('$rc == 0');
+assert('$clone != null');
+
+$rc = uuid_destroy($uuid);
+assert('$rc == 0');
+
+$str = &quot;quux&quot;;
+$rc = uuid_export($clone, UUID_FMT_STR, &amp;$str);
+assert('$rc == 0');
+assert('$str != &quot;quux&quot;');
+#assert('$str == &quot;02d9e6d5-9467-382e-8f9b-9300a64ac3cd&quot;');
+print &quot;UUID: $str\n&quot;;
+
+##
+##  HIGH-LEVEL API TESTING
+##
+
+print &quot;++ testing high-level OO-style API:\n&quot;;
+
+$uuid = new UUID;
+$uuid-&gt;make(UUID_MAKE_V1);
+$str = $uuid-&gt;export(UUID_FMT_STR);
+print &quot;UUID: $str\n&quot;;
+
+$uuid_ns = new UUID;
+$uuid_ns-&gt;load(&quot;ns:URL&quot;);
+$uuid-&gt;make(UUID_MAKE_V3, $uuid_ns, &quot;http://www.ossp.org/&quot;);
+$str = $uuid-&gt;export(UUID_FMT_STR);
+print &quot;UUID: $str\n&quot;;
+$uuid = null;
+$uuid_ns = null;
+
+$uuid = new UUID;
+$uuid-&gt;import(UUID_FMT_STR, $str);
+$str = $uuid-&gt;export(UUID_FMT_STR);
+print &quot;UUID: $str\n&quot;;
+
+if ($php_version == 4) {
+    eval('$clone = $uuid-&gt;clone();');
+}
+else {
+    eval('$clone = clone $uuid;');
+}
+$uuid = null;
+
+$str = $clone-&gt;export(UUID_FMT_STR);
+print &quot;UUID: $str\n&quot;;
+
+$clone = null;
+
+?&gt;
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuidshtool"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/shtool (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/shtool                                (rev 0)
+++ freeswitch/trunk/libs/uuid/shtool        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,4007 @@
</span><ins>+#!/bin/sh
+##
+##  GNU shtool -- The GNU Portable Shell Tool
+##  Copyright (c) 1994-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+##
+##  See http://www.gnu.org/software/shtool/ for more information.
+##  See ftp://ftp.gnu.org/gnu/shtool/ for latest version.
+##
+##  Version:  2.0.7 (19-May-2007)
+##  Contents: all available modules
+##
+
+##
+##  This program is free software; you can redistribute it and/or modify
+##  it under the terms of the GNU General Public License as published by
+##  the Free Software Foundation; either version 2 of the License, or
+##  (at your option) any later version.
+##
+##  This program is distributed in the hope that it will be useful,
+##  but WITHOUT ANY WARRANTY; without even the implied warranty of
+##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+##  General Public License for more details.
+##
+##  You should have received a copy of the GNU General Public License
+##  along with this program; if not, write to the Free Software
+##  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+##  USA, or contact Ralf S. Engelschall &lt;rse@engelschall.com&gt;.
+##
+##  NOTICE: Given that you include this file verbatim into your own
+##  source tree, you are justified in saying that it remains separate
+##  from your package, and that this way you are simply just using GNU
+##  shtool. So, in this situation, there is no requirement that your
+##  package itself is licensed under the GNU General Public License in
+##  order to take advantage of GNU shtool.
+##
+
+##
+##  Usage: shtool [&lt;options&gt;] [&lt;cmd-name&gt; [&lt;cmd-options&gt;] [&lt;cmd-args&gt;]]
+##
+##  Available commands:
+##    echo       Print string with optional construct expansion
+##    mdate      Pretty-print modification time of a file or dir
+##    table      Pretty-print a field-separated list as a table
+##    prop       Display progress with a running propeller
+##    move       Move files with simultaneous substitution
+##    install    Install a program, script or datafile
+##    mkdir      Make one or more directories
+##    mkln       Make link with calculation of relative paths
+##    mkshadow   Make a shadow tree through symbolic links
+##    fixperm    Fix file permissions inside a source tree
+##    rotate     Logfile rotation
+##    tarball    Roll distribution tarballs
+##    subst      Apply sed(1) substitution operations
+##    platform   Platform Identification Utility
+##    arx        Extended archive command
+##    slo        Separate linker options by library class
+##    scpp       Sharing C Pre-Processor
+##    version    Maintain a version information file
+##    path       Deal with program paths
+##
+
+#   maximum Bourne-Shell compatibility
+if [ &quot;.$ZSH_VERSION&quot; != . ] &amp;&amp; (emulate sh) &gt;/dev/null 2&gt;&amp;1; then
+    #   reconfigure zsh(1)
+    emulate sh
+    NULLCMD=:
+    alias -g '${1+&quot;$@&quot;}'='&quot;$@&quot;'
+elif [ &quot;.$BASH_VERSION&quot; != . ] &amp;&amp; (set -o posix) &gt;/dev/null 2&gt;&amp;1; then
+    #   reconfigure bash(1)
+    set -o posix
+fi
+
+#   maximum independence of NLS nuisances
+for var in \
+    LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+    LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+    LC_TELEPHONE LC_TIME
+do
+    if (set +x; test -z &quot;`(eval $var=C; export $var) 2&gt;&amp;1`&quot;); then
+        eval $var=C; export $var
+    else
+        unset $var
+    fi
+done
+
+#   initial command line handling
+if [ $# -eq 0 ]; then
+    echo &quot;$0:Error: invalid command line&quot; 1&gt;&amp;2
+    echo &quot;$0:Hint:  run \`$0 -h' for usage&quot; 1&gt;&amp;2
+    exit 1
+fi
+if [ &quot;.$1&quot; = &quot;.-h&quot; ] || [ &quot;.$1&quot; = &quot;.--help&quot; ]; then
+    echo &quot;This is GNU shtool, version 2.0.7 (19-May-2007)&quot;
+    echo 'Copyright (c) 1994-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;'
+    echo 'Report bugs to &lt;bug-shtool@gnu.org&gt;'
+    echo ''
+    echo 'Usage: shtool [&lt;options&gt;] [&lt;cmd-name&gt; [&lt;cmd-options&gt;] [&lt;cmd-args&gt;]]'
+    echo ''
+    echo 'Available global &lt;options&gt;:'
+    echo '  -v, --version   display shtool version information'
+    echo '  -h, --help      display shtool usage help page (this one)'
+    echo '  -d, --debug     display shell trace information'
+    echo '  -r, --recreate  recreate this shtool script via shtoolize'
+    echo ''
+    echo 'Available &lt;cmd-name&gt; [&lt;cmd-options&gt;] [&lt;cmd-args&gt;]:'
+    echo '  echo     [-n|--newline] [-e|--expand] [&lt;string&gt; ...]'
+    echo '  mdate    [-n|--newline] [-z|--zero] [-s|--shorten] [-d|--digits]'
+    echo '           [-f|--field-sep &lt;str&gt;] [-o|--order &lt;spec&gt;] &lt;path&gt;'
+    echo '  table    [-F|--field-sep &lt;sep&gt;] [-w|--width &lt;width&gt;] [-c|--columns'
+    echo '           &lt;cols&gt;] [-s|--strip &lt;strip&gt;] &lt;str&gt;&lt;sep&gt;&lt;str&gt;...'
+    echo '  prop     [-p|--prefix &lt;str&gt;]'
+    echo '  move     [-v|--verbose] [-t|--trace] [-e|--expand] [-p|--preserve]'
+    echo '           &lt;src-file&gt; &lt;dst-file&gt;'
+    echo '  install  [-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy]'
+    echo '           [-C|--compare-copy] [-s|--strip] [-m|--mode &lt;mode&gt;]'
+    echo '           [-o|--owner &lt;owner&gt;] [-g|--group &lt;group&gt;] [-e|--exec'
+    echo '           &lt;sed-cmd&gt;] &lt;file&gt; [&lt;file&gt; ...] &lt;path&gt;'
+    echo '  mkdir    [-t|--trace] [-f|--force] [-p|--parents] [-m|--mode'
+    echo '           &lt;mode&gt;] [-o|--owner &lt;owner&gt;] [-g|--group &lt;group&gt;] &lt;dir&gt;'
+    echo '           [&lt;dir&gt; ...]'
+    echo '  mkln     [-t|--trace] [-f|--force] [-s|--symbolic] &lt;src-path&gt;'
+    echo '           [&lt;src-path&gt; ...] &lt;dst-path&gt;'
+    echo '  mkshadow [-v|--verbose] [-t|--trace] [-a|--all] &lt;src-dir&gt; &lt;dst-dir&gt;'
+    echo '  fixperm  [-v|--verbose] [-t|--trace] &lt;path&gt; [&lt;path&gt; ...]'
+    echo '  rotate   [-v|--verbose] [-t|--trace] [-f|--force] [-n|--num-files'
+    echo '           &lt;count&gt;] [-s|--size &lt;size&gt;] [-c|--copy] [-r|--remove]'
+    echo '           [-a|--archive-dir &lt;dir&gt;] [-z|--compress [&lt;tool&gt;:]&lt;level&gt;]'
+    echo '           [-b|--background] [-d|--delay] [-p|--pad &lt;len&gt;] [-m|--mode'
+    echo '           &lt;mode&gt;] [-o|--owner &lt;owner&gt;] [-g|--group &lt;group&gt;] [-M|--migrate'
+    echo '           &lt;cmd&gt;] [-P|--prolog &lt;cmd&gt;] [-E|--epilog &lt;cmd&gt;] &lt;file&gt; [...]'
+    echo '  tarball  [-t|--trace] [-v|--verbose] [-o|--output &lt;tarball&gt;]'
+    echo '           [-c|--compress &lt;prog&gt;] [-d|--directory &lt;dir&gt;] [-u|--user'
+    echo '           &lt;user&gt;] [-g|--group &lt;group&gt;] [-e|--exclude &lt;pattern&gt;]'
+    echo '           &lt;path&gt; [&lt;path&gt; ...]'
+    echo '  subst    [-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning]'
+    echo '           [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup'
+    echo '           &lt;ext&gt;] [-e|--exec &lt;cmd&gt;] [-f|--file &lt;cmd-file&gt;] [&lt;file&gt;]'
+    echo '           [...]'
+    echo '  platform [-F|--format &lt;format&gt;] [-S|--sep &lt;string&gt;] [-C|--conc'
+    echo '           &lt;string&gt;] [-L|--lower] [-U|--upper] [-v|--verbose]'
+    echo '           [-c|--concise] [-n|--no-newline] [-t|--type &lt;type&gt;]'
+    echo '           [-V|--version] [-h|--help]'
+    echo '  arx      [-t|--trace] [-C|--command &lt;cmd&gt;] &lt;op&gt; &lt;archive&gt; [&lt;file&gt;'
+    echo '           ...]'
+    echo '  slo      [-p|--prefix &lt;str&gt;] -- -L&lt;dir&gt; -l&lt;lib&gt; [-L&lt;dir&gt; -l&lt;lib&gt;'
+    echo '           ...]'
+    echo '  scpp     [-v|--verbose] [-p|--preserve] [-f|--filter &lt;filter&gt;]'
+    echo '           [-o|--output &lt;ofile&gt;] [-t|--template &lt;tfile&gt;] [-M|--mark'
+    echo '           &lt;mark&gt;] [-D|--define &lt;dname&gt;] [-C|--class &lt;cname&gt;]'
+    echo '           &lt;file&gt; [&lt;file&gt; ...]'
+    echo '  version  [-l|--language &lt;lang&gt;] [-n|--name &lt;name&gt;] [-p|--prefix'
+    echo '           &lt;prefix&gt;] [-s|--set &lt;version&gt;] [-e|--edit] [-i|--increase'
+    echo '           &lt;knob&gt;] [-d|--display &lt;type&gt;] &lt;file&gt;'
+    echo '  path     [-s|--suppress] [-r|--reverse] [-d|--dirname] [-b|--basename]'
+    echo '           [-m|--magic] [-p|--path &lt;path&gt;] &lt;str&gt; [&lt;str&gt; ...]'
+    echo ''
+    exit 0
+fi
+if [ &quot;.$1&quot; = &quot;.-v&quot; ] || [ &quot;.$1&quot; = &quot;.--version&quot; ]; then
+    echo &quot;GNU shtool 2.0.7 (19-May-2007)&quot;
+    exit 0
+fi
+if [ &quot;.$1&quot; = &quot;.-r&quot; ] || [ &quot;.$1&quot; = &quot;.--recreate&quot; ]; then
+    shtoolize -oshtool all
+    exit 0
+fi
+if [ &quot;.$1&quot; = &quot;.-d&quot; ] || [ &quot;.$1&quot; = &quot;.--debug&quot; ]; then
+    shift
+    set -x
+fi
+name=`echo &quot;$0&quot; | sed -e 's;.*/\([^/]*\)$;\1;' -e 's;-sh$;;' -e 's;\.sh$;;'`
+case &quot;$name&quot; in
+    echo|mdate|table|prop|move|install|mkdir|mkln|mkshadow|fixperm|rotate|tarball|subst|platform|arx|slo|scpp|version|path )
+        #   implicit tool command selection
+        tool=&quot;$name&quot;
+        ;;
+    * )
+        #   explicit tool command selection
+        tool=&quot;$1&quot;
+        shift
+        ;;
+esac
+arg_spec=&quot;&quot;
+opt_spec=&quot;&quot;
+gen_tmpfile=no
+
+##
+##  DISPATCH INTO SCRIPT PROLOG
+##
+
+case $tool in
+    echo )
+        str_tool=&quot;echo&quot;
+        str_usage=&quot;[-n|--newline] [-e|--expand] [&lt;string&gt; ...]&quot;
+        arg_spec=&quot;0+&quot;
+        opt_spec=&quot;n.e.&quot;
+        opt_alias=&quot;n:newline,e:expand&quot;
+        opt_n=no
+        opt_e=no
+        ;;
+    mdate )
+        str_tool=&quot;mdate&quot;
+        str_usage=&quot;[-n|--newline] [-z|--zero] [-s|--shorten] [-d|--digits] [-f|--field-sep &lt;str&gt;] [-o|--order &lt;spec&gt;] &lt;path&gt;&quot;
+        arg_spec=&quot;1=&quot;
+        opt_spec=&quot;n.z.s.d.f:o:&quot;
+        opt_alias=&quot;n:newline,z:zero,s:shorten,d:digits,f:field-sep,o:order&quot;
+        opt_n=no
+        opt_z=no
+        opt_s=no
+        opt_d=no
+        opt_f=&quot; &quot;
+        opt_o=&quot;dmy&quot;
+        ;;
+    table )
+        str_tool=&quot;table&quot;
+        str_usage=&quot;[-F|--field-sep &lt;sep&gt;] [-w|--width &lt;width&gt;] [-c|--columns &lt;cols&gt;] [-s|--strip &lt;strip&gt;] &lt;str&gt;&lt;sep&gt;&lt;str&gt;...&quot;
+        arg_spec=&quot;1+&quot;
+        opt_spec=&quot;F:w:c:s:&quot;
+        opt_alias=&quot;F:field-sep,w:width,c:columns,s:strip&quot;
+        opt_F=&quot;:&quot;
+        opt_w=15
+        opt_c=3
+        opt_s=79
+        ;;
+    prop )
+        str_tool=&quot;prop&quot;
+        str_usage=&quot;[-p|--prefix &lt;str&gt;]&quot;
+        arg_spec=&quot;0=&quot;
+        opt_spec=&quot;p:&quot;
+        opt_alias=&quot;p:prefix&quot;
+        opt_p=&quot;&quot;
+        ;;
+    move )
+        str_tool=&quot;move&quot;
+        str_usage=&quot;[-v|--verbose] [-t|--trace] [-e|--expand] [-p|--preserve] &lt;src-file&gt; &lt;dst-file&gt;&quot;
+        arg_spec=&quot;2=&quot;
+        opt_spec=&quot;v.t.e.p.&quot;
+        opt_alias=&quot;v:verbose,t:trace,e:expand,p:preserve&quot;
+        opt_v=no
+        opt_t=no
+        opt_e=no
+        opt_p=no
+        ;;
+    install )
+        str_tool=&quot;install&quot;
+        str_usage=&quot;[-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy] [-C|--compare-copy] [-s|--strip] [-m|--mode &lt;mode&gt;] [-o|--owner &lt;owner&gt;] [-g|--group &lt;group&gt;] [-e|--exec &lt;sed-cmd&gt;] &lt;file&gt; [&lt;file&gt; ...] &lt;path&gt;&quot;
+        arg_spec=&quot;1+&quot;
+        opt_spec=&quot;v.t.d.c.C.s.m:o:g:e+&quot;
+        opt_alias=&quot;v:verbose,t:trace,d:mkdir,c:copy,C:compare-copy,s:strip,m:mode,o:owner,g:group,e:exec&quot;
+        opt_v=no
+        opt_t=no
+        opt_d=no
+        opt_c=no
+        opt_C=no
+        opt_s=no
+        opt_m=&quot;0755&quot;
+        opt_o=&quot;&quot;
+        opt_g=&quot;&quot;
+        opt_e=&quot;&quot;
+        ;;
+    mkdir )
+        str_tool=&quot;mkdir&quot;
+        str_usage=&quot;[-t|--trace] [-f|--force] [-p|--parents] [-m|--mode &lt;mode&gt;] [-o|--owner &lt;owner&gt;] [-g|--group &lt;group&gt;] &lt;dir&gt; [&lt;dir&gt; ...]&quot;
+        arg_spec=&quot;1+&quot;
+        opt_spec=&quot;t.f.p.m:o:g:&quot;
+        opt_alias=&quot;t:trace,f:force,p:parents,m:mode,o:owner,g:group&quot;
+        opt_t=no
+        opt_f=no
+        opt_p=no
+        opt_m=&quot;&quot;
+        opt_o=&quot;&quot;
+        opt_g=&quot;&quot;
+        ;;
+    mkln )
+        str_tool=&quot;mkln&quot;
+        str_usage=&quot;[-t|--trace] [-f|--force] [-s|--symbolic] &lt;src-path&gt; [&lt;src-path&gt; ...] &lt;dst-path&gt;&quot;
+        arg_spec=&quot;2+&quot;
+        opt_spec=&quot;t.f.s.&quot;
+        opt_alias=&quot;t:trace,f:force,s:symbolic&quot;
+        opt_t=no
+        opt_f=no
+        opt_s=no
+        ;;
+    mkshadow )
+        str_tool=&quot;mkshadow&quot;
+        str_usage=&quot;[-v|--verbose] [-t|--trace] [-a|--all] &lt;src-dir&gt; &lt;dst-dir&gt;&quot;
+        arg_spec=&quot;2=&quot;
+        opt_spec=&quot;v.t.a.&quot;
+        opt_alias=&quot;v:verbose,t:trace,a:all&quot;
+        opt_v=no
+        opt_t=no
+        opt_a=no
+        ;;
+    fixperm )
+        str_tool=&quot;fixperm&quot;
+        str_usage=&quot;[-v|--verbose] [-t|--trace] &lt;path&gt; [&lt;path&gt; ...]&quot;
+        arg_spec=&quot;1+&quot;
+        opt_spec=&quot;v.t.&quot;
+        opt_alias=&quot;v:verbose,t:trace&quot;
+        opt_v=no
+        opt_t=no
+        ;;
+    rotate )
+        str_tool=&quot;rotate&quot;
+        str_usage=&quot;[-v|--verbose] [-t|--trace] [-f|--force] [-n|--num-files &lt;count&gt;] [-s|--size &lt;size&gt;] [-c|--copy] [-r|--remove] [-a|--archive-dir &lt;dir&gt;] [-z|--compress [&lt;tool&gt;:]&lt;level&gt;] [-b|--background] [-d|--delay] [-p|--pad &lt;len&gt;] [-m|--mode &lt;mode&gt;] [-o|--owner &lt;owner&gt;] [-g|--group &lt;group&gt;] [-M|--migrate &lt;cmd&gt;] [-P|--prolog &lt;cmd&gt;] [-E|--epilog &lt;cmd&gt;] &lt;file&gt; [...]&quot;
+        arg_spec=&quot;1+&quot;
+        opt_spec=&quot;v.t.f.n:s:c.r.a:z:b.d.p:o:g:m:M:P:E:&quot;
+        opt_alias=&quot;v:verbose,t:trace,f:force,n:num-files,s:size,c:copy,r:remove,a:archive-dir,z:compress,b:background,d:delay,p:pad,o:owner,g:group,m:mode,M:migrate,P:prolog,E:epilog&quot;
+        opt_v=no
+        opt_t=no
+        opt_f=no
+        opt_n=10
+        opt_s=&quot;&quot;
+        opt_c=no
+        opt_r=no
+        opt_a=&quot;&quot;
+        opt_z=&quot;&quot;
+        opt_b=no
+        opt_d=no
+        opt_p=1
+        opt_o=&quot;&quot;
+        opt_g=&quot;&quot;
+        opt_m=&quot;&quot;
+        opt_M=&quot;&quot;
+        opt_P=&quot;&quot;
+        opt_E=&quot;&quot;
+        ;;
+    tarball )
+        str_tool=&quot;tarball&quot;
+        str_usage=&quot;[-t|--trace] [-v|--verbose] [-o|--output &lt;tarball&gt;] [-c|--compress &lt;prog&gt;] [-d|--directory &lt;dir&gt;] [-u|--user &lt;user&gt;] [-g|--group &lt;group&gt;] [-e|--exclude &lt;pattern&gt;] &lt;path&gt; [&lt;path&gt; ...]&quot;
+        gen_tmpfile=yes
+        arg_spec=&quot;1+&quot;
+        opt_spec=&quot;t.v.o:c:d:u:g:e:&quot;
+        opt_alias=&quot;t:trace,v:verbose,o:output,c:compress,d:directory,u:user,g:group,e:exclude&quot;
+        opt_t=no
+        opt_v=no
+        opt_o=&quot;&quot;
+        opt_c=&quot;&quot;
+        opt_d=&quot;&quot;
+        opt_u=&quot;&quot;
+        opt_g=&quot;&quot;
+        opt_e=&quot;CVS,\\.cvsignore,\\.svn,\\.[oa]\$&quot;
+        ;;
+    subst )
+        str_tool=&quot;subst&quot;
+        str_usage=&quot;[-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning] [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup &lt;ext&gt;] [-e|--exec &lt;cmd&gt;] [-f|--file &lt;cmd-file&gt;] [&lt;file&gt;] [...]&quot;
+        gen_tmpfile=yes
+        arg_spec=&quot;0+&quot;
+        opt_spec=&quot;v.t.n.w.q.s.i.b:e+f:&quot;
+        opt_alias=&quot;v:verbose,t:trace,n:nop,w:warning,q:quiet,s:stealth,i:interactive,b:backup,e:exec,f:file&quot;
+        opt_v=no
+        opt_t=no
+        opt_n=no
+        opt_w=no
+        opt_q=no
+        opt_s=no
+        opt_i=no
+        opt_b=&quot;&quot;
+        opt_e=&quot;&quot;
+        opt_f=&quot;&quot;
+        ;;
+    platform )
+        str_tool=&quot;platform&quot;
+        str_usage=&quot;[-F|--format &lt;format&gt;] [-S|--sep &lt;string&gt;] [-C|--conc &lt;string&gt;] [-L|--lower] [-U|--upper] [-v|--verbose] [-c|--concise] [-n|--no-newline] [-t|--type &lt;type&gt;] [-V|--version] [-h|--help]&quot;
+        arg_spec=&quot;0=&quot;
+        opt_spec=&quot;F:S:C:L.U.v.c.n.t:d.V.h.&quot;
+        opt_alias=&quot;F:format,S:sep,C:conc,L:lower,U:upper,v:verbose,c:consise,t:type,n:no-newline,V:version,h:help&quot;
+        opt_F=&quot;%{sp} (%{ap})&quot;
+        opt_S=&quot; &quot;
+        opt_C=&quot;/&quot;
+        opt_L=no
+        opt_U=no
+        opt_t=&quot;&quot;
+        opt_v=no
+        opt_c=no
+        opt_n=no
+        opt_V=no
+        opt_h=no
+        ;;
+    arx )
+        str_tool=&quot;arx&quot;
+        str_usage=&quot;[-t|--trace] [-C|--command &lt;cmd&gt;] &lt;op&gt; &lt;archive&gt; [&lt;file&gt; ...]&quot;
+        arg_spec=&quot;2+&quot;
+        opt_spec=&quot;t.C:&quot;
+        opt_alias=&quot;t:trace,C:command&quot;
+        opt_t=no
+        opt_C=&quot;ar&quot;
+        ;;
+    slo )
+        str_tool=&quot;slo&quot;
+        str_usage=&quot;[-p|--prefix &lt;str&gt;] -- -L&lt;dir&gt; -l&lt;lib&gt; [-L&lt;dir&gt; -l&lt;lib&gt; ...]&quot;
+        arg_spec=&quot;1+&quot;
+        opt_spec=&quot;p:&quot;
+        opt_alias=&quot;p:prefix&quot;
+        opt_p=&quot;SLO_&quot;
+        ;;
+    scpp )
+        str_tool=&quot;scpp&quot;
+        str_usage=&quot;[-v|--verbose] [-p|--preserve] [-f|--filter &lt;filter&gt;] [-o|--output &lt;ofile&gt;] [-t|--template &lt;tfile&gt;] [-M|--mark &lt;mark&gt;] [-D|--define &lt;dname&gt;] [-C|--class &lt;cname&gt;] &lt;file&gt; [&lt;file&gt; ...]&quot;
+        gen_tmpfile=yes
+        arg_spec=&quot;1+&quot;
+        opt_spec=&quot;v.p.f+o:t:M:D:C:&quot;
+        opt_alias=&quot;v:verbose,p:preserve,f:filter,o:output,t:template,M:mark,D:define,C:class&quot;
+        opt_v=no
+        opt_p=no
+        opt_f=&quot;&quot;
+        opt_o=&quot;lib.h&quot;
+        opt_t=&quot;lib.h.in&quot;
+        opt_M=&quot;%%MARK%%&quot;
+        opt_D=&quot;cpp&quot;
+        opt_C=&quot;intern&quot;
+        ;;
+    version )
+        str_tool=&quot;version&quot;
+        str_usage=&quot;[-l|--language &lt;lang&gt;] [-n|--name &lt;name&gt;] [-p|--prefix &lt;prefix&gt;] [-s|--set &lt;version&gt;] [-e|--edit] [-i|--increase &lt;knob&gt;] [-d|--display &lt;type&gt;] &lt;file&gt;&quot;
+        arg_spec=&quot;1=&quot;
+        opt_spec=&quot;l:n:p:s:i:e.d:&quot;
+        opt_alias=&quot;l:language,n:name,p:prefix,s:set,e:edit,i:increase,d:display&quot;
+        opt_l=&quot;txt&quot;
+        opt_n=&quot;unknown&quot;
+        opt_p=&quot;&quot;
+        opt_s=&quot;&quot;
+        opt_e=&quot;no&quot;
+        opt_i=&quot;&quot;
+        opt_d=&quot;short&quot;
+        ;;
+    path )
+        str_tool=&quot;path&quot;
+        str_usage=&quot;[-s|--suppress] [-r|--reverse] [-d|--dirname] [-b|--basename] [-m|--magic] [-p|--path &lt;path&gt;] &lt;str&gt; [&lt;str&gt; ...]&quot;
+        gen_tmpfile=yes
+        arg_spec=&quot;1+&quot;
+        opt_spec=&quot;s.r.d.b.m.p:&quot;
+        opt_alias=&quot;s:suppress,r:reverse,d:dirname,b:basename,m:magic,p:path&quot;
+        opt_s=no
+        opt_r=no
+        opt_d=no
+        opt_b=no
+        opt_m=no
+        opt_p=&quot;$PATH&quot;
+        ;;
+    -* )
+        echo &quot;$0:Error: unknown option \`$tool'&quot; 2&gt;&amp;1
+        echo &quot;$0:Hint:  run \`$0 -h' for usage&quot; 2&gt;&amp;1
+        exit 1
+        ;;
+    * )
+        echo &quot;$0:Error: unknown command \`$tool'&quot; 2&gt;&amp;1
+        echo &quot;$0:Hint:  run \`$0 -h' for usage&quot; 2&gt;&amp;1
+        exit 1
+        ;;
+esac
+
+##
+##  COMMON UTILITY CODE
+##
+
+#   commonly used ASCII values
+ASC_TAB=&quot;        &quot;
+ASC_NL=&quot;
+&quot;
+
+#   determine name of tool
+if [ &quot;.$tool&quot; != . ]; then
+    #   used inside shtool script
+    toolcmd=&quot;$0 $tool&quot;
+    toolcmdhelp=&quot;shtool $tool&quot;
+    msgprefix=&quot;shtool:$tool&quot;
+else
+    #   used as standalone script
+    toolcmd=&quot;$0&quot;
+    toolcmdhelp=&quot;sh $0&quot;
+    msgprefix=&quot;$str_tool&quot;
+fi
+
+#   parse argument specification string
+eval `echo $arg_spec |\
+      sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'`
+
+#   parse option specification string
+eval `echo h.$opt_spec |\
+      sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'`
+
+#   parse option alias string
+eval `echo h:help,$opt_alias |\
+      sed -e 's/-/_/g' -e 's/\([a-zA-Z0-9]\):\([^,]*\),*/opt_ALIAS_\2=\1;/g'`
+
+#   interate over argument line
+opt_PREV=''
+while [ $# -gt 0 ]; do
+    #   special option stops processing
+    if [ &quot;.$1&quot; = &quot;.--&quot; ]; then
+        shift
+        break
+    fi
+
+    #   determine option and argument
+    opt_ARG_OK=no
+    if [ &quot;.$opt_PREV&quot; != . ]; then
+        #   merge previous seen option with argument
+        opt_OPT=&quot;$opt_PREV&quot;
+        opt_ARG=&quot;$1&quot;
+        opt_ARG_OK=yes
+        opt_PREV=''
+    else
+        #   split argument into option and argument
+        case &quot;$1&quot; in
+            --[a-zA-Z0-9]*=*)
+                eval `echo &quot;x$1&quot; |\
+                      sed -e 's/^x--\([a-zA-Z0-9-]*\)=\(.*\)$/opt_OPT=&quot;\1&quot;;opt_ARG=&quot;\2&quot;/'`
+                opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'`
+                eval &quot;opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}&quot;
+                ;;
+            --[a-zA-Z0-9]*)
+                opt_OPT=`echo &quot;x$1&quot; | cut -c4-`
+                opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'`
+                eval &quot;opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}&quot;
+                opt_ARG=''
+                ;;
+            -[a-zA-Z0-9]*)
+                eval `echo &quot;x$1&quot; |\
+                      sed -e 's/^x-\([a-zA-Z0-9]\)/opt_OPT=&quot;\1&quot;;/' \
+                          -e 's/&quot;;\(.*\)$/&quot;; opt_ARG=&quot;\1&quot;/'`
+                ;;
+            -[a-zA-Z0-9])
+                opt_OPT=`echo &quot;x$1&quot; | cut -c3-`
+                opt_ARG=''
+                ;;
+            *)
+                break
+                ;;
+        esac
+    fi
+
+    #   eat up option
+    shift
+
+    #   determine whether option needs an argument
+    eval &quot;opt_MODE=\$opt_MODE_${opt_OPT}&quot;
+    if [ &quot;.$opt_ARG&quot; = . ] &amp;&amp; [ &quot;.$opt_ARG_OK&quot; != .yes ]; then
+        if [ &quot;.$opt_MODE&quot; = &quot;.:&quot; ] || [ &quot;.$opt_MODE&quot; = &quot;.+&quot; ]; then
+            opt_PREV=&quot;$opt_OPT&quot;
+            continue
+        fi
+    fi
+
+    #   process option
+    case $opt_MODE in
+        '.' )
+            #   boolean option
+            eval &quot;opt_${opt_OPT}=yes&quot;
+            ;;
+        ':' )
+            #   option with argument (multiple occurances override)
+            eval &quot;opt_${opt_OPT}=\&quot;\$opt_ARG\&quot;&quot;
+            ;;
+        '+' )
+            #   option with argument (multiple occurances append)
+            eval &quot;opt_${opt_OPT}=\&quot;\$opt_${opt_OPT}\${ASC_NL}\$opt_ARG\&quot;&quot;
+            ;;
+        * )
+            echo &quot;$msgprefix:Error: unknown option: \`$opt_OPT'&quot; 1&gt;&amp;2
+            echo &quot;$msgprefix:Hint:  run \`$toolcmdhelp -h' or \`man shtool' for details&quot; 1&gt;&amp;2
+            exit 1
+            ;;
+    esac
+done
+if [ &quot;.$opt_PREV&quot; != . ]; then
+    echo &quot;$msgprefix:Error: missing argument to option \`$opt_PREV'&quot; 1&gt;&amp;2
+    echo &quot;$msgprefix:Hint:  run \`$toolcmdhelp -h' or \`man shtool' for details&quot; 1&gt;&amp;2
+    exit 1
+fi
+
+#   process help option
+if [ &quot;.$opt_h&quot; = .yes ]; then
+    echo &quot;Usage: $toolcmdhelp $str_usage&quot;
+    exit 0
+fi
+
+#   complain about incorrect number of arguments
+case $arg_MODE in
+    '=' )
+        if [ $# -ne $arg_NUMS ]; then
+            echo &quot;$msgprefix:Error: invalid number of arguments (exactly $arg_NUMS expected)&quot; 1&gt;&amp;2
+            echo &quot;$msgprefix:Hint:  run \`$toolcmd -h' or \`man shtool' for details&quot; 1&gt;&amp;2
+            exit 1
+        fi
+        ;;
+    '+' )
+        if [ $# -lt $arg_NUMS ]; then
+            echo &quot;$msgprefix:Error: invalid number of arguments (at least $arg_NUMS expected)&quot; 1&gt;&amp;2
+            echo &quot;$msgprefix:Hint:  run \`$toolcmd -h' or \`man shtool' for details&quot; 1&gt;&amp;2
+            exit 1
+        fi
+        ;;
+esac
+
+#   establish a temporary file on request
+if [ &quot;.$gen_tmpfile&quot; = .yes ]; then
+    #   create (explicitly) secure temporary directory
+    if [ &quot;.$TMPDIR&quot; != . ]; then
+        tmpdir=&quot;$TMPDIR&quot;
+    elif [ &quot;.$TEMPDIR&quot; != . ]; then
+        tmpdir=&quot;$TEMPDIR&quot;
+    else
+        tmpdir=&quot;/tmp&quot;
+    fi
+    tmpdir=&quot;$tmpdir/.shtool.$$&quot;
+    ( umask 077
+      rm -rf &quot;$tmpdir&quot; &gt;/dev/null 2&gt;&amp;1 || true
+      mkdir  &quot;$tmpdir&quot; &gt;/dev/null 2&gt;&amp;1
+      if [ $? -ne 0 ]; then
+          echo &quot;$msgprefix:Error: failed to create temporary directory \`$tmpdir'&quot; 1&gt;&amp;2
+          exit 1
+      fi
+    )
+
+    #   create (implicitly) secure temporary file
+    tmpfile=&quot;$tmpdir/shtool.tmp&quot;
+    touch &quot;$tmpfile&quot;
+fi
+
+#   utility function: map string to lower case
+util_lower () {
+    echo &quot;$1&quot; | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'
+}
+
+#   utility function: map string to upper case
+util_upper () {
+    echo &quot;$1&quot; | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+}
+
+#   cleanup procedure
+shtool_exit () {
+    rc=&quot;$1&quot;
+    if [ &quot;.$gen_tmpfile&quot; = .yes ]; then
+        rm -rf &quot;$tmpdir&quot; &gt;/dev/null 2&gt;&amp;1 || true
+    fi
+    exit $rc
+}
+
+##
+##  DISPATCH INTO SCRIPT BODY
+##
+
+case $tool in
+
+echo )
+    ##
+    ##  echo -- Print string with optional construct expansion
+    ##  Copyright (c) 1998-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+    ##
+
+    text=&quot;$*&quot;
+
+    #   check for broken escape sequence expansion
+    seo=''
+    bytes=`echo '\1' | wc -c | awk '{ printf(&quot;%s&quot;, $1); }'`
+    if [ &quot;.$bytes&quot; != .3 ]; then
+        bytes=`echo -E '\1' | wc -c | awk '{ printf(&quot;%s&quot;, $1); }'`
+        if [ &quot;.$bytes&quot; = .3 ]; then
+            seo='-E'
+        fi
+    fi
+
+    #   check for existing -n option (to suppress newline)
+    minusn=''
+    bytes=`echo -n 123 2&gt;/dev/null | wc -c | awk '{ printf(&quot;%s&quot;, $1); }'`
+    if [ &quot;.$bytes&quot; = .3 ]; then
+        minusn='-n'
+    fi
+
+    #   determine terminal bold sequence
+    term_bold=''
+    term_norm=''
+    if [ &quot;.$opt_e&quot; = .yes ] &amp;&amp; [ &quot;.`echo $text | grep '%[Bb]'`&quot; != . ]; then
+        case $TERM in
+            #   for the most important terminal types we directly know the sequences
+            xterm|xterm*|vt220|vt220*)
+                term_bold=`awk 'BEGIN { printf(&quot;%c%c%c%c&quot;, 27, 91, 49, 109); }' &lt;/dev/null 2&gt;/dev/null`
+                term_norm=`awk 'BEGIN { printf(&quot;%c%c%c&quot;, 27, 91, 109); }' &lt;/dev/null 2&gt;/dev/null`
+                ;;
+            vt100|vt100*|cygwin)
+                term_bold=`awk 'BEGIN { printf(&quot;%c%c%c%c%c%c&quot;, 27, 91, 49, 109, 0, 0); }' &lt;/dev/null 2&gt;/dev/null`
+                term_norm=`awk 'BEGIN { printf(&quot;%c%c%c%c%c&quot;, 27, 91, 109, 0, 0); }' &lt;/dev/null 2&gt;/dev/null`
+                ;;
+            #   for all others, we try to use a possibly existing `tput' or `tcout' utility
+            * )
+                paths=`echo $PATH | sed -e 's/:/ /g'`
+                for tool in tput tcout; do
+                    for dir in $paths; do
+                        if [ -r &quot;$dir/$tool&quot; ]; then
+                            for seq in bold md smso; do # 'smso' is last
+                                bold=&quot;`$dir/$tool $seq 2&gt;/dev/null`&quot;
+                                if [ &quot;.$bold&quot; != . ]; then
+                                    term_bold=&quot;$bold&quot;
+                                    break
+                                fi
+                            done
+                            if [ &quot;.$term_bold&quot; != . ]; then
+                                for seq in sgr0 me rmso init reset; do # 'reset' is last
+                                    norm=&quot;`$dir/$tool $seq 2&gt;/dev/null`&quot;
+                                    if [ &quot;.$norm&quot; != . ]; then
+                                        term_norm=&quot;$norm&quot;
+                                        break
+                                    fi
+                                done
+                            fi
+                            break
+                        fi
+                    done
+                    if [ &quot;.$term_bold&quot; != . ] &amp;&amp; [ &quot;.$term_norm&quot; != . ]; then
+                        break;
+                    fi
+                done
+                ;;
+        esac
+        if [ &quot;.$term_bold&quot; = . ] || [ &quot;.$term_norm&quot; = . ]; then
+            echo &quot;$msgprefix:Warning: unable to determine terminal sequence for bold mode&quot; 1&gt;&amp;2
+            term_bold=''
+            term_norm=''
+        fi
+    fi
+
+    #   determine user name
+    username=''
+    if [ &quot;.$opt_e&quot; = .yes ] &amp;&amp; [ &quot;.`echo $text | grep '%[uUgG]'`&quot; != . ]; then
+        username=&quot;`(id -un) 2&gt;/dev/null`&quot;
+        if [ &quot;.$username&quot; = . ]; then
+            str=&quot;`(id) 2&gt;/dev/null`&quot;
+            if [ &quot;.`echo $str | grep '^uid[         ]*=[         ]*[0-9]*('`&quot; != . ]; then
+                username=`echo $str | sed -e 's/^uid[         ]*=[         ]*[0-9]*(//' -e 's/).*$//'`
+            fi
+            if [ &quot;.$username&quot; = . ]; then
+                username=&quot;$LOGNAME&quot;
+                if [ &quot;.$username&quot; = . ]; then
+                    username=&quot;$USER&quot;
+                    if [ &quot;.$username&quot; = . ]; then
+                        username=&quot;`(whoami) 2&gt;/dev/null |\
+                                   awk '{ printf(&quot;%s&quot;, $1); }'`&quot;
+                        if [ &quot;.$username&quot; = . ]; then
+                            username=&quot;`(who am i) 2&gt;/dev/null |\
+                                       awk '{ printf(&quot;%s&quot;, $1); }'`&quot;
+                            if [ &quot;.$username&quot; = . ]; then
+                                username='unknown'
+                            fi
+                        fi
+                    fi
+                fi
+            fi
+        fi
+    fi
+
+    #   determine user id
+    userid=''
+    if [ &quot;.$opt_e&quot; = .yes ] &amp;&amp; [ &quot;.`echo $text | grep '%U'`&quot; != . ]; then
+        userid=&quot;`(id -u) 2&gt;/dev/null`&quot;
+        if [ &quot;.$userid&quot; = . ]; then
+            userid=&quot;`(id -u ${username}) 2&gt;/dev/null`&quot;
+            if [ &quot;.$userid&quot; = . ]; then
+                str=&quot;`(id) 2&gt;/dev/null`&quot;
+                if [ &quot;.`echo $str | grep '^uid[         ]*=[         ]*[0-9]*('`&quot; != . ]; then
+                    userid=`echo $str | sed -e 's/^uid[         ]*=[         ]*//' -e 's/(.*$//'`
+                fi
+                if [ &quot;.$userid&quot; = . ]; then
+                    userid=`(getent passwd ${username}) 2&gt;/dev/null | \
+                            sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
+                    if [ &quot;.$userid&quot; = . ]; then
+                        userid=`grep &quot;^${username}:&quot; /etc/passwd 2&gt;/dev/null | \
+                                sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
+                        if [ &quot;.$userid&quot; = . ]; then
+                            userid=`(ypmatch &quot;${username}&quot; passwd; nismatch &quot;${username}&quot; passwd) 2&gt;/dev/null | \
+                                    sed -e 'q' | sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
+                            if [ &quot;.$userid&quot; = . ]; then
+                                userid=`(nidump passwd . | grep &quot;^${username}:&quot;) 2&gt;/dev/null | \
+                                        sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'`
+                                if [ &quot;.$userid&quot; = . ]; then
+                                    userid='?'
+                                fi
+                            fi
+                        fi
+                    fi
+                fi
+            fi
+        fi
+    fi
+
+    #   determine (primary) group id
+    groupid=''
+    if [ &quot;.$opt_e&quot; = .yes ] &amp;&amp; [ &quot;.`echo $text | grep '%[gG]'`&quot; != . ]; then
+        groupid=&quot;`(id -g ${username}) 2&gt;/dev/null`&quot;
+        if [ &quot;.$groupid&quot; = . ]; then
+            str=&quot;`(id) 2&gt;/dev/null`&quot;
+            if [ &quot;.`echo $str | grep 'gid[         ]*=[         ]*[0-9]*('`&quot; != . ]; then
+                groupid=`echo $str | sed -e 's/^.*gid[         ]*=[         ]*//' -e 's/(.*$//'`
+            fi
+            if [ &quot;.$groupid&quot; = . ]; then
+                groupid=`(getent passwd ${username}) 2&gt;/dev/null | \
+                         sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
+                if [ &quot;.$groupid&quot; = . ]; then
+                    groupid=`grep &quot;^${username}:&quot; /etc/passwd 2&gt;/dev/null | \
+                             sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
+                    if [ &quot;.$groupid&quot; = . ]; then
+                        groupid=`(ypmatch &quot;${username}&quot; passwd; nismatch &quot;${username}&quot; passwd) 2&gt;/dev/null | \
+                                 sed -e 'q' | sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
+                        if [ &quot;.$groupid&quot; = . ]; then
+                            groupid=`(nidump passwd . | grep &quot;^${username}:&quot;) 2&gt;/dev/null | \
+                                     sed -e 's/[^:]*:[^:]*:[^:]*://' -e 's/:.*$//'`
+                            if [ &quot;.$groupid&quot; = . ]; then
+                                groupid='?'
+                            fi
+                        fi
+                    fi
+                fi
+            fi
+        fi
+    fi
+
+    #   determine (primary) group name
+    groupname=''
+    if [ &quot;.$opt_e&quot; = .yes ] &amp;&amp; [ &quot;.`echo $text | grep '%g'`&quot; != . ]; then
+        groupname=&quot;`(id -gn ${username}) 2&gt;/dev/null`&quot;
+        if [ &quot;.$groupname&quot; = . ]; then
+            str=&quot;`(id) 2&gt;/dev/null`&quot;
+            if [ &quot;.`echo $str | grep 'gid[         ]*=[         ]*[0-9]*('`&quot; != . ]; then
+                groupname=`echo $str | sed -e 's/^.*gid[         ]*=[         ]*[0-9]*(//' -e 's/).*$//'`
+            fi
+            if [ &quot;.$groupname&quot; = . ]; then
+                groupname=`(getent group) 2&gt;/dev/null | \
+                           grep &quot;^[^:]*:[^:]*:${groupid}:&quot; | \
+                           sed -e 's/:.*$//'`
+                if [ &quot;.$groupname&quot; = . ]; then
+                    groupname=`grep &quot;^[^:]*:[^:]*:${groupid}:&quot; /etc/group 2&gt;/dev/null | \
+                               sed -e 's/:.*$//'`
+                    if [ &quot;.$groupname&quot; = . ]; then
+                        groupname=`(ypcat group; niscat group) 2&gt;/dev/null | \
+                                   sed -e 'q' | grep &quot;^[^:]*:[^:]*:${groupid}:&quot; | \
+                                   sed -e 's/:.*$//'`
+                        if [ &quot;.$groupname&quot; = . ]; then
+                            groupname=`(nidump group .) 2&gt;/dev/null | \
+                                       grep &quot;^[^:]*:[^:]*:${groupid}:&quot; | \
+                                       sed -e 's/:.*$//'`
+                            if [ &quot;.$groupname&quot; = . ]; then
+                                groupname='?'
+                            fi
+                        fi
+                    fi
+                fi
+            fi
+        fi
+    fi
+
+    #   determine host and domain name
+    hostname=''
+    domainname=''
+    if [ &quot;.$opt_e&quot; = .yes ] &amp;&amp; [ &quot;.`echo $text | grep '%h'`&quot; != . ]; then
+        hostname=&quot;`(uname -n) 2&gt;/dev/null |\
+                   awk '{ printf(&quot;%s&quot;, $1); }'`&quot;
+        if [ &quot;.$hostname&quot; = . ]; then
+            hostname=&quot;`(hostname) 2&gt;/dev/null |\
+                       awk '{ printf(&quot;%s&quot;, $1); }'`&quot;
+            if [ &quot;.$hostname&quot; = . ]; then
+                hostname='unknown'
+            fi
+        fi
+        case $hostname in
+            *.* )
+                domainname=&quot;.`echo $hostname | cut -d. -f2-`&quot;
+                hostname=&quot;`echo $hostname | cut -d. -f1`&quot;
+                ;;
+        esac
+    fi
+    if [ &quot;.$opt_e&quot; = .yes ] &amp;&amp; [ &quot;.`echo $text | grep '%d'`&quot; != . ]; then
+        if [ &quot;.$domainname&quot; = . ]; then
+            if [ -f /etc/resolv.conf ]; then
+                domainname=&quot;`grep '^[         ]*domain' /etc/resolv.conf | sed -e 'q' |\
+                             sed -e 's/.*domain//' \
+                                 -e 's/^[         ]*//' -e 's/^ *//' -e 's/^        *//' \
+                                 -e 's/^\.//' -e 's/^/./' |\
+                             awk '{ printf(&quot;%s&quot;, $1); }'`&quot;
+                if [ &quot;.$domainname&quot; = . ]; then
+                    domainname=&quot;`grep '^[         ]*search' /etc/resolv.conf | sed -e 'q' |\
+                                 sed -e 's/.*search//' \
+                                     -e 's/^[         ]*//' -e 's/^ *//' -e 's/^        *//' \
+                                     -e 's/ .*//' -e 's/        .*//' \
+                                     -e 's/^\.//' -e 's/^/./' |\
+                                 awk '{ printf(&quot;%s&quot;, $1); }'`&quot;
+                fi
+            fi
+        fi
+    fi
+
+    #   determine current time
+    time_day=''
+    time_month=''
+    time_year=''
+    time_monthname=''
+    if [ &quot;.$opt_e&quot; = .yes ] &amp;&amp; [ &quot;.`echo $text | grep '%[DMYm]'`&quot; != . ]; then
+        time_day=`date '+%d'`
+        time_month=`date '+%m'`
+        time_year=`date '+%Y' 2&gt;/dev/null`
+        if [ &quot;.$time_year&quot; = . ]; then
+            time_year=`date '+%y'`
+            case $time_year in
+                [5-9][0-9]) time_year=&quot;19$time_year&quot; ;;
+                [0-4][0-9]) time_year=&quot;20$time_year&quot; ;;
+            esac
+        fi
+        case $time_month in
+            1|01) time_monthname='Jan' ;;
+            2|02) time_monthname='Feb' ;;
+            3|03) time_monthname='Mar' ;;
+            4|04) time_monthname='Apr' ;;
+            5|05) time_monthname='May' ;;
+            6|06) time_monthname='Jun' ;;
+            7|07) time_monthname='Jul' ;;
+            8|08) time_monthname='Aug' ;;
+            9|09) time_monthname='Sep' ;;
+              10) time_monthname='Oct' ;;
+              11) time_monthname='Nov' ;;
+              12) time_monthname='Dec' ;;
+        esac
+    fi
+
+    #   expand special ``%x'' constructs
+    if [ &quot;.$opt_e&quot; = .yes ]; then
+        text=`echo $seo &quot;$text&quot; |\
+              sed -e &quot;s/%B/${term_bold}/g&quot; \
+                  -e &quot;s/%b/${term_norm}/g&quot; \
+                  -e &quot;s/%u/${username}/g&quot; \
+                  -e &quot;s/%U/${userid}/g&quot; \
+                  -e &quot;s/%g/${groupname}/g&quot; \
+                  -e &quot;s/%G/${groupid}/g&quot; \
+                  -e &quot;s/%h/${hostname}/g&quot; \
+                  -e &quot;s/%d/${domainname}/g&quot; \
+                  -e &quot;s/%D/${time_day}/g&quot; \
+                  -e &quot;s/%M/${time_month}/g&quot; \
+                  -e &quot;s/%Y/${time_year}/g&quot; \
+                  -e &quot;s/%m/${time_monthname}/g&quot; 2&gt;/dev/null`
+    fi
+
+    #   create output
+    if [ .$opt_n = .no ]; then
+        echo $seo &quot;$text&quot;
+    else
+        #   the harder part: echo -n is best, because
+        #   awk may complain about some \xx sequences.
+        if [ &quot;.$minusn&quot; != . ]; then
+            echo $seo $minusn &quot;$text&quot;
+        else
+            echo dummy | awk '{ printf(&quot;%s&quot;, TEXT); }' TEXT=&quot;$text&quot;
+        fi
+    fi
+
+    shtool_exit 0
+    ;;
+
+mdate )
+    ##
+    ##  mdate -- Pretty-print modification time of a file or dir
+    ##  Copyright (c) 1995-1997 Free Software Foundation, Inc.
+    ##  Copyright (c) 1998-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+    ##
+
+    fod=&quot;$1&quot;
+    case &quot;$opt_o&quot; in
+        [dmy][dmy][dmy] )
+            ;;
+        * ) echo &quot;$msgprefix:Error: invalid argument to option \`-o': $opt_o&quot; 1&gt;&amp;2
+            shtool_exit 1
+            ;;
+    esac
+    if [ ! -r &quot;$fod&quot; ]; then
+        echo &quot;$msgprefix:Error: file or directory not found: $fod&quot; 1&gt;&amp;2
+        shtool_exit 1
+    fi
+
+    #   GNU ls changes its time format in response to the TIME_STYLE
+    #   variable. Since we cannot assume &quot;unset&quot; works, revert this
+    #   variable to its documented default.
+    if [ &quot;.$TIME_STYLE&quot; != . ]; then
+        TIME_STYLE=posix-long-iso
+        export TIME_STYLE
+    fi
+
+    #   get the extended ls output of the file or directory.
+    if /bin/ls -L /dev/null &gt;/dev/null 2&gt;&amp;1; then
+        set - x`/bin/ls -L -l -d $fod`
+    else
+        set - x`/bin/ls -l -d $fod`
+    fi
+
+    #   The month is at least the fourth argument
+    #   (3 shifts here, the next inside the loop).
+    shift; shift; shift
+
+    #   Find the month. Next argument is day, followed by the year or time.
+    month=&quot;&quot;
+    while [ &quot;.$month&quot; = . ]; do
+        shift
+        case $1 in
+            Jan) month=January;   nummonth=1  ;;
+            Feb) month=February;  nummonth=2  ;;
+            Mar) month=March;     nummonth=3  ;;
+            Apr) month=April;     nummonth=4  ;;
+            May) month=May;       nummonth=5  ;;
+            Jun) month=June;      nummonth=6  ;;
+            Jul) month=July;      nummonth=7  ;;
+            Aug) month=August;    nummonth=8  ;;
+            Sep) month=September; nummonth=9  ;;
+            Oct) month=October;   nummonth=10 ;;
+            Nov) month=November;  nummonth=11 ;;
+            Dec) month=December;  nummonth=12 ;;
+        esac
+    done
+    day=&quot;$2&quot;
+    year=&quot;$3&quot;
+
+    #   We finally have to deal with the problem that the &quot;ls&quot; output
+    #   gives either the time of the day or the year.
+    case $year in
+        *:*)
+            this_year=`date '+%Y' 2&gt;/dev/null`
+            if [ &quot;.$this_year&quot; = . ]; then
+                this_year=`date '+%y'`
+                case $this_year in
+                    [5-9][0-9]) this_year=&quot;19$this_year&quot; ;;
+                    [0-4][0-9]) this_year=&quot;20$this_year&quot; ;;
+                esac
+            fi
+            #   for the following months of the last year the time notation
+            #   is usually also used for files modified in the last year.
+            this_month=`date '+%m'`
+            if (expr $nummonth \&gt; $this_month) &gt;/dev/null; then
+                this_year=`expr $this_year - 1`
+            fi
+            year=&quot;$this_year&quot;
+            ;;
+    esac
+
+    #   Optionally fill day and month with leeding zeros
+    if [ &quot;.$opt_z&quot; = .yes ]; then
+        case $day in
+            [0-9][0-9] ) ;;
+                 [0-9] ) day=&quot;0$day&quot; ;;
+        esac
+        case $nummonth in
+            [0-9][0-9] ) ;;
+                 [0-9] ) nummonth=&quot;0$nummonth&quot; ;;
+        esac
+    fi
+
+    #   Optionally use digits for month
+    if [ &quot;.$opt_d&quot; = .yes ]; then
+        month=&quot;$nummonth&quot;
+    fi
+
+    #   Optionally shorten the month name to three characters
+    if [ &quot;.$opt_s&quot; = .yes ]; then
+        month=`echo $month | cut -c1-3`
+    fi
+
+    #   Output the resulting date string
+    echo dummy | awk '{
+        for (i = 0; i &lt; 3; i++) {
+            now = substr(order, 1, 1);
+            order = substr(order, 2);
+            if (now == &quot;d&quot;)
+                out = day;
+            else if (now == &quot;m&quot;)
+                out = month;
+            else if (now == &quot;y&quot;)
+                out = year;
+            if (i &lt; 2)
+                printf(&quot;%s%s&quot;, out, field);
+            else
+                printf(&quot;%s&quot;, out);
+        }
+        if (newline != &quot;yes&quot;)
+            printf(&quot;\n&quot;);
+    }' &quot;day=$day&quot; &quot;month=$month&quot; &quot;year=$year&quot; \
+       &quot;field=$opt_f&quot; &quot;order=$opt_o&quot; &quot;newline=$opt_n&quot;
+
+    shtool_exit 0
+    ;;
+
+table )
+    ##
+    ##  table -- Pretty-print a field-separated list as a table
+    ##  Copyright (c) 1998-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+    ##
+
+    if [ $opt_c -gt 4 ]; then
+        echo &quot;$msgprefix:Error: Invalid number of colums (1..4 allowed only)&quot; 1&gt;&amp;2
+        shtool_exit 1
+    fi
+    case &quot;x$opt_F&quot; in
+        x? ) ;;
+        *  ) echo &quot;$msgprefix:Error: Invalid separator (one char allowed only)&quot; 1&gt;&amp;2; shtool_exit 1 ;;
+    esac
+
+    #   split the list into a table
+    list=`
+        IFS=&quot;$opt_F&quot;
+        for entry in $*; do
+            if [ &quot;.$entry&quot; != . ]; then
+                echo &quot;$entry&quot;
+            fi
+        done |\
+        awk &quot;
+            BEGIN { list = \&quot;\&quot;; n = 0; }
+            {
+                list = list \\$1;
+                n = n + 1;
+                if (n &lt; $opt_c) {
+                    list = list \&quot;:\&quot;;
+                }
+                if (n == $opt_c) {
+                    list = list \&quot;\\n\&quot;;
+                    n = 0;
+                }
+            }
+            END { print list; }
+         &quot;
+    `
+
+    #   format table cells and make sure table
+    #   doesn't exceed maximum width
+    OIFS=&quot;$IFS&quot;
+    IFS='
+'
+    for entry in $list; do
+        case $opt_c in
+            1 ) eval &quot;echo \&quot;\${entry}\&quot; | awk -F: '{ printf(\&quot;%-${opt_w}s\\n\&quot;, \$1); }'&quot; ;;
+            2 ) eval &quot;echo \&quot;\${entry}\&quot; | awk -F: '{ printf(\&quot;%-${opt_w}s %-${opt_w}s\\n\&quot;, \$1, \$2); }'&quot; ;;
+            3 ) eval &quot;echo \&quot;\${entry}\&quot; | awk -F: '{ printf(\&quot;%-${opt_w}s %-${opt_w}s %-${opt_w}s\\n\&quot;, \$1, \$2, \$3); }'&quot; ;;
+            4 ) eval &quot;echo \&quot;\${entry}\&quot; | awk -F: '{ printf(\&quot;%-${opt_w}s %-${opt_w}s %-${opt_w}s %-${opt_w}s\\n\&quot;, \$1, \$2, \$3, \$4); }'&quot; ;;
+        esac
+    done |\
+    awk &quot;{
+        if (length(\$0) &gt; $opt_s) {
+            printf(\&quot;%s\\n\&quot;, substr(\$0, 0, $opt_s-1));
+        } else {
+            print \$0;
+        }
+    }&quot;
+    IFS=&quot;$OIFS&quot;
+
+    shtool_exit 0
+    ;;
+
+prop )
+    ##
+    ##  prop -- Display progress with a running propeller
+    ##  Copyright (c) 1998-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+    ##
+
+    perl=''
+    for dir in `echo $PATH | sed -e 's/:/ /g'` .; do
+        if [ -f &quot;$dir/perl&quot; ]; then
+            perl=&quot;$dir/perl&quot;
+            break
+        fi
+    done
+    if [ &quot;.$perl&quot; != . ]; then
+        #   Perl is preferred because writing to STDERR in
+        #   Perl really writes immediately as one would expect
+        $perl -e '
+            @p = (&quot;|&quot;,&quot;/&quot;,&quot;-&quot;,&quot;\\&quot;);
+            $i = 0;
+            while (&lt;STDIN&gt;) {
+                printf(STDERR &quot;\r%s...%s\b&quot;, $ARGV[0], $p[$i++]);
+                $i = 0 if ($i &gt; 3);
+            }
+            printf(STDERR &quot;\r%s    \n&quot;, $ARGV[0]);
+        ' &quot;$opt_p&quot;
+    else
+        #   But if Perl doesn't exists we use Awk even
+        #   some Awk's buffer even the /dev/stderr writing :-(
+        awk '
+            BEGIN {
+                split(&quot;|#/#-#\\&quot;, p, &quot;#&quot;);
+                i = 1;
+            }
+            {
+                printf(&quot;\r%s%c\b&quot;, prefix, p[i++]) &gt; &quot;/dev/stderr&quot;;
+                if (i &gt; 4) { i = 1; }
+            }
+            END {
+                printf(&quot;\r%s    \n&quot;, prefix) &gt; &quot;/dev/stderr&quot;;
+            }
+        ' &quot;prefix=$opt_p&quot;
+    fi
+
+    shtool_exit 0
+    ;;
+
+move )
+    ##
+    ##  move -- Move files with simultaneous substitution
+    ##  Copyright (c) 1999-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+    ##
+
+    src=&quot;$1&quot;
+    dst=&quot;$2&quot;
+
+    #   consistency checks
+    if [ &quot;.$src&quot; = . ] || [ &quot;.$dst&quot; = . ]; then
+        echo &quot;$msgprefix:Error: Invalid arguments&quot; 1&gt;&amp;2
+        shtool_exit 1
+    fi
+    if [ &quot;.$src&quot; = &quot;.$dst&quot; ]; then
+        echo &quot;$msgprefix:Error: Source and destination files are the same&quot; 1&gt;&amp;2
+        shtool_exit 1
+    fi
+    expsrc=&quot;$src&quot;
+    if [ &quot;.$opt_e&quot; = .yes ]; then
+        expsrc=&quot;`echo $expsrc`&quot;
+    fi
+    if [ &quot;.$opt_e&quot; = .yes ]; then
+        if [ &quot;.`echo &quot;$src&quot; | sed -e 's;^.*\\*.*$;;'`&quot; = &quot;.$src&quot; ]; then
+            echo &quot;$msgprefix:Error: Source doesn't contain wildcard ('*'): $dst&quot; 1&gt;&amp;2
+            shtool_exit 1
+        fi
+        if [ &quot;.`echo &quot;$dst&quot; | sed -e 's;^.*%[1-9].*$;;'`&quot; = &quot;.$dst&quot; ]; then
+            echo &quot;$msgprefix:Error: Destination doesn't contain substitution ('%N'): $dst&quot; 1&gt;&amp;2
+            shtool_exit 1
+        fi
+        if [ &quot;.$expsrc&quot; = &quot;.$src&quot; ]; then
+            echo &quot;$msgprefix:Error: Sources not found or no asterisk : $src&quot; 1&gt;&amp;2
+            shtool_exit 1
+        fi
+    else
+        if [ ! -r &quot;$src&quot; ]; then
+            echo &quot;$msgprefix:Error: Source not found: $src&quot; 1&gt;&amp;2
+            shtool_exit 1
+        fi
+    fi
+
+    #   determine substitution patterns
+    if [ &quot;.$opt_e&quot; = .yes ]; then
+        srcpat=`echo &quot;$src&quot; | sed -e 's/\\./\\\\./g' -e 's/;/\\;/g' -e 's;\\*;\\\\(.*\\\\);g'`
+        dstpat=`echo &quot;$dst&quot; | sed -e 's;%\([1-9]\);\\\\\1;g'`
+    fi
+
+    #   iterate over source(s)
+    for onesrc in $expsrc; do
+        if [ .$opt_e = .yes ]; then
+            onedst=`echo $onesrc | sed -e &quot;s;$srcpat;$dstpat;&quot;`
+        else
+            onedst=&quot;$dst&quot;
+        fi
+        errorstatus=0
+        if [ &quot;.$opt_v&quot; = .yes ]; then
+            echo &quot;$onesrc -&gt; $onedst&quot;
+        fi
+        if [ &quot;.$opt_p&quot; = .yes ]; then
+            if [ -r $onedst ]; then
+                if cmp -s $onesrc $onedst; then
+                    if [ &quot;.$opt_t&quot; = .yes ]; then
+                        echo &quot;rm -f $onesrc&quot; 1&gt;&amp;2
+                    fi
+                    rm -f $onesrc || errorstatus=$?
+                else
+                    if [ &quot;.$opt_t&quot; = .yes ]; then
+                        echo &quot;mv -f $onesrc $onedst&quot; 1&gt;&amp;2
+                    fi
+                    mv -f $onesrc $onedst || errorstatus=$?
+                fi
+            else
+                if [ &quot;.$opt_t&quot; = .yes ]; then
+                    echo &quot;mv -f $onesrc $onedst&quot; 1&gt;&amp;2
+                fi
+                mv -f $onesrc $onedst || errorstatus=$?
+            fi
+        else
+            if [ &quot;.$opt_t&quot; = .yes ]; then
+                echo &quot;mv -f $onesrc $onedst&quot; 1&gt;&amp;2
+            fi
+            mv -f $onesrc $onedst || errorstatus=$?
+        fi
+        if [ $errorstatus -ne 0 ]; then
+            break;
+        fi
+    done
+
+    shtool_exit $errorstatus
+    ;;
+
+install )
+    ##
+    ##  install -- Install a program, script or datafile
+    ##  Copyright (c) 1997-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+    ##
+
+    #   special case: &quot;shtool install -d &lt;dir&gt; [...]&quot; internally
+    #   maps to &quot;shtool mkdir -f -p -m 755 &lt;dir&gt; [...]&quot;
+    if [ &quot;$opt_d&quot; = yes ]; then
+        cmd=&quot;$0 mkdir -f -p -m 755&quot;
+        if [ &quot;.$opt_o&quot; != . ]; then
+            cmd=&quot;$cmd -o '$opt_o'&quot;
+        fi
+        if [ &quot;.$opt_g&quot; != . ]; then
+            cmd=&quot;$cmd -g '$opt_g'&quot;
+        fi
+        if [ &quot;.$opt_v&quot; = .yes ]; then
+            cmd=&quot;$cmd -v&quot;
+        fi
+        if [ &quot;.$opt_t&quot; = .yes ]; then
+            cmd=&quot;$cmd -t&quot;
+        fi
+        for dir in &quot;$@&quot;; do
+            eval &quot;$cmd $dir&quot; || shtool_exit $?
+        done
+        shtool_exit 0
+    fi
+
+    #   determine source(s) and destination
+    argc=$#
+    srcs=&quot;&quot;
+    while [ $# -gt 1 ]; do
+        srcs=&quot;$srcs $1&quot;
+        shift
+    done
+    dstpath=&quot;$1&quot;
+
+    #   type check for destination
+    dstisdir=0
+    if [ -d $dstpath ]; then
+        dstpath=`echo &quot;$dstpath&quot; | sed -e 's:/$::'`
+        dstisdir=1
+    fi
+
+    #   consistency check for destination
+    if [ $argc -gt 2 ] &amp;&amp; [ $dstisdir = 0 ]; then
+        echo &quot;$msgprefix:Error: multiple sources require destination to be directory&quot; 1&gt;&amp;2
+        shtool_exit 1
+    fi
+
+    #   iterate over all source(s)
+    for src in $srcs; do
+        dst=$dstpath
+
+        #   if destination is a directory, append the input filename
+        if [ $dstisdir = 1 ]; then
+            dstfile=`echo &quot;$src&quot; | sed -e 's;.*/\([^/]*\)$;\1;'`
+            dst=&quot;$dst/$dstfile&quot;
+        fi
+
+        #   check for correct arguments
+        if [ &quot;.$src&quot; = &quot;.$dst&quot; ]; then
+            echo &quot;$msgprefix:Warning: source and destination are the same - skipped&quot; 1&gt;&amp;2
+            continue
+        fi
+        if [ -d &quot;$src&quot; ]; then
+            echo &quot;$msgprefix:Warning: source \`$src' is a directory - skipped&quot; 1&gt;&amp;2
+            continue
+        fi
+
+        #   make a temp file name in the destination directory
+        dsttmp=`echo $dst |\
+                sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \
+                    -e &quot;s;\$;/#INST@$$#;&quot;`
+
+        #   verbosity
+        if [ &quot;.$opt_v&quot; = .yes ]; then
+            echo &quot;$src -&gt; $dst&quot; 1&gt;&amp;2
+        fi
+
+        #   copy or move the file name to the temp name
+        #   (because we might be not allowed to change the source)
+        if [ &quot;.$opt_C&quot; = .yes ]; then
+            opt_c=yes
+        fi
+        if [ &quot;.$opt_c&quot; = .yes ]; then
+            if [ &quot;.$opt_t&quot; = .yes ]; then
+                echo &quot;cp $src $dsttmp&quot; 1&gt;&amp;2
+            fi
+            cp &quot;$src&quot; &quot;$dsttmp&quot; || shtool_exit $?
+        else
+            if [ &quot;.$opt_t&quot; = .yes ]; then
+                echo &quot;mv $src $dsttmp&quot; 1&gt;&amp;2
+            fi
+            mv &quot;$src&quot; &quot;$dsttmp&quot; || shtool_exit $?
+        fi
+
+        #   adjust the target file
+        if [ &quot;.$opt_e&quot; != . ]; then
+            sed='sed'
+            OIFS=&quot;$IFS&quot;; IFS=&quot;$ASC_NL&quot;; set -- $opt_e; IFS=&quot;$OIFS&quot;
+            for e
+            do
+                sed=&quot;$sed -e '$e'&quot;
+            done
+            cp &quot;$dsttmp&quot; &quot;$dsttmp.old&quot;
+            chmod u+w $dsttmp
+            eval &quot;$sed &lt;$dsttmp.old &gt;$dsttmp&quot; || shtool_exit $?
+            rm -f $dsttmp.old
+        fi
+        if [ &quot;.$opt_s&quot; = .yes ]; then
+            if [ &quot;.$opt_t&quot; = .yes ]; then
+                echo &quot;strip $dsttmp&quot; 1&gt;&amp;2
+            fi
+            strip $dsttmp || shtool_exit $?
+        fi
+        if [ &quot;.$opt_o&quot; != . ]; then
+            if [ &quot;.$opt_t&quot; = .yes ]; then
+                echo &quot;chown $opt_o $dsttmp&quot; 1&gt;&amp;2
+            fi
+            chown $opt_o $dsttmp || shtool_exit $?
+        fi
+        if [ &quot;.$opt_g&quot; != . ]; then
+            if [ &quot;.$opt_t&quot; = .yes ]; then
+                echo &quot;chgrp $opt_g $dsttmp&quot; 1&gt;&amp;2
+            fi
+            chgrp $opt_g $dsttmp || shtool_exit $?
+        fi
+        if [ &quot;.$opt_m&quot; != &quot;.-&quot; ]; then
+            if [ &quot;.$opt_t&quot; = .yes ]; then
+                echo &quot;chmod $opt_m $dsttmp&quot; 1&gt;&amp;2
+            fi
+            chmod $opt_m $dsttmp || shtool_exit $?
+        fi
+
+        #   determine whether to do a quick install
+        #   (has to be done _after_ the strip was already done)
+        quick=no
+        if [ &quot;.$opt_C&quot; = .yes ]; then
+            if [ -r $dst ]; then
+                if cmp -s &quot;$src&quot; &quot;$dst&quot;; then
+                    quick=yes
+                fi
+            fi
+        fi
+
+        #   finally, install the file to the real destination
+        if [ $quick = yes ]; then
+            if [ &quot;.$opt_t&quot; = .yes ]; then
+                echo &quot;rm -f $dsttmp&quot; 1&gt;&amp;2
+            fi
+            rm -f $dsttmp
+        else
+            if [ &quot;.$opt_t&quot; = .yes ]; then
+                echo &quot;rm -f $dst &amp;&amp; mv $dsttmp $dst&quot; 1&gt;&amp;2
+            fi
+            rm -f $dst &amp;&amp; mv $dsttmp $dst
+        fi
+    done
+
+    shtool_exit 0
+    ;;
+
+mkdir )
+    ##
+    ##  mkdir -- Make one or more directories
+    ##  Copyright (c) 1996-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+    ##
+
+    errstatus=0
+    for p in ${1+&quot;$@&quot;}; do
+        #   if the directory already exists...
+        if [ -d &quot;$p&quot; ]; then
+            if [ &quot;.$opt_f&quot; = .no ] &amp;&amp; [ &quot;.$opt_p&quot; = .no ]; then
+                echo &quot;$msgprefix:Error: directory already exists: $p&quot; 1&gt;&amp;2
+                errstatus=1
+                break
+            else
+                continue
+            fi
+        fi
+        #   if the directory has to be created...
+        if [ &quot;.$opt_p&quot; = .no ]; then
+            if [ &quot;.$opt_t&quot; = .yes ]; then
+                echo &quot;mkdir $p&quot; 1&gt;&amp;2
+            fi
+            mkdir $p || errstatus=$?
+            if [ &quot;.$opt_o&quot; != . ]; then
+                if [ &quot;.$opt_t&quot; = .yes ]; then
+                    echo &quot;chown $opt_o $p&quot; 1&gt;&amp;2
+                fi
+                chown $opt_o $p || errstatus=$?
+            fi
+            if [ &quot;.$opt_g&quot; != . ]; then
+                if [ &quot;.$opt_t&quot; = .yes ]; then
+                    echo &quot;chgrp $opt_g $p&quot; 1&gt;&amp;2
+                fi
+                chgrp $opt_g $p || errstatus=$?
+            fi
+            if [ &quot;.$opt_m&quot; != . ]; then
+                if [ &quot;.$opt_t&quot; = .yes ]; then
+                    echo &quot;chmod $opt_m $p&quot; 1&gt;&amp;2
+                fi
+                chmod $opt_m $p || errstatus=$?
+            fi
+        else
+            #   the smart situation
+            set fnord `echo &quot;:$p&quot; |\
+                       sed -e 's/^:\//%/' \
+                           -e 's/^://' \
+                           -e 's/\// /g' \
+                           -e 's/^%/\//'`
+            shift
+            pathcomp=''
+            for d in ${1+&quot;$@&quot;}; do
+                pathcomp=&quot;$pathcomp$d&quot;
+                case &quot;$pathcomp&quot; in
+                    -* ) pathcomp=&quot;./$pathcomp&quot; ;;
+                esac
+                if [ ! -d &quot;$pathcomp&quot; ]; then
+                    if [ &quot;.$opt_t&quot; = .yes ]; then
+                        echo &quot;mkdir $pathcomp&quot; 1&gt;&amp;2
+                    fi
+                    mkdir $pathcomp || errstatus=$?
+                    if [ &quot;.$opt_o&quot; != . ]; then
+                        if [ &quot;.$opt_t&quot; = .yes ]; then
+                            echo &quot;chown $opt_o $pathcomp&quot; 1&gt;&amp;2
+                        fi
+                        chown $opt_o $pathcomp || errstatus=$?
+                    fi
+                    if [ &quot;.$opt_g&quot; != . ]; then
+                        if [ &quot;.$opt_t&quot; = .yes ]; then
+                            echo &quot;chgrp $opt_g $pathcomp&quot; 1&gt;&amp;2
+                        fi
+                        chgrp $opt_g $pathcomp || errstatus=$?
+                    fi
+                    if [ &quot;.$opt_m&quot; != . ]; then
+                        if [ &quot;.$opt_t&quot; = .yes ]; then
+                            echo &quot;chmod $opt_m $pathcomp&quot; 1&gt;&amp;2
+                        fi
+                        chmod $opt_m $pathcomp || errstatus=$?
+                    fi
+                fi
+                pathcomp=&quot;$pathcomp/&quot;
+            done
+        fi
+    done
+
+    shtool_exit $errstatus
+    ;;
+
+mkln )
+    ##
+    ##  mkln -- Make link with calculation of relative paths
+    ##  Copyright (c) 1998-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+    ##
+
+    #   determine source(s) and destination
+    args=$?
+    srcs=&quot;&quot;
+    while [ $# -gt 1 ]; do
+        srcs=&quot;$srcs $1&quot;
+        shift
+    done
+    dst=&quot;$1&quot;
+    if [ ! -d $dst ]; then
+        if [ $args -gt 2 ]; then
+            echo &quot;$msgprefix:Error: multiple sources not allowed when target isn't a directory&quot; 1&gt;&amp;2
+            shtool_exit 1
+        fi
+    fi
+
+    #   determine link options
+    lnopt=&quot;&quot;
+    if [ &quot;.$opt_f&quot; = .yes ]; then
+        lnopt=&quot;$lnopt -f&quot;
+    fi
+    if [ &quot;.$opt_s&quot; = .yes ]; then
+        lnopt=&quot;$lnopt -s&quot;
+    fi
+
+    #   iterate over sources
+    for src in $srcs; do
+        #   determine if one of the paths is an absolute path,
+        #   because then we _have_ to use an absolute symlink
+        oneisabs=0
+        srcisabs=0
+        dstisabs=0
+        case $src in
+            /* ) oneisabs=1; srcisabs=1 ;;
+        esac
+        case $dst in
+            /* ) oneisabs=1; dstisabs=1 ;;
+        esac
+
+        #   split source and destination into dir and base name
+        if [ -d $src ]; then
+            srcdir=`echo $src | sed -e 's;/*$;;'`
+            srcbase=&quot;&quot;
+        else
+            srcdir=`echo  $src | sed -e 's;^[^/]*$;;' -e 's;^\(.*/\)[^/]*$;\1;' -e 's;\(.\)/$;\1;'`
+            srcbase=`echo $src | sed -e 's;.*/\([^/]*\)$;\1;'`
+        fi
+        if [ -d $dst ]; then
+            dstdir=`echo $dst | sed -e 's;/*$;;'`
+            dstbase=&quot;&quot;
+        else
+            dstdir=`echo  $dst | sed -e 's;^[^/]*$;;' -e 's;^\(.*/\)[^/]*$;\1;' -e 's;\(.\)/$;\1;'`
+            dstbase=`echo $dst | sed -e 's;.*/\([^/]*\)$;\1;'`
+        fi
+
+        #   consistency check
+        if [ &quot;.$dstdir&quot; != . ]; then
+            if [ ! -d $dstdir ]; then
+                echo &quot;$msgprefix:Error: destination directory not found: $dstdir&quot; 1&gt;&amp;2
+                shtool_exit 1
+            fi
+        fi
+
+        #   make sure the source is reachable from the destination
+        if [ $dstisabs = 1 ]; then
+            if [ $srcisabs = 0 ]; then
+                if [ &quot;.$srcdir&quot; = . ]; then
+                    srcdir=&quot;`pwd | sed -e 's;/*$;;'`&quot;
+                    srcisabs=1
+                    oneisabs=1
+                elif [ -d $srcdir ]; then
+                    srcdir=&quot;`cd $srcdir; pwd | sed -e 's;/*$;;'`&quot;
+                    srcisabs=1
+                    oneisabs=1
+                fi
+            fi
+        fi
+
+        #   split away a common prefix
+        prefix=&quot;&quot;
+        if [ &quot;.$srcdir&quot; = &quot;.$dstdir&quot; ] &amp;&amp; [ &quot;.$srcdir&quot; != . ]; then
+            prefix=&quot;$srcdir/&quot;
+            srcdir=&quot;&quot;
+            dstdir=&quot;&quot;
+        else
+            while [ &quot;.$srcdir&quot; != . ] &amp;&amp; [ &quot;.$dstdir&quot; != . ]; do
+                presrc=`echo $srcdir | sed -e 's;^\([^/]*\)/.*;\1;'`
+                predst=`echo $dstdir | sed -e 's;^\([^/]*\)/.*;\1;'`
+                if [ &quot;.$presrc&quot; != &quot;.$predst&quot; ]; then
+                    break
+                fi
+                prefix=&quot;$prefix$presrc/&quot;
+                srcdir=`echo $srcdir | sed -e 's;^[^/]*/*;;'`
+                dstdir=`echo $dstdir | sed -e 's;^[^/]*/*;;'`
+            done
+        fi
+
+        #   destination prefix is just the common prefix
+        dstpre=&quot;$prefix&quot;
+
+        #   determine source prefix which is the reverse directory
+        #   step-up corresponding to the destination directory
+        srcpre=&quot;&quot;
+        allow_relative_srcpre=no
+        if [ &quot;.$prefix&quot; != . ] &amp;&amp; [ &quot;.$prefix&quot; != ./ ]; then
+            allow_relative_srcpre=yes
+        fi  
+        if [ $oneisabs = 0 ]; then
+            allow_relative_srcpre=yes
+        fi  
+        if [ &quot;.$opt_s&quot; != .yes ]; then
+            allow_relative_srcpre=no
+        fi  
+        if [ &quot;.$allow_relative_srcpre&quot; = .yes ]; then
+            pl=&quot;$dstdir/&quot;
+            OIFS=&quot;$IFS&quot;; IFS='/'
+            for pe in $pl; do
+                [ &quot;.$pe&quot; = .  ] &amp;&amp; continue
+                [ &quot;.$pe&quot; = .. ] &amp;&amp; continue
+                srcpre=&quot;../$srcpre&quot;
+            done
+            IFS=&quot;$OIFS&quot;
+        else
+            if [ $srcisabs = 1 ]; then
+                srcpre=&quot;$prefix&quot;
+            fi
+        fi
+
+        #   determine destination symlink name
+        if [ &quot;.$dstbase&quot; = . ]; then
+            if [ &quot;.$srcbase&quot; != . ]; then
+                dstbase=&quot;$srcbase&quot;
+            else
+                dstbase=`echo &quot;$prefix$srcdir&quot; | sed -e 's;/*$;;' -e 's;.*/\([^/]*\)$;\1;'`
+            fi
+        fi
+
+        #   now finalize source and destination directory paths
+        srcdir=`echo $srcdir | sed -e 's;\([^/]\)$;\1/;'`
+        dstdir=`echo $dstdir | sed -e 's;\([^/]\)$;\1/;'`
+
+        #   run the final link command
+        if [ &quot;.$opt_t&quot; = .yes ]; then
+            echo &quot;ln$lnopt $srcpre$srcdir$srcbase $dstpre$dstdir$dstbase&quot;
+        fi
+        eval ln$lnopt $srcpre$srcdir$srcbase $dstpre$dstdir$dstbase
+    done
+
+    shtool_exit 0
+    ;;
+
+mkshadow )
+    ##
+    ##  mkshadow -- Make a shadow tree through symbolic links
+    ##  Copyright (c) 1998-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+    ##
+
+    #   source and destination directory
+    src=`echo &quot;$1&quot; | sed -e 's:/$::' -e 's:^\./\(.\):\1:'`
+    dst=`echo &quot;$2&quot; | sed -e 's:/$::' -e 's:^\./\(.\):\1:'`
+
+    #   check whether source exists
+    if [ ! -d $src ]; then
+        echo &quot;$msgprefix:Error: source directory not found: \`$src'&quot; 1&gt;&amp;2
+        shtool_exit 1
+    fi
+
+    #   determine if one of the paths is an absolute path,
+    #   because then we have to use an absolute symlink
+    oneisabs=0
+    case $src in
+        /* ) oneisabs=1 ;;
+    esac
+    case $dst in
+        /* ) oneisabs=1 ;;
+    esac
+
+    #   determine reverse directory for destination directory
+    dstrevdir=''
+    if [ $oneisabs = 0 ]; then
+        #   derive reverse path from forward path
+        pwd=`pwd`
+        OIFS=&quot;$IFS&quot;; IFS='/'
+        for pe in $dst; do
+            if [ &quot;x$pe&quot; = &quot;x..&quot; ]; then
+                OIFS2=&quot;$IFS&quot;; IFS=&quot;$DIFS&quot;
+                eval `echo &quot;$pwd&quot; |\
+                      sed -e 's:\([^/]*\)$:; dir=&quot;\1&quot;:' \
+                          -e 's:^\(.*\)/[^/]*;:pwd=&quot;\1&quot;;:'\
+                          -e 's:^;:pwd=&quot;&quot;;:'`
+                dstrevdir=&quot;$dir/$dstrevdir&quot;
+                IFS=&quot;$OIFS2&quot;
+            else
+                dstrevdir=&quot;../$dstrevdir&quot;
+            fi
+        done
+        IFS=&quot;$OIFS&quot;
+    else
+        src=&quot;`cd $src; pwd`&quot;;
+    fi
+
+    #   create directory tree at destination
+    if [ ! -d $dst ]; then
+        if [ &quot;.$opt_t&quot; = .yes ]; then
+            echo &quot;mkdir $dst&quot; 1&gt;&amp;2
+        fi
+        mkdir $dst
+    fi
+    if [ &quot;.$opt_a&quot; = .yes ]; then
+        DIRS=`cd $src; find . -type d -print |\
+              sed -e '/^\.$/d' -e 's:^\./::'`
+    else
+        DIRS=`cd $src; find . -type d -print |\
+              sed -e '/\/CVS/d' -e '/^\.$/d' -e 's:^\./::'`
+    fi
+    for dir in $DIRS; do
+        if [ &quot;.$opt_t&quot; = .yes ]; then
+            echo &quot;mkdir $dst/$dir&quot; 1&gt;&amp;2
+        fi
+        mkdir $dst/$dir
+    done
+
+    #   fill directory tree with symlinks to files
+    if [ &quot;.$opt_a&quot; = .yes ]; then
+        FILES=&quot;`cd $src; find . -depth -print |\
+                sed -e 's/^\.\///'`&quot;
+    else
+        FILES=&quot;`cd $src; find . -depth -print |\
+                sed -e '/\.o$/d' -e '/\.a$/d' -e '/\.so$/d' \
+                    -e '/\.cvsignore$/d' -e '/\/CVS/d' \
+                    -e '/\/\.#/d' -e '/\.orig$/d' \
+                    -e 's/^\.\///'`&quot;
+    fi
+    for file in $FILES; do
+         #  don't use `-type f' above for find because of symlinks
+         if [ -d &quot;$src/$file&quot; ]; then
+             continue
+         fi
+         basename=`echo $file | sed -e 's:^.*/::'`
+         dir=`echo $file | sed -e 's:[^/]*$::' -e 's:/$::' -e 's:$:/:' -e 's:^/$::'`
+         from=`echo &quot;$src/$file&quot; | sed -e 's/^\.\///'`
+         to=&quot;$dst/$dir$basename&quot;
+         if [ $oneisabs = 0 ]; then
+             if [ &quot;.$dir&quot; != . ]; then
+                 subdir=`echo $dir | sed -e 's:/$::'`
+                 #   derive reverse path from forward path
+                 revdir=''
+                 OIFS=&quot;$IFS&quot;; IFS='/'
+                 for pe in $subdir; do
+                     revdir=&quot;../$revdir&quot;
+                 done
+                 IFS=&quot;$OIFS&quot;
+                 #   finalize from
+                 from=&quot;$revdir$from&quot;
+             fi
+             from=&quot;$dstrevdir$from&quot;
+         fi
+         if [ &quot;.$opt_v&quot; = .yes ]; then
+             echo &quot;    $to&quot; 1&gt;&amp;2
+         fi
+         if [ &quot;.$opt_t&quot; = .yes ]; then
+             echo &quot;ln -s $from $to&quot; 1&gt;&amp;2
+         fi
+         ln -s $from $to
+    done
+
+    shtool_exit 0
+    ;;
+
+fixperm )
+    ##
+    ##  fixperm -- Fix file permissions inside a source tree
+    ##  Copyright (c) 1996-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+    ##
+
+    paths=&quot;$*&quot;
+
+    #   check whether the test command supports the -x option
+    if [ -x /bin/sh ] 2&gt;/dev/null; then
+        minusx=&quot;-x&quot;
+    else
+        minusx=&quot;-r&quot;
+    fi
+
+    #   iterate over paths
+    for p in $paths; do
+        for file in `find $p -depth -print`; do
+            if [ -f $file ]; then
+                if [ $minusx $file ]; then
+                    if [ &quot;.$opt_v&quot; = .yes ]; then
+                        echo &quot;-rwxr-xr-x $file&quot; 2&gt;&amp;1
+                    fi
+                    if [ &quot;.$opt_t&quot; = .yes ]; then
+                        echo &quot;chmod 755 $file&quot; 2&gt;&amp;1
+                    fi
+                    chmod 755 $file
+                else
+                    if [ &quot;.$opt_v&quot; = .yes ]; then
+                        echo &quot;-rw-r--r-- $file&quot; 2&gt;&amp;1
+                    fi
+                    if [ &quot;.$opt_t&quot; = .yes ]; then
+                        echo &quot;chmod 644 $file&quot; 2&gt;&amp;1
+                    fi
+                    chmod 644 $file
+                fi
+                continue
+            fi
+            if [ -d $file ]; then
+                if [ &quot;.$opt_v&quot; = .yes ]; then
+                    echo &quot;drwxr-xr-x $file&quot; 2&gt;&amp;1
+                fi
+                if [ &quot;.$opt_t&quot; = .yes ]; then
+                    echo &quot;chmod 755 $file&quot; 2&gt;&amp;1
+                fi
+                chmod 755 $file
+                continue
+            fi
+            if [ &quot;.$opt_v&quot; = .yes ]; then
+                echo &quot;?????????? $file&quot; 2&gt;&amp;1
+            fi
+        done
+    done
+
+    shtool_exit 0
+    ;;
+
+rotate )
+    ##
+    ##  rotate -- Logfile rotation
+    ##  Copyright (c) 2001-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+    ##
+
+    #   make sure we have at least one file to rotate
+    if [ &quot;.$opt_n&quot; = .0 ]; then
+        echo &quot;$msgprefix:Error: invalid argument \`$opt_n' to option -n.&quot; 1&gt;&amp;2
+        shtool_exit 1
+    fi
+
+    #   canonicalize -s option argument
+    if [ &quot;.$opt_s&quot; != . ]; then
+        if [ &quot;.`expr $opt_s : '[0-9]*$'`&quot; != .0 ]; then
+            :
+        elif [ &quot;.`expr $opt_s : '[0-9]*[Kk]$'`&quot; != .0 ]; then
+            opt_s=`expr $opt_s : '\([0-9]*\)[Kk]$'`
+            opt_s=`expr $opt_s \* 1024`
+        elif [ &quot;.`expr $opt_s : '[0-9]*[Mm]$'`&quot; != .0 ]; then
+            opt_s=`expr $opt_s : '\([0-9]*\)[Mm]$'`
+            opt_s=`expr $opt_s \* 1048576` # 1024*1024
+        elif [ &quot;.`expr $opt_s : '[0-9]*[Gg]$'`&quot; != .0 ]; then
+            opt_s=`expr $opt_s : '\([0-9]*\)[Gg]$'`
+            opt_s=`expr $opt_s \* 1073741824` # 1024*1024*1024
+        else
+            echo &quot;$msgprefix:Error: invalid argument \`$opt_s' to option -s.&quot; 1&gt;&amp;2
+            shtool_exit 1
+        fi
+    fi
+
+    #   option -d/-z consistency
+    if [ &quot;.$opt_d&quot; = .yes ] &amp;&amp; [ &quot;.$opt_z&quot; = . ]; then
+        echo &quot;$msgprefix:Error: option -d requires option -z.&quot; 1&gt;&amp;2
+        shtool_exit 1
+    fi
+
+    #   make sure target directory exists
+    if [ &quot;.$opt_a&quot; != . ]; then
+        if [ ! -d $opt_a ]; then
+            if [ &quot;.$opt_f&quot; = .no ]; then
+                echo &quot;$msgprefix:Error: archive directory \`$opt_a' does not exist.&quot; 1&gt;&amp;2
+                shtool_exit 1
+            fi
+            mkdir $opt_a || shtool_exit $?
+            chmod 755 $opt_a
+        fi
+        if [ ! -w $opt_a ]; then
+            echo &quot;$msgprefix:Error: archive directory \`$opt_a' not writable.&quot; 1&gt;&amp;2
+            shtool_exit 1
+        fi
+    fi
+
+    #   determine compression approach
+    if [ &quot;.$opt_z&quot; != . ]; then
+        comp_lvl=&quot;$opt_z&quot;
+        comp_prg=&quot;&quot;
+        case $comp_lvl in
+            *:* ) eval `echo $comp_lvl |\
+                        sed -e 's%^\(.*\):\(.*\)$%comp_prg=&quot;\1&quot;; comp_lvl=&quot;\2&quot;%'` ;;
+        esac
+
+        #   compression level consistency
+        case $comp_lvl in
+            [0-9] )
+                ;;
+            * ) echo &quot;$msgprefix:Error: invalid compression level \`$comp_lvl'&quot; 1&gt;&amp;2
+                shtool_exit 1
+                ;;
+        esac
+
+        #   determine a suitable compression tool
+        if [ &quot;.$comp_prg&quot; = . ]; then
+            #   check whether the test command supports the -x option
+            if [ -x /bin/sh ] 2&gt;/dev/null; then
+                minusx=&quot;-x&quot;
+            else
+                minusx=&quot;-r&quot;
+            fi
+            #   search for tools in $PATH
+            paths=&quot;`echo $PATH |\
+                    sed -e 's%/*:%:%g' -e 's%/*$%%' \
+                        -e 's/^:/.:/' -e 's/::/:.:/g' -e 's/:$/:./' \
+                        -e 's/:/ /g'`&quot;
+            for prg in bzip2 gzip compress; do
+                for path in $paths; do
+                    if [ $minusx &quot;$path/$prg&quot; ] &amp;&amp; [ ! -d &quot;$path/$prg&quot; ]; then
+                        comp_prg=&quot;$prg&quot;
+                        break
+                    fi
+                done
+                if [ &quot;.$comp_prg&quot; != . ]; then
+                    break
+                fi
+            done
+            if [ &quot;.$comp_prg&quot; = . ]; then
+                echo &quot;$msgprefix:Error: no suitable compression tool found in \$PATH&quot; 1&gt;&amp;2
+                shtool_exit 1
+            fi
+        fi
+
+        #   determine standard compression extension
+        #   and make sure it is a known tool
+        case $comp_prg in
+            */bzip2    | bzip2    ) comp_ext=&quot;bz2&quot; comp_lvl=&quot;-$comp_lvl&quot; ;;
+            */gzip     | gzip     ) comp_ext=&quot;gz&quot;  comp_lvl=&quot;-$comp_lvl&quot; ;;
+            */compress | compress ) comp_ext=&quot;Z&quot;;  comp_lvl=&quot;&quot;           ;;
+            * ) echo &quot;$msgprefix:Error: tool \`$comp_prg' is not a known compression tool&quot; 1&gt;&amp;2
+                shtool_exit 1
+                ;;
+        esac
+        comp_suf=&quot;.$comp_ext&quot;
+    fi
+
+    #   iterate over all given logfile arguments
+    for file in $*; do
+        #   make sure the logfile exists
+        if [ ! -f $file ]; then
+            if [ &quot;.$opt_f&quot; = .yes ]; then
+                continue
+            fi
+            echo &quot;$msgprefix:Error: logfile \`$file' not found&quot; 1&gt;&amp;2
+            shtool_exit 1
+        fi
+
+        #   determine log directory (where original logfile is placed)
+        ldir=&quot;.&quot;
+        case $file in
+            */* ) eval `echo $file | sed -e 's%^\(.*\)/\([^/]*\)$%ldir=&quot;\1&quot;; file=&quot;\2&quot;;%'` ;;
+        esac
+
+        #   determine archive directory (where rotated logfiles are placed)
+        adir=&quot;$ldir&quot;
+        if [ &quot;.$opt_a&quot; != . ]; then
+            case &quot;$opt_a&quot; in
+                /* | ./* ) adir=&quot;$opt_a&quot; ;;
+                * ) adir=&quot;$ldir/$opt_a&quot;  ;;
+            esac
+        fi
+
+        #   optionally take logfile size into account
+        if [ &quot;.$opt_s&quot; != . ]; then
+            #   determine size of logfile
+            set -- `env -i /bin/ls -l &quot;$ldir/$file&quot; | sed -e &quot;s;$ldir/$file;;&quot; |\
+                    sed -e 's; -&gt; .*$;;' -e 's;[         ][         ]*; ;g'`
+            n=`expr $# - 3`
+            eval &quot;size=\`echo \${$n}\`&quot;
+
+            #   skip logfile if size is still too small
+            if [ $size -lt $opt_s ]; then
+                if [ &quot;.$opt_v&quot; = .yes ]; then
+                    echo &quot;$ldir/$file: still too small in size -- skipping&quot;
+                fi
+                continue
+            fi
+        fi
+
+        #   verbosity
+        if [ &quot;.$opt_v&quot; = .yes ]; then
+            echo &quot;rotating $ldir/$file&quot;
+        fi
+
+        #   execute prolog
+        if [ &quot;.$opt_P&quot; != . ]; then
+            if [ &quot;.$opt_t&quot; = .yes ]; then
+                echo &quot;$opt_P&quot;
+            fi
+            eval $opt_P
+            [ $? -ne 0 ] &amp;&amp; shtool_exit $?
+        fi
+
+        #   kick away out-rotated logfile
+        n=`expr $opt_n - 1`
+        n=`echo dummy | awk &quot;{ printf(\&quot;%0${opt_p}d\&quot;, n); }&quot; n=$n`
+        if [ -f &quot;${adir}/${file}.${n}${comp_suf}&quot; ]; then
+            #   optionally migrate away the out-rotated logfile
+            if [ &quot;.$opt_M&quot; != . ]; then
+                if [ &quot;.$opt_t&quot; = .yes ]; then
+                    echo &quot;$opt_M ${adir}/${file}.${n}${comp_suf}&quot;
+                fi
+                eval &quot;$opt_M ${adir}/${file}.${n}${comp_suf}&quot;
+                [ $? -ne 0 ] &amp;&amp; shtool_exit $?
+            fi
+            #   finally get rid of the out-rotated logfile
+            if [ &quot;.$opt_t&quot; = .yes ]; then
+                echo &quot;rm -f ${adir}/${file}.${n}${comp_suf}&quot;
+            fi
+            rm -f ${adir}/${file}.${n}${comp_suf} || shtool_exit $?
+        fi
+
+        #   rotate already archived logfiles
+        while [ $n -gt 0 ]; do
+            m=$n
+            n=`expr $n - 1`
+            n=`echo dummy | awk &quot;{ printf(\&quot;%0${opt_p}d\&quot;, n); }&quot; n=$n`
+            if [ $n -eq 0 ] &amp;&amp; [ &quot;.$opt_d&quot; = .yes ]; then
+                #   special case: first rotation file under delayed compression situation
+                if [ ! -f &quot;${adir}/${file}.${n}&quot; ]; then
+                    continue
+                fi
+
+                #   compress file (delayed)
+                if [ &quot;.$opt_b&quot; = .yes ]; then
+                    if [ &quot;.$opt_t&quot; = .yes ]; then
+                        echo &quot;mv ${adir}/${file}.${n} ${adir}/${file}.${m}&quot;
+                    fi
+                    mv ${adir}/${file}.${n} ${adir}/${file}.${m} || shtool_exit $?
+                    if [ &quot;.$opt_t&quot; = .yes ]; then
+                        echo &quot;(${comp_prg} ${comp_lvl} &lt;${adir}/${file}.${m} &gt;${adir}/${file}.${m}${comp_suf}; rm -f ${adir}/${file}.${m}) &amp;&quot;
+                    fi
+                    ( ${comp_prg} ${comp_lvl} \
+                          &lt;${adir}/${file}.${m} \
+                          &gt;${adir}/${file}.${m}${comp_suf} || shtool_exit $?
+                      rm -f ${adir}/${file}.${m} || shtool_exit $?
+                    ) &lt;/dev/null &gt;/dev/null 2&gt;&amp;1 &amp;
+                else
+                    if [ &quot;.$opt_t&quot; = .yes ]; then
+                        echo &quot;${comp_prg} ${comp_lvl} &lt;${adir}/${file}.${n} &gt;${adir}/${file}.${m}${comp_suf}&quot;
+                    fi
+                    ${comp_prg} ${comp_lvl} \
+                        &lt;${adir}/${file}.${n} \
+                        &gt;${adir}/${file}.${m}${comp_suf} || shtool_exit $?
+                    if [ &quot;.$opt_t&quot; = .yes ]; then
+                        echo &quot;rm -f ${adir}/${file}.${n}&quot;
+                    fi
+                    rm -f ${adir}/${file}.${n} || shtool_exit $?
+                fi
+
+                #   fix file attributes
+                if [ &quot;.$opt_o&quot; != . ]; then
+                    if [ &quot;.$opt_t&quot; = .yes ]; then
+                        echo &quot;chown $opt_o ${adir}/${file}.${m}${comp_suf}&quot;
+                    fi
+                    chown $opt_o ${adir}/${file}.${m}${comp_suf} || shtool_exit $?
+                fi
+                if [ &quot;.$opt_g&quot; != . ]; then
+                    if [ &quot;.$opt_t&quot; = .yes ]; then
+                        echo &quot;chgrp $opt_g ${adir}/${file}.${m}${comp_suf}&quot;
+                    fi
+                    chgrp $opt_g ${adir}/${file}.${m}${comp_suf} || shtool_exit $?
+                fi
+                if [ &quot;.$opt_m&quot; != . ]; then
+                    if [ &quot;.$opt_t&quot; = .yes ]; then
+                        echo &quot;chmod $opt_m ${adir}/${file}.${m}${comp_suf}&quot;
+                    fi
+                    chmod $opt_m ${adir}/${file}.${m}${comp_suf} || shtool_exit $?
+                fi
+            else
+                #   standard case: second and following rotation file
+                if [ ! -f &quot;${adir}/${file}.${n}${comp_suf}&quot; ]; then
+                    continue
+                fi
+                if [ &quot;.$opt_t&quot; = .yes ]; then
+                    echo &quot;mv ${adir}/${file}.${n}${comp_suf} ${adir}/${file}.${m}${comp_suf}&quot;
+                fi
+                mv ${adir}/${file}.${n}${comp_suf} ${adir}/${file}.${m}${comp_suf} || shtool_exit $?
+            fi
+        done
+
+        #   move away current logfile
+        if [ &quot;.$opt_c&quot; = .yes ]; then
+            #   approach: copy[+truncate]
+            if [ &quot;.$opt_t&quot; = .yes ]; then
+                echo &quot;cp -p ${ldir}/${file} ${adir}/${file}.${n}&quot;
+            fi
+            cp -p ${ldir}/${file} ${adir}/${file}.${n} || shtool_exit $?
+            if [ &quot;.$opt_r&quot; = .no ]; then
+                if [ &quot;.$opt_t&quot; = .yes ]; then
+                    echo &quot;cp /dev/null ${ldir}/${file}&quot;
+                fi
+                cp /dev/null ${ldir}/${file} || shtool_exit $?
+            fi
+        else
+            #   approach: move[+touch]
+            if [ &quot;.$opt_t&quot; = .yes ]; then
+                echo &quot;mv ${ldir}/${file} ${adir}/${file}.${n}&quot;
+            fi
+            mv ${ldir}/${file} ${adir}/${file}.${n} || shtool_exit $?
+            if [ &quot;.$opt_r&quot; = .no ]; then
+                if [ &quot;.$opt_t&quot; = .yes ]; then
+                    echo &quot;touch ${ldir}/${file}&quot;
+                fi
+                touch ${ldir}/${file} || shtool_exit $?
+                #   fix file attributes
+                if [ &quot;.$opt_o&quot; != . ]; then
+                    if [ &quot;.$opt_t&quot; = .yes ]; then
+                        echo &quot;chown $opt_o ${ldir}/${file}&quot;
+                    fi
+                    chown $opt_o ${ldir}/${file} || shtool_exit $?
+                fi
+                if [ &quot;.$opt_g&quot; != . ]; then
+                    if [ &quot;.$opt_t&quot; = .yes ]; then
+                        echo &quot;chgrp $opt_g ${ldir}/${file}&quot;
+                    fi
+                    chgrp $opt_g ${ldir}/${file} || shtool_exit $?
+                fi
+                if [ &quot;.$opt_m&quot; != . ]; then
+                    if [ &quot;.$opt_t&quot; = .yes ]; then
+                        echo &quot;chmod $opt_m ${ldir}/${file}&quot;
+                    fi
+                    chmod $opt_m ${ldir}/${file} || shtool_exit $?
+                fi
+            fi
+        fi
+
+        #   regular compression step
+        if [ &quot;.$opt_z&quot; != . ] &amp;&amp; [ &quot;.$opt_d&quot; = .no ]; then
+            #   compress file
+            if [ &quot;.$opt_b&quot; = .yes ]; then
+                if [ &quot;.$opt_t&quot; = .yes ]; then
+                    echo &quot;(${comp_prg} ${comp_lvl} &lt;${adir}/${file}.${n} &gt;${adir}/${file}.${n}${comp_suf}; rm -f ${adir}/${file}.${n}) &amp;&quot;
+                fi
+                ( ${comp_prg} ${comp_lvl} \
+                      &lt;${adir}/${file}.${n} \
+                      &gt;${adir}/${file}.${n}${comp_suf} || shtool_exit $?
+                  rm -f ${adir}/${file}.${n} || shtool_exit $?
+                ) &lt;/dev/null &gt;/dev/null 2&gt;&amp;1 &amp;
+            else
+                if [ &quot;.$opt_t&quot; = .yes ]; then
+                    echo &quot;${comp_prg} ${comp_lvl} &lt;${adir}/${file}.${n} &gt;${adir}/${file}.${n}${comp_suf}&quot;
+                fi
+                ${comp_prg} ${comp_lvl} \
+                    &lt;${adir}/${file}.${n} \
+                    &gt;${adir}/${file}.${n}${comp_suf} || shtool_exit $?
+                if [ &quot;.$opt_t&quot; = .yes ]; then
+                    echo &quot;rm -f ${opt_a}${file}.${n}&quot;
+                fi
+                rm -f ${adir}/${file}.${n} || shtool_exit $?
+            fi
+
+            #   fix file attributes
+            if [ &quot;.$opt_o&quot; != . ]; then
+                if [ &quot;.$opt_t&quot; = .yes ]; then
+                    echo &quot;chown $opt_o ${adir}/${file}.${n}${comp_suf}&quot;
+                fi
+                chown $opt_o ${adir}/${file}.${n}${comp_suf} || shtool_exit $?
+            fi
+            if [ &quot;.$opt_g&quot; != . ]; then
+                if [ &quot;.$opt_t&quot; = .yes ]; then
+                    echo &quot;chgrp $opt_g ${adir}/${file}.${n}${comp_suf}&quot;
+                fi
+                chgrp $opt_g ${adir}/${file}.${n}${comp_suf} || shtool_exit $?
+            fi
+            if [ &quot;.$opt_m&quot; != . ]; then
+                if [ &quot;.$opt_t&quot; = .yes ]; then
+                    echo &quot;chmod $opt_m ${adir}/${file}.${n}${comp_suf}&quot;
+                fi
+                chmod $opt_m ${adir}/${file}.${n}${comp_suf} || shtool_exit $?
+            fi
+        fi
+
+        #   execute epilog
+        if [ &quot;.$opt_E&quot; != . ]; then
+            if [ &quot;.$opt_t&quot; = .yes ]; then
+                echo &quot;$opt_E&quot;
+            fi
+            eval $opt_E
+            [ $? -ne 0 ] &amp;&amp; shtool_exit $?
+        fi
+    done
+
+    shtool_exit 0
+    ;;
+
+tarball )
+    ##
+    ##  tarball -- Roll distribution tarballs
+    ##  Copyright (c) 1999-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+    ##
+
+    srcs=&quot;$*&quot;
+
+    #   check whether the test command supports the -x option
+    if [ -x /bin/sh ] 2&gt;/dev/null; then
+        minusx=&quot;-x&quot;
+    else
+        minusx=&quot;-r&quot;
+    fi
+
+    #   find the tools
+    paths=&quot;`echo $PATH |\
+            sed -e 's%/*:%:%g' -e 's%/*$%%' \
+                -e 's/^:/.:/' -e 's/::/:.:/g' -e 's/:$/:./' \
+                -e 's/:/ /g'`&quot;
+    for spec in find:gfind,find tar:gtar,tar tardy:tardy,tarcust; do
+        prg=`echo $spec | sed -e 's/:.*$//'`
+        tools=`echo $spec | sed -e 's/^.*://'`
+        eval &quot;prg_${prg}=''&quot;
+        #   iterate over tools
+        for tool in `echo $tools | sed -e 's/,/ /g'`; do
+            #   iterate over paths
+            for path in $paths; do
+                if [ $minusx &quot;$path/$tool&quot; ] &amp;&amp; [ ! -d &quot;$path/$tool&quot; ]; then
+                    eval &quot;prg_${prg}=\&quot;$path/$tool\&quot;&quot;
+                    break
+                fi
+            done
+            eval &quot;val=\$prg_${prg}&quot;
+            if [ &quot;.$val&quot; != . ]; then
+                break
+            fi
+        done
+    done
+
+    #   expand source paths
+    exclude=''
+    for pat in `echo $opt_e | sed 's/,/ /g'`; do
+        exclude=&quot;$exclude | grep -v '$pat'&quot;
+    done
+    if [ &quot;.$opt_t&quot; = .yes ]; then
+        echo &quot;cp /dev/null $tmpfile.lst&quot; 1&gt;&amp;2
+    fi
+    cp /dev/null $tmpfile.lst
+    for src in $srcs; do
+        if [ -d $src ]; then
+            if [ &quot;.$opt_t&quot; = .yes ]; then
+                echo &quot;(cd $src &amp;&amp; $prg_find . -type f -depth -print) | sed -e 's:^\\.\$::' -e 's:^\\./::' | cat $exclude &gt;&gt;$tmpfile.lst&quot; 1&gt;&amp;2
+            fi
+            (cd $src &amp;&amp; $prg_find . -type f -depth -print) |\
+            sed -e 's:^\.$::' -e 's:^\./::' | eval cat $exclude &gt;&gt;$tmpfile.lst
+        else
+            if [ &quot;.$opt_t&quot; = .yes ]; then
+                echo &quot;echo $src &gt;&gt;$tmpfile.lst&quot; 1&gt;&amp;2
+            fi
+            echo $src &gt;&gt;$tmpfile.lst
+        fi
+    done
+    sort &lt;$tmpfile.lst &gt;$tmpfile.lst.n
+    mv $tmpfile.lst.n $tmpfile.lst
+    if [ &quot;.$opt_v&quot; = .yes ]; then
+        cat $tmpfile.lst | sed -e 's/^/  /' 1&gt;&amp;2
+    fi
+
+    #   determine tarball file and directory name
+    if [ &quot;.$opt_o&quot; != . ]; then
+        tarfile=&quot;$opt_o&quot;
+        if [ &quot;.$opt_d&quot; != . ]; then
+            tarname=&quot;$opt_d&quot;
+        else
+            tarname=`echo $tarfile | sed -e 's/\.tar.*$//' -e 's;.*/\([^/]*\)$;\1;'`
+        fi
+    else
+        if [ &quot;.$opt_d&quot; != . ]; then
+            tarname=&quot;$opt_d&quot;
+        elif [ -d &quot;$from&quot; ]; then
+            tarname=`echo $from | sed -e 's;.*/\([^/]*\)$;\1;'`
+        else
+            tarname=&quot;out&quot;
+        fi
+        tarfile=&quot;$tarname.tar&quot;
+    fi
+
+    #   roll the tarball
+    compress=''
+    if [ &quot;.$opt_c&quot; != . ]; then
+        compress=&quot;| $opt_c&quot;
+    fi
+    if [ &quot;.$prg_tardy&quot; != . ]; then
+        #   the elegant hackers way
+        tardy_opt=&quot;--prefix=$tarname&quot;
+        tardy_opt=&quot;$tardy_opt --user_number=0 --group_number=0&quot; # security!
+        if [ &quot;.$opt_u&quot; != . ]; then
+            tardy_opt=&quot;$tardy_opt --user_name=$opt_u&quot;
+        fi
+        if [ &quot;.$opt_g&quot; != . ]; then
+            tardy_opt=&quot;$tardy_opt --group_name=$opt_g&quot;
+        fi
+        if [ &quot;.$opt_t&quot; = .yes ]; then
+            echo &quot;cat $tmpfile.lst | xargs $prg_tar cf - | $prg_tardy $tardy_opt | cat $compress &gt;$tmpfile.out&quot; 1&gt;&amp;2
+        fi
+        cat $tmpfile.lst |\
+        xargs $prg_tar cf - |\
+        $prg_tardy $tardy_opt |\
+        eval cat $compress &gt;$tmpfile.out
+        if [ &quot;.$opt_t&quot; = .yes ]; then
+            echo &quot;cp $tmpfile.out $tarfile&quot; 1&gt;&amp;2
+        fi
+        cp $tmpfile.out $tarfile
+    else
+        #  the portable standard way
+        if [ &quot;.$opt_t&quot; = .yes ]; then
+            echo &quot;mkdir $tmpdir/$tarname&quot; 1&gt;&amp;2
+        fi
+        mkdir $tmpdir/$tarname || shtool_exit 1
+        if [ &quot;.$opt_t&quot; = .yes ]; then
+            echo &quot;cat $tmpfile.lst | xargs $prg_tar cf - | (cd $tmpdir/$tarname &amp;&amp; $prg_tar xf -)&quot; 1&gt;&amp;2
+        fi
+        cat $tmpfile.lst |\
+        xargs $prg_tar cf - |\
+        (cd $tmpdir/$tarname &amp;&amp; $prg_tar xf -)
+        if [ &quot;.$opt_u&quot; != . ]; then
+            if [ &quot;.$opt_t&quot; = .yes ]; then
+                echo &quot;chown -R $opt_u $tmpdir/$tarname &gt;/dev/null 2&gt;&amp;1&quot; 2&gt;&amp;1
+            fi
+            chown -R $opt_u $tmpdir/$tarname &gt;/dev/null 2&gt;&amp;1 ||\
+            echo &quot;$msgprefix:Warning: cannot set user name \`$opt_u' (would require root privileges)&quot;
+        fi
+        if [ &quot;.$opt_g&quot; != . ]; then
+            if [ &quot;.$opt_t&quot; = .yes ]; then
+                echo &quot;chgrp -R $opt_g $tmpdir/$tarname &gt;/dev/null 2&gt;&amp;1&quot; 2&gt;&amp;1
+            fi
+            chgrp -R $opt_g $tmpdir/$tarname &gt;/dev/null 2&gt;&amp;1 ||\
+            echo &quot;$msgprefix:Warning: cannot set group name \`$opt_g' (would require root privileges)&quot;
+        fi
+        if [ &quot;.$opt_t&quot; = .yes ]; then
+            echo &quot;(cd $tmpdir &amp;&amp; $prg_find $tarname -type f -depth -print | sort | xargs $prg_tar cf -) | cat $compress &gt;$tmpfile.out&quot; 1&gt;&amp;2
+        fi
+        (cd $tmpdir &amp;&amp; $prg_find $tarname -type f -depth -print | sort | xargs $prg_tar cf -) |\
+        eval cat $compress &gt;$tmpfile.out
+        if [ &quot;.$opt_t&quot; = .yes ]; then
+            echo &quot;cp $tmpfile.out $tarfile&quot; 1&gt;&amp;2
+        fi
+        cp $tmpfile.out $tarfile
+        if [ &quot;.$opt_t&quot; = .yes ]; then
+            echo &quot;rm -rf $tmpdir/$tarname&quot; 1&gt;&amp;2
+        fi
+        rm -rf $tmpdir/$tarname
+    fi
+
+    #   cleanup
+    if [ &quot;.$opt_t&quot; = .yes ]; then
+        echo &quot;rm -f $tmpfile.lst $tmpfile.out&quot; 1&gt;&amp;2
+    fi
+    rm -f $tmpfile.lst $tmpfile.out
+
+    shtool_exit 0
+    ;;
+
+subst )
+    ##
+    ##  subst -- Apply sed(1) substitution operations
+    ##  Copyright (c) 2001-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+    ##
+
+    #   remember optional list of file(s)
+    files=&quot;$*&quot;
+    files_num=&quot;$#&quot;
+
+    #   parameter consistency check
+    if [ $# -eq 0 ] &amp;&amp; [ &quot;.$opt_b&quot; != . ]; then
+        echo &quot;$msgprefix:Error: option -b cannot be applied to stdin&quot; 1&gt;&amp;2
+        shtool_exit 1
+    fi
+    if [ $# -eq 0 ] &amp;&amp; [ &quot;.$opt_s&quot; = .yes ]; then
+        echo &quot;$msgprefix:Error: option -s cannot be applied to stdin&quot; 1&gt;&amp;2
+        shtool_exit 1
+    fi
+
+    #   build underlying sed(1) command
+    sedcmd='sed'
+    if [ &quot;.$opt_e&quot; != . ]; then
+        OIFS=&quot;$IFS&quot;; IFS=&quot;$ASC_NL&quot;; set -- $opt_e; IFS=&quot;$OIFS&quot;
+        for e
+        do
+            sedcmd=&quot;$sedcmd -e '$e'&quot;
+        done
+    elif [ &quot;.$opt_f&quot; != . ]; then
+        if [ ! -f $opt_f ]; then
+            echo &quot;$msgprefix:Error: command file \`$opt_f' not found or not a regular file&quot; 1&gt;&amp;2
+            shtool_exit 1
+        fi
+        sedcmd=&quot;$sedcmd -f '$opt_f'&quot;
+    else
+        echo &quot;$msgprefix:Error: either -e option(s) or -f option required&quot; 1&gt;&amp;2
+        shtool_exit 1
+    fi
+
+    #   determine extension for original file
+    orig=&quot;.orig&quot;
+    if [ &quot;.$opt_b&quot; != . ]; then
+        orig=&quot;$opt_b&quot;
+    fi
+
+    #   apply sed(1) operation(s)
+    if [ &quot;.$files&quot; != . ]; then
+        #   apply operation(s) to files
+        substdone=no
+        for file in $files; do
+            test &quot;.$file&quot; = . &amp;&amp; continue
+            if [ ! -f $file ]; then
+                echo &quot;$msgprefix:Warning: file \`$file' not found or not a regular file&quot; 1&gt;&amp;2
+                continue
+            fi
+
+            #   handle interactive mode
+            if [ &quot;.$opt_i&quot; = .yes ]; then
+                eval &quot;$sedcmd &lt;$file &gt;$file.new&quot;
+                skip=no
+                if cmp $file $file.new &gt;/dev/null 2&gt;&amp;1; then
+                    rm -f $file.new
+                    skip=yes
+                else
+                    (diff -U1 $file $file.new &gt;$tmpfile) 2&gt;/dev/null
+                    if [ &quot;.`cat $tmpfile`&quot; = . ]; then
+                        (diff -C1 $file $file.new &gt;$tmpfile) 2&gt;/dev/null
+                        if [ &quot;.`cat $tmpfile`&quot; = . ]; then
+                            echo &quot;$msgprefix:Warning: unable to show difference for file \`$file'&quot; 1&gt;&amp;2
+                            cp /dev/null $tmpfile
+                        fi
+                    fi
+                    rm -f $file.new
+                    cat $tmpfile
+                    echo dummy | awk '{ printf(&quot;%s&quot;, TEXT); }' TEXT=&quot;&gt;&gt;&gt; Apply [Y/n]: &quot;
+                    read input
+                    if [ &quot;.$input&quot; != .Y ] &amp;&amp;\
+                       [ &quot;.$input&quot; != .y ] &amp;&amp;\
+                       [ &quot;.$input&quot; != . ]; then
+                       skip=yes
+                    fi
+                fi
+                if [ &quot;.$skip&quot; = .yes ]; then
+                    if [ &quot;.$opt_v&quot; = .yes ]; then
+                        echo &quot;file \`$file' -- skipped&quot; 1&gt;&amp;2
+                    fi
+                    continue
+                fi
+            fi
+
+            #   apply sed(1) operation(s)
+            if [ &quot;.$opt_v&quot; = .yes ]; then
+                echo &quot;patching \`$file'&quot; 1&gt;&amp;2
+            fi
+            if [ &quot;.$opt_t&quot; = .yes ]; then
+                echo &quot;\$ cp -p $file $file$orig&quot;
+                echo &quot;\$ chmod u+w $file&quot;
+                echo &quot;\$ $sedcmd &lt;$file$orig &gt;$file&quot;
+            fi
+            if [ &quot;.$opt_n&quot; = .no ]; then
+                cp -p $file $file$orig
+                chmod u+w $file &gt;/dev/null 2&gt;&amp;1 || true
+                eval &quot;$sedcmd &lt;$file$orig &gt;$file&quot;
+            fi
+
+            #   optionally fix timestamp
+            if [ &quot;.$opt_s&quot; = .yes ]; then
+                if [ &quot;.$opt_t&quot; = .yes ]; then
+                    echo &quot;\$ touch -r $file$orig $file&quot;
+                fi
+                if [ &quot;.$opt_n&quot; = .no ]; then
+                    touch -r $file$orig $file
+                fi
+            fi
+
+            #   optionally check whether any content change actually occurred 
+            if [ &quot;.$opt_q&quot; = .no ]; then
+                if cmp $file$orig $file &gt;/dev/null 2&gt;&amp;1; then
+                    if [ &quot;.$opt_w&quot; = .yes ]; then
+                        echo &quot;$msgprefix:Warning: substitution resulted in no content change on file \&quot;$file\&quot;&quot; 1&gt;&amp;2
+                    fi
+                else
+                    substdone=yes
+                fi
+            fi
+
+            #   optionally remove preserved original file
+            if [ &quot;.$opt_b&quot; = . ]; then
+                if [ &quot;.$opt_t&quot; = .yes ]; then
+                    echo &quot;\$ rm -f $file$orig&quot;
+                fi
+                if [ &quot;.$opt_n&quot; = .no ]; then
+                    rm -f $file$orig
+                fi
+            fi
+        done
+        if [ &quot;.$opt_q&quot; = .no ] &amp;&amp; [ &quot;.$opt_w&quot; = .no ]; then
+            if [ &quot;.$substdone&quot; = .no ]; then
+                if [ &quot;.$files_num&quot; = .1 ]; then
+                    echo &quot;$msgprefix:Warning: substitution resulted in no content change on file \&quot;$file\&quot;&quot; 1&gt;&amp;2
+                else
+                    echo &quot;$msgprefix:Warning: substitution resulted in no content change on any file&quot; 1&gt;&amp;2
+                fi
+            fi
+        fi
+    else
+        #   apply operation(s) to stdin/stdout
+        if [ &quot;.$opt_v&quot; = .yes ]; then
+            echo &quot;patching &lt;stdin&gt;&quot; 1&gt;&amp;2
+        fi
+        if [ &quot;.$opt_t&quot; = .yes ]; then
+            echo &quot;\$ $sedcmd&quot;
+        fi
+        if [ &quot;.$opt_n&quot; = .no ]; then
+            eval &quot;$sedcmd&quot;
+        fi
+    fi
+
+    shtool_exit 0
+    ;;
+
+platform )
+    ##
+    ##  platform -- Platform Identification Utility
+    ##  Copyright (c) 2003-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+    ##
+
+    #   option post-processing
+    if [ &quot;.$opt_t&quot; != . ]; then
+        case &quot;$opt_t&quot; in
+            binary )
+                #   binary package id (OpenPKG RPM)
+                opt_F=&quot;%&lt;ap&gt;-%&lt;sp&gt;&quot;
+                opt_L=yes
+                opt_S=&quot;&quot;
+                opt_C=&quot;+&quot;
+                ;;
+            build )
+                #   build time checking (OpenPKG RPM)
+                opt_F=&quot;%&lt;at&gt;-%&lt;st&gt;&quot;
+                opt_L=yes
+                opt_S=&quot;&quot;
+                opt_C=&quot;+&quot;
+                ;;
+            gnu )
+                #   GNU config.guess style &lt;arch&gt;-&lt;vendor&gt;-&lt;os&gt;&lt;osversion&gt;
+                opt_F=&quot;%&lt;at&gt;-unknown-%&lt;st&gt;&quot;
+                opt_L=yes
+                opt_S=&quot;&quot;
+                opt_C=&quot;+&quot;
+                ;;
+            web )
+                #   non-whitespace HTTP Server-header id
+                opt_F=&quot;%&lt;sp&gt;-%&lt;ap&gt;&quot;
+                opt_S=&quot;/&quot;
+                opt_C=&quot;+&quot;
+                ;;
+            summary)
+                #   human readable verbose summary information
+                opt_F=&quot;Class:      %[sc] (%[ac])\\nProduct:    %[sp] (%[ap])\\nTechnology: %[st] (%[at])&quot;
+                opt_S=&quot; &quot;
+                opt_C=&quot;/&quot;
+                ;;
+            all-in-one )
+                #   full-table all-in-one information
+                opt_F=&quot;&quot;
+                opt_F=&quot;${opt_F}concise architecture class:      %&lt;ac&gt;\\n&quot;
+                opt_F=&quot;${opt_F}regular architecture class:      %{ac}\\n&quot;
+                opt_F=&quot;${opt_F}verbose architecture class:      %[ac]\\n&quot;
+                opt_F=&quot;${opt_F}concise architecture product:    %&lt;ap&gt;\\n&quot;
+                opt_F=&quot;${opt_F}regular architecture product:    %{ap}\\n&quot;
+                opt_F=&quot;${opt_F}verbose architecture product:    %[ap]\\n&quot;
+                opt_F=&quot;${opt_F}concise architecture technology: %&lt;at&gt;\\n&quot;
+                opt_F=&quot;${opt_F}regular architecture technology: %{at}\\n&quot;
+                opt_F=&quot;${opt_F}verbose architecture technology: %[at]\\n&quot;
+                opt_F=&quot;${opt_F}concise system class:            %&lt;sc&gt;\\n&quot;
+                opt_F=&quot;${opt_F}regular system class:            %{sc}\\n&quot;
+                opt_F=&quot;${opt_F}verbose system class:            %[sc]\\n&quot;
+                opt_F=&quot;${opt_F}concise system product:          %&lt;sp&gt;\\n&quot;
+                opt_F=&quot;${opt_F}regular system product:          %{sp}\\n&quot;
+                opt_F=&quot;${opt_F}verbose system product:          %[sp]\\n&quot;
+                opt_F=&quot;${opt_F}concise system technology:       %&lt;st&gt;\\n&quot;
+                opt_F=&quot;${opt_F}regular system technology:       %{st}\\n&quot;
+                opt_F=&quot;${opt_F}verbose system technology:       %[st]&quot;
+                ;;
+            * )
+                echo &quot;$msgprefix:Error: invalid type \`$opt_t'&quot; 1&gt;&amp;2
+                exit 1
+                ;;
+        esac
+    fi
+
+    #   assemble initial platform information
+    UNAME_MACHINE=`(uname -m) 2&gt;/dev/null` ||\
+    UNAME_MACHINE=`(uname -p) 2&gt;/dev/null` ||\
+    UNAME_MACHINE='unknown'
+    UNAME_SYSTEM=`(uname -s) 2&gt;/dev/null`  ||\
+    UNAME_SYSTEM='unknown'
+    UNAME_RELEASE=`(uname -r) 2&gt;/dev/null` ||\
+    UNAME_RELEASE=`(uname -v) 2&gt;/dev/null` ||\
+    UNAME_RELEASE='unknown'
+
+    UNAME=&quot;${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}&quot;
+
+    AC=&quot;&quot;; AP=&quot;&quot;; AT=&quot;&quot;
+    SC=&quot;&quot;; SP=&quot;&quot;; ST=&quot;&quot;
+
+    #    dispatch into platform specific sections
+    case &quot;${UNAME}&quot; in
+
+        #   FreeBSD
+        *:FreeBSD:* )
+            #   determine architecture
+            AC=&quot;${UNAME_MACHINE}&quot;
+            case &quot;${AC}&quot; in
+                i386 ) AC=&quot;iX86&quot; ;;
+            esac
+            AP=&quot;${AC}&quot;
+            AT=&quot;${AP}&quot;
+            if [ &quot;.${AT}&quot; = &quot;.iX86&quot; ]; then
+                case &quot;`(/sbin/sysctl -n hw.model) 2&gt;&amp;1`&quot; in
+                    *&quot;Xeon&quot;* | *&quot;Pentium Pro&quot;* | *&quot;Cyrix 6x86MX&quot;* | *&quot;Pentium II&quot;* | *&quot;Pentium III&quot;* | *&quot;Pentium 4&quot;* | *&quot;Celeron&quot;* ) AT=&quot;i686&quot; ;;
+                    *&quot;Pentium&quot;* ) AT=&quot;i586&quot; ;; *&quot;i486[SD]X&quot;* | *&quot;Cyrix 486&quot;* | *&quot;Cyrix [56]x86&quot;* | *&quot;Blue Lightning&quot; | *&quot;Cyrix 486S/DX&quot; ) AT=&quot;i486&quot; ;;
+                    *&quot;i386[SD]X&quot;* | *&quot;NexGen 586&quot;* ) AT=&quot;i386&quot; ;;
+                esac
+            fi
+            #   determine system
+            r=`echo &quot;${UNAME_RELEASE}&quot; |\
+               sed -e 's;[()];;' -e 's/\(-.*\)$/[\1]/'`
+            ST=&quot;FreeBSD ${r}&quot;
+            SP=&quot;${ST}&quot;
+            case &quot;${r}&quot; in
+                1.* ) SC=&quot;4.3BSD&quot; ;;
+                *   ) SC=&quot;4.4BSD&quot; ;;
+            esac
+            ;;
+
+        #   NetBSD
+        *:NetBSD:* )
+            #   determine architecture
+            AT=&quot;${UNAME_MACHINE}&quot;
+            AP=&quot;${AT}&quot;
+            case &quot;${AP}&quot; in
+                i[3-6]86 ) AP=&quot;iX86&quot; ;;
+            esac
+            AC=&quot;${AP}&quot;
+            #   determine system
+            r=`echo &quot;${UNAME_RELEASE}&quot; | sed -e 's/\([-_].*\)$/[\1]/'`
+            ST=&quot;NetBSD ${r}&quot;
+            SP=&quot;${ST}&quot;
+            case &quot;${r}&quot; in
+                0.* ) SC=&quot;4.3BSD&quot; ;;
+                *   ) SC=&quot;4.4BSD&quot; ;;
+            esac
+            ;;
+
+        #   OpenBSD
+        *:OpenBSD:* )
+            #   determine architecture
+            AT=&quot;${UNAME_MACHINE}&quot;
+            AP=&quot;${AT}&quot;
+            case &quot;${AP}&quot; in
+                i[3-6]86 ) AP=&quot;iX86&quot; ;;
+            esac
+            AC=&quot;${AP}&quot;
+            #   determine system
+            r=`echo &quot;${UNAME_RELEASE}&quot; | sed -e 's/\([-_].*\)$/[\1]/'`
+            ST=&quot;OpenBSD ${r}&quot;
+            SP=&quot;${ST}&quot;
+            SC=&quot;4.4BSD&quot;
+            ;;
+
+        #   GNU/Linux
+        *:Linux:* )
+            #   determine architecture
+            AT=&quot;${UNAME_MACHINE}&quot;
+            case &quot;${AT}&quot; in
+               ia64     ) AT=&quot;IA64&quot;   ;;
+               x86_64   ) AT='AMD64'  ;;
+               parisc   ) AT=&quot;HPPA32&quot; ;;
+               parisc64 ) AT=&quot;HPPA64&quot; ;;
+            esac
+            AP=&quot;${AT}&quot;
+            case &quot;${AP}&quot; in
+               i[3-6]86 ) AP='iX86' ;;
+            esac
+            AC=&quot;${AP}&quot;
+            #   determine system
+            v_kern=`echo &quot;${UNAME_RELEASE}&quot; |\
+                sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/'`
+            v_libc=`(strings /lib/libc.so.* | grep '^GLIBC_' | sed -e 's/^GLIBC_//' |\
+                env -i sort -n | sed -n -e '$p' | sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/') 2&gt;/dev/null`
+            ST=&quot;GNU/&lt;Linux &gt;${v_libc}/&lt;${v_kern}&gt;&quot;
+            if [ -f /etc/lsb-release ]; then
+                eval `( . /etc/lsb-release
+                    echo &quot;SC=\&quot;LSB${LSB_VERSION}\&quot;&quot;
+                    if [ &quot;.${DISTRIB_ID}&quot; != . -a &quot;.${DISTRIB_RELEASE}&quot; != . ]; then
+                        echo &quot;SP=\&quot;${DISTRIB_ID} ${DISTRIB_RELEASE}\&quot;&quot;
+                    fi
+                ) 2&gt;/dev/null`
+            fi
+            if [ &quot;.$SP&quot; = . ]; then
+                for tagfile in x \
+                    `cd /etc &amp;&amp; \
+                    /bin/ls *[_-]release *[_-]version 2&gt;/dev/null | env -i sort | \
+                    sed -e '/^redhat-release$/d' -e '/^lsb-release$/d'; \
+                    echo redhat-release lsb-release`
+                do
+                    [ &quot;.${tagfile}&quot; = .x ] &amp;&amp; continue
+                    [ ! -f &quot;/etc/${tagfile}&quot; ] &amp;&amp; continue
+                    n=`echo ${tagfile} | sed -e 's/[_-]release$//' -e 's/[_-]version$//'`
+                    v=`(grep VERSION /etc/${tagfile}; cat /etc/${tagfile}) | grep '[0-9]' | sed -e 'q' |\
+                       sed -e 's/^/#/' \
+                           -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
+                           -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
+                           -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \
+                           -e 's/^#.*$//'`
+                    case &quot;`util_lower ${n}`&quot; in
+                        redhat )
+                            if [ &quot;.`grep 'Red Hat Enterprise Linux' /etc/${tagfile}`&quot; != . ]; then
+                                n=&quot;&lt;R&gt;ed &lt;H&gt;at &lt;E&gt;nterprise &lt;L&gt;inux&quot;
+                            else
+                                n=&quot;&lt;R&gt;ed &lt;H&gt;at &lt;L&gt;inux&quot;
+                            fi
+                            ;;
+                        debian             ) n=&quot;Debian[ GNU/Linux]&quot;        ;;
+                        ubuntu             ) n=&quot;Ubuntu[ GNU/Linux]&quot;        ;;
+                        fedora             ) n=&quot;&lt;Fedora&gt; Core[ GNU/Linux]&quot; ;;
+                        suse               ) n=&quot;SuSE[ Linux]&quot;              ;;
+                        mandrake*|mandriva ) n=&quot;Mandriva[ Linux]&quot;          ;;
+                        gentoo             ) n=&quot;Gentoo[ GNU/Linux]&quot;        ;;
+                        slackware          ) n=&quot;Slackware[ Linux]&quot;         ;;
+                        turbolinux         ) n=&quot;TurboLinux&quot;                ;;
+                        unitedlinux        ) n=&quot;UnitedLinux&quot;               ;;
+                        *                  ) n=&quot;${n}[ GNU/Linux]&quot;          ;;
+                    esac
+                    case &quot;$n&quot; in
+                        *&quot;&lt;&quot;*&quot;&gt;&quot;* ) SP=&quot;$n &lt;$v&gt;&quot; ;;
+                        *         ) SP=&quot;$n $v&quot;   ;;
+                    esac
+                    break
+                done
+            fi
+            [ &quot;.$SP&quot; = . ] &amp;&amp; SP=&quot;${ST}&quot;
+            [ &quot;.$SC&quot; = . ] &amp;&amp; SC=&quot;LSB&quot;
+            ;;
+
+        #   Sun Solaris
+        *:SunOS:* )
+            #   determine architecture
+            AT=&quot;${UNAME_MACHINE}&quot;
+            case &quot;${AT}&quot; in
+                i86pc )
+                    AT=&quot;iX86&quot;
+                    case &quot;`(/bin/isainfo -k) 2&gt;&amp;1`&quot; in
+                        amd64 ) AT=&quot;AMD64&quot; ;;
+                    esac
+                    ;;
+            esac
+            AP=&quot;${AT}&quot;
+            case &quot;${AP}&quot; in
+                sun4[cdm] ) AP=&quot;SPARC32&quot; ;;
+                sun4[uv]  ) AP=&quot;SPARC64&quot; ;;
+                sun4*     ) AP=&quot;SPARC&quot;   ;;
+            esac
+            AC=&quot;${AP}&quot;
+            case &quot;${AC}&quot; in
+                SPARC* ) AC=&quot;SPARC&quot; ;;
+            esac
+            #   determine system
+            ST=&quot;[Sun ]SunOS ${UNAME_RELEASE}&quot;
+            v=`echo &quot;${UNAME_RELEASE}&quot; |\
+               sed -e 's;^4\.;1.;' \
+                   -e 's;^5\.\([0-6]\)[^0-9]*$;2.\1;' \
+                   -e 's;^5\.\([0-9][0-9]*\).*;\1;'`
+            SP=&quot;[Sun ]Solaris $v&quot;
+            case &quot;${UNAME_RELEASE}&quot; in
+                4.* ) SC=&quot;4.3BSD&quot; ;;
+                5.* ) SC=&quot;SVR4&quot;   ;;
+            esac
+            ;;
+
+        #   SCO UnixWare
+        *:UnixWare:* )
+            #   determine architecture
+            AT=&quot;${UNAME_MACHINE}&quot;
+            case &quot;${AT}&quot; in
+                i[3-6]86 | ix86at ) AT=&quot;iX86&quot; ;;
+            esac
+            AP=&quot;${AT}&quot;
+            #   determine system
+            v=`/sbin/uname -v`
+            ST=&quot;[SCO ]UnixWare ${v}&quot;
+            SP=&quot;${ST}&quot;
+            SC=&quot;SVR${UNAME_RELEASE}&quot;
+            ;;
+
+        #   QNX
+        *:QNX:* )
+            #   determine architecture
+            AT=&quot;${UNAME_MACHINE}&quot;
+            case &quot;${AT}&quot; in
+                x86pc ) AT=&quot;iX86&quot; ;;
+            esac
+            AP=&quot;${AT}&quot;
+            #   determine system
+            v=&quot;${UNAME_RELEASE}&quot;
+            ST=&quot;QNX[ Neutrino RTOS] ${v}&quot;
+            v=`echo &quot;${v}&quot; | sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\).*$;\1;'`
+            SP=&quot;QNX[ Neutrino RTOS] ${v}&quot;
+            SC=&quot;QNX&quot;
+            ;;
+
+        #   SGI IRIX
+        *:IRIX*:* )
+            #   determine architecture
+            AT=&quot;${UNAME_MACHINE}&quot;
+            AP=&quot;${AT}&quot;
+            case &quot;${AP}:${UNAME_SYSTEM}&quot; in
+                IP*:IRIX64 ) AP=&quot;MIPS64&quot; ;;
+                IP*:*      ) AP=&quot;MIPS&quot;   ;;
+            esac
+            AC=&quot;${AP}&quot;
+            #   determine system
+            v=`(/bin/uname -R || /bin/uname -r) 2&gt;/dev/null | sed -e 's;[0-9.]* ;;'`
+            ST=&quot;[SGI ]IRIX ${v}&quot;
+            v=&quot;${UNAME_RELEASE}&quot;
+            SP=&quot;[SGI ]IRIX ${v}&quot;
+            SC=&quot;4.2BSD/SVR3&quot;
+            ;;
+
+        #   HP HP-UX
+        *:HP-UX:* )
+            #   determine architecture
+            AT=&quot;${UNAME_MACHINE}&quot;
+            case &quot;${AT}&quot; in
+                ia64 ) AT=&quot;IA64&quot; ;;
+                9000/[34]?? ) AT=M68K ;;
+                9000/[678][0-9][0-9])
+                    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2&gt;/dev/null`
+                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2&gt;/dev/null`
+                    case &quot;${sc_cpu_version}&quot; in
+                        523 ) AT=&quot;HPPA1.0&quot; ;;
+                        528 ) AT=&quot;HPPA1.1&quot; ;;
+                        532 ) AT=&quot;HPPA2.0&quot;
+                            case &quot;${sc_kernel_bits}&quot; in
+                                32 ) AT=&quot;${AT}n&quot; ;;
+                                64 ) AT=&quot;${AT}w&quot; ;;
+                            esac
+                            ;;
+                    esac
+                    ;;
+            esac
+            AP=&quot;${AT}&quot;
+            case &quot;${AP}&quot; in
+                HPPA* ) AP=&quot;HPPA&quot; ;;
+            esac
+            AC=&quot;${AP}&quot;
+            #   determine system
+            v=`echo &quot;${UNAME_RELEASE}&quot; | sed -e 's;^[^0-9]*;;'`
+            ST=&quot;[HP ]&lt;HP&gt;-&lt;UX ${v}&gt;&quot;
+            SP=&quot;${ST}&quot;
+            case &quot;${v}&quot; in
+                10.*   ) SC=&quot;SVR4.2&quot; ;;
+                [7-9]* ) SC=&quot;SVR4&quot;   ;;
+            esac
+            ;;
+
+        #   HP Tru64 (OSF1)
+        *:OSF1:* )
+            #   determine architecture
+            AP=&quot;${UNAME_MACHINE}&quot;
+            case &quot;${AP}&quot; in
+                alpha ) AP=&quot;Alpha&quot; ;;
+            esac
+            alpha_type=`(/usr/sbin/psrinfo -v) 2&gt;/dev/null |\
+                sed -n -e 's/^.*The alpha \([^ ][^ ]*\).*processor.*$/\1/p' | sed -e 'q'`
+            AT=&quot;${AP}${alpha_type}&quot;
+            AC=&quot;${AP}&quot;
+            #   determine system
+            v=`echo &quot;${UNAME_RELEASE}&quot; | sed -e 's;^[VTX];;'`
+            ST=&quot;[HP ]Tru64 ${v}&quot;
+            SP=&quot;${ST}&quot;
+            SC=&quot;OSF1&quot;
+            ;;
+
+        #   IBM AIX
+        *:AIX:* )
+            cpu_arch=rs6000
+            if [ -x /usr/sbin/lsdev -a -x /usr/sbin/lsattr ]; then
+                cpu_id=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+                if [ &quot;.`/usr/sbin/lsattr -El ${cpu_id} | grep -i powerpc`&quot; != . ]; then
+                    cpu_arch=powerpc
+                fi
+            elif [ -d /QOpenSys ]; then
+                #   IBM i5/OS (aka OS/400) with PASE (Portable Application Solutions Environment)
+                cpu_arch=powerpc
+            fi
+            if [ -x /usr/bin/oslevel ]; then
+                os_level=`/usr/bin/oslevel`
+            else
+                os_level=&quot;`uname -v`.`uname -r`&quot;
+            fi
+            os_level=`echo &quot;${os_level}&quot; |\
+                      sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(\.[0-9][0-9]*\)\(.*\)$;&lt;\1&gt;\2[\3];' \
+                          -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(.*\)$;&lt;\1&gt;\2;'`
+            AT=&quot;${cpu_arch}&quot;
+            AP=&quot;${AT}&quot;
+            AC=&quot;${AP}&quot;
+            ST=&quot;[IBM ]&lt;AIX &gt;${os_level}&quot;
+            SP=&quot;${ST}&quot;
+            case &quot;${os_level}&quot; in
+                [12]* ) SC=&quot;SVR2&quot; ;;
+                *     ) SC=&quot;SVR4&quot; ;;
+            esac
+            ;;
+
+        #   Apple MacOS X Darwin
+        *:Darwin:* )
+            AT=`uname -p`
+            case &quot;${AT}&quot; in
+                powerpc ) AT=&quot;PPC&quot; ;;
+            esac
+            AP=&quot;${AT}&quot;
+            AC=&quot;${AP}&quot;
+            case &quot;${AC}&quot; in
+                i?86 ) AC=&quot;iX86&quot; ;;
+            esac
+            ST=&quot;[Apple ]${UNAME_SYSTEM} ${UNAME_RELEASE}&quot;
+            SP=&quot;${ST}&quot;
+            SC=&quot;4.4BSD/Mach3&quot;
+            ;;
+
+        #   TODO ...ADD YOUR NEW PLATFORM CHECK HERE... TODO
+        # *:XXX:* )
+        #   ...
+        #   ;;
+
+        #   ...A STILL UNKNOWN PLATFORM...
+        * )
+            AT=`echo &quot;${UNAME_MACHINE}&quot; | sed -e &quot;s; ;${opt_C};g&quot;`
+            AP=&quot;${AT}&quot;
+            AC=&quot;${AP}&quot;
+            v=`echo &quot;${UNAME_RELEASE}&quot; |\
+               sed -e 's/^/#/' \
+                   -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
+                   -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \
+                   -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \
+                   -e 's/^#.*$/?/'`
+            ST=&quot;${UNAME_SYSTEM} ${v}&quot;
+            SP=&quot;${ST}&quot;
+            SC=&quot;${SP}&quot;
+            ;;
+
+    esac
+
+    #   provide fallback values
+    [ &quot;.$AT&quot; = . ] &amp;&amp; AT=&quot;${AP:-${AC}}&quot;
+    [ &quot;.$AP&quot; = . ] &amp;&amp; AP=&quot;${AT:-${AC}}&quot;
+    [ &quot;.$AC&quot; = . ] &amp;&amp; AC=&quot;${AP:-${AT}}&quot;
+    [ &quot;.$ST&quot; = . ] &amp;&amp; ST=&quot;${SP:-${SC}}&quot;
+    [ &quot;.$SP&quot; = . ] &amp;&amp; SP=&quot;${ST:-${SC}}&quot;
+    [ &quot;.$SC&quot; = . ] &amp;&amp; SC=&quot;${SP:-${ST}}&quot;
+
+    #   support explicit enforced verbose/concise output
+    if [ &quot;.$opt_v&quot; = .yes ]; then
+        opt_F=`echo &quot;:$opt_F&quot; | sed -e 's/^://' -e 's/%\([as][cpt]\)/%[\1]/g'`
+    elif [ &quot;.$opt_c&quot; = .yes ]; then
+        opt_F=`echo &quot;:$opt_F&quot; | sed -e 's/^://' -e 's/%\([as][cpt]\)/%&lt;\1&gt;/g'`
+    fi
+
+    #   provide verbose and concise variants
+    AC_V=&quot;&quot;; AC_N=&quot;&quot;; AC_C=&quot;&quot;
+    AP_V=&quot;&quot;; AP_N=&quot;&quot;; AP_C=&quot;&quot;
+    AT_V=&quot;&quot;; AT_N=&quot;&quot;; AT_C=&quot;&quot;
+    SC_V=&quot;&quot;; SC_N=&quot;&quot;; SC_C=&quot;&quot;
+    SP_V=&quot;&quot;; SP_N=&quot;&quot;; SP_C=&quot;&quot;
+    ST_V=&quot;&quot;; ST_N=&quot;&quot;; ST_C=&quot;&quot;
+    for var_lc in at ap ac st sp sc; do
+        case &quot;$opt_F&quot; in
+            *&quot;%[${val_lc}]&quot;* | *&quot;%{${val_lc}}&quot;* | *&quot;%${val_lc}&quot;* | *&quot;%&lt;${val_lc}&gt;&quot;* )
+            var_uc=`util_upper &quot;$var_lc&quot;`
+            eval &quot;val=\&quot;\$${var_uc}\&quot;&quot;
+            val_V=&quot;&quot;; val_N=&quot;&quot;; val_C=&quot;&quot;
+            case &quot;$opt_F&quot; in
+                *&quot;%[${var_lc}]&quot;* )
+                    val_V=`echo &quot;:$val&quot; | \
+                           sed -e 's/^://' \
+                               -e 's;\[\([^]]*\)\];\1;g' \
+                               -e 's;&lt;\([^&gt;]*\)&gt;;\1;g' \
+                               -e &quot;s; ;\xA7\xA7;g&quot; \
+                               -e &quot;s;/;%%;g&quot; \
+                               -e &quot;s;\xA7\xA7;${opt_S};g&quot; \
+                               -e &quot;s;%%;${opt_C};g&quot;`
+                    eval &quot;${var_uc}_V=\&quot;\${val_V}\&quot;&quot;
+                    ;;
+            esac
+            case &quot;$opt_F&quot; in
+                *&quot;%{${var_lc}}&quot;* | *&quot;%${var_lc}&quot;* )
+                    val_N=`echo &quot;:$val&quot; | \
+                           sed -e 's/^://' \
+                               -e 's;\[\([^]]*\)\];;g' \
+                               -e 's;&lt;\([^&gt;]*\)&gt;;\1;g' \
+                               -e &quot;s; ;\xA7\xA7;g&quot; \
+                               -e &quot;s;/;%%;g&quot; \
+                               -e &quot;s;\xA7\xA7;${opt_S};g&quot; \
+                               -e &quot;s;%%;${opt_C};g&quot;`
+                    eval &quot;${var_uc}_N=\&quot;\${val_N}\&quot;&quot;
+                    ;;
+            esac
+            case &quot;$opt_F&quot; in
+                *&quot;%&lt;${var_lc}&gt;&quot;* )
+                    val_C=`echo &quot;:$val&quot; | \
+                           sed -e 's/^://' \
+                               -e 's;\[\([^]]*\)\];;g' \
+                               -e 's;[^&lt;]*&lt;\([^&gt;]*\)&gt;[^&lt;]*;\1;g' \
+                               -e &quot;s; ;\xA7\xA7;g&quot; \
+                               -e &quot;s;/;%%;g&quot; \
+                               -e &quot;s;\xA7\xA7;${opt_S};g&quot; \
+                               -e &quot;s;%%;${opt_C};g&quot;`
+                    eval &quot;${var_uc}_C=\&quot;\${val_C}\&quot;&quot;
+                    ;;
+            esac
+            ;;
+        esac
+    done
+
+    #   create output string
+    output=`echo &quot;:$opt_F&quot; |\
+            sed -e &quot;s/^://&quot; \
+                -e &quot;s;%\\[ac\\];${AC_V};g&quot; \
+                -e &quot;s;%{ac};${AC_N};g&quot; \
+                -e &quot;s;%ac;${AC_N};g&quot; \
+                -e &quot;s;%&lt;ac&gt;;${AC_C};g&quot; \
+                -e &quot;s;%\\[ap\\];${AP_V};g&quot; \
+                -e &quot;s;%{ap};${AP_N};g&quot; \
+                -e &quot;s;%ap;${AP_N};g&quot; \
+                -e &quot;s;%&lt;ap&gt;;${AP_C};g&quot; \
+                -e &quot;s;%\\[at\\];${AT_V};g&quot; \
+                -e &quot;s;%{at};${AT_N};g&quot; \
+                -e &quot;s;%at;${AT_N};g&quot; \
+                -e &quot;s;%&lt;at&gt;;${AT_C};g&quot; \
+                -e &quot;s;%\\[sc\\];${SC_V};g&quot; \
+                -e &quot;s;%{sc};${SC_N};g&quot; \
+                -e &quot;s;%sc;${SC_N};g&quot; \
+                -e &quot;s;%&lt;sc&gt;;${SC_C};g&quot; \
+                -e &quot;s;%\\[sp\\];${SP_V};g&quot; \
+                -e &quot;s;%{sp};${SP_N};g&quot; \
+                -e &quot;s;%sp;${SP_N};g&quot; \
+                -e &quot;s;%&lt;sp&gt;;${SP_C};g&quot; \
+                -e &quot;s;%\\[st\\];${ST_V};g&quot; \
+                -e &quot;s;%{st};${ST_N};g&quot; \
+                -e &quot;s;%st;${ST_N};g&quot; \
+                -e &quot;s;%&lt;st&gt;;${ST_C};g&quot; \
+                -e 's/\\\\n/^/g' |\
+             tr '^' '\012'`
+
+    #   support lower/upper-case mapping
+    if [ &quot;.$opt_L&quot; = .yes ]; then
+        output=`util_lower &quot;$output&quot;`
+    elif [ &quot;.$opt_U&quot; = .yes ]; then
+        output=`util_upper &quot;$output&quot;`
+    fi
+
+    #   display output string
+    if [ &quot;.$opt_n&quot; = .yes ]; then
+        echo . | awk '{ printf(&quot;%s&quot;, output); }' output=&quot;$output&quot;
+    else
+        echo &quot;$output&quot;
+    fi
+
+    shtool_exit 0
+    ;;
+
+arx )
+    ##
+    ##  arx -- Extended archive command
+    ##  Copyright (c) 1999-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+    ##
+
+    ar_prg=&quot;$opt_C&quot;
+    ar_cmd=&quot;$1&quot;; shift
+    archive=&quot;$1&quot;; shift
+    files=&quot;$*&quot;
+
+    #   walk through the file list and expand archives members
+    ar_tmpdir=`echo $archive | sed -e 's;[^/]*$;.arx;'`
+    nfiles=''
+    if [ &quot;.$files&quot; != . ]; then
+        for file in $files; do
+            if [ ! -f $file ]; then
+                echo &quot;$msgprefix:Error: input file not found: $file&quot; 1&gt;&amp;2
+                shtool_exit 1
+            fi
+            case $file in
+                *.a )
+                    if [ ! -d $ar_tmpdir ]; then
+                        if [ &quot;.$opt_t&quot; = .yes ]; then
+                            echo &quot;mkdir $ar_tmpdir&quot; 1&gt;&amp;2
+                        fi
+                        mkdir $ar_tmpdir
+                    fi
+                    case $ar_tmpdir in
+                         .arx )
+                             from=&quot;../$file&quot;
+                             ;;
+                         * )
+                             dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'`
+                             base=`echo $file | sed -e 's;.*/\([^/]*\)$;\1;'`
+                             from=&quot;`cd $dir; pwd`/$base&quot;
+                             ;;
+                    esac
+                    if [ &quot;.$opt_t&quot; = .yes ]; then
+                        echo &quot;(cd $ar_tmpdir &amp;&amp; $ar_prg x $from)&quot; 1&gt;&amp;2
+                    fi
+                    (cd $ar_tmpdir &amp;&amp; eval $ar_prg x $from)
+                    if [ $? -ne 0 ]; then
+                        echo &quot;$msgprefix:Error: member extraction failed for archive: $file&quot; 1&gt;&amp;2
+                        shtool_exit 1
+                    fi
+                    for member in - `eval $ar_prg t $file | sed -e '/_\.SYMDEF/d'`; do
+                        [ &quot;.$member&quot; = .- ] &amp;&amp; continue
+                        nfiles=&quot;$nfiles $ar_tmpdir/$member&quot;
+                    done
+                    ;;
+                * )
+                    nfiles=&quot;$nfiles $file&quot;
+                    ;;
+            esac
+        done
+    fi
+
+    #   run the final archive command
+    if [ &quot;.$opt_t&quot; = .yes ]; then
+        echo &quot;$ar_prg $ar_cmd $archive $nfiles&quot; 1&gt;&amp;2
+    fi
+    eval $ar_prg $ar_cmd $archive $nfiles
+    if [ $? -ne 0 ]; then
+        echo &quot;$msgprefix:Error: archive command failed&quot; 1&gt;&amp;2
+        shtool_exit $?
+    fi
+
+    #   cleanup and die gracefully
+    if [ -d $ar_tmpdir ]; then
+        if [ &quot;.$opt_t&quot; = .yes ]; then
+            echo &quot;rm -rf $ar_tmpdir&quot; 1&gt;&amp;2
+        fi
+        rm -rf $ar_tmpdir
+    fi
+
+    shtool_exit 0
+    ;;
+
+slo )
+    ##
+    ##  slo -- Separate linker options by library class
+    ##  Copyright (c) 1998-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+    ##
+
+    DIFS=&quot;$IFS&quot;
+
+    #   parse out -L and -l options from command line
+    DIRS=''
+    LIBS=''
+    ARGV=''
+    optprev=''
+    for opt
+    do
+        #   concatenate with previous option if exists
+        if [ &quot;.$optprev&quot; != . ]; then
+            opt=&quot;${optprev}${opt}&quot;;
+            optprev=''
+        fi
+        #   remember options for arg if used stand-alone
+        if [ &quot;.$opt&quot; = &quot;.-L&quot; ] || [ &quot;.$opt&quot; = &quot;.-l&quot; ]; then
+            optprev=&quot;$opt&quot;
+            continue;
+        fi
+        #   split argument into option plus option argument
+        arg=&quot;`echo $opt | cut -c3-`&quot;
+        opt=&quot;`echo $opt | cut -c1-2`&quot;
+        #   store into containers
+        case $opt in
+            -L) DIRS=&quot;$DIRS:$arg&quot; ;;
+            -l) LIBS=&quot;$LIBS:$arg&quot; ;;
+             *) ARGV=&quot;$ARGV $opt&quot; ;;
+        esac
+    done
+
+    #   set linker default directories
+    DIRS_DEFAULT='/lib:/usr/lib'
+    if [ &quot;.$LD_LIBRARY_PATH&quot; != . ]; then
+        DIRS_DEFAULT=&quot;$DIRS_DEFAULT:$LD_LIBRARY_PATH&quot;
+    fi
+
+    #   sort options by class
+    DIRS_OBJ=''
+    LIBS_OBJ=''
+    DIRS_PIC=''
+    LIBS_PIC=''
+    DIRS_DSO=''
+    LIBS_DSO=''
+
+    #    for each library...
+    OIFS=&quot;$IFS&quot;; IFS=':'
+    for lib in $LIBS; do
+        [ &quot;.$lib&quot; = . ] &amp;&amp; continue
+
+        found='no'
+        found_indefdir='no'
+        found_type=''
+        found_dir=''
+
+        #    for each directory...
+        OIFS2=&quot;$IFS&quot;; IFS=&quot;:$DIFS&quot;
+        for dir in ${DIRS} switch-to-defdirs ${DIRS_DEFAULT}; do
+            [ &quot;.$dir&quot; = . ] &amp;&amp; continue
+            [ &quot;.$dir&quot; = .switch-to-defdirs ] &amp;&amp; found_indefdir=yes
+            [ ! -d $dir ] &amp;&amp; continue
+
+            #    search the file
+            OIFS3=&quot;$IFS&quot;; IFS=&quot;$DIFS&quot;
+            for file in '' `cd $dir &amp;&amp; env -i /bin/ls lib${lib}.* 2&gt;/dev/null`; do
+                 [ &quot;.$file&quot; = . ] &amp;&amp; continue
+                 case $file in
+                     *.so|*.so.[0-9]*|*.sl|*.sl.[0-9]* )
+                          found=yes;
+                          found_type=DSO;
+                          break
+                          ;;
+                     *.lo|*.la )
+                          found=yes;
+                          found_type=PIC
+                          ;;
+                     *.a )
+                          if [ &quot;.$found_type&quot; = . ]; then
+                              found=yes
+                              found_type=OBJ
+                          fi
+                          ;;
+                 esac
+            done
+            IFS=&quot;$OIFS3&quot;
+            if [ &quot;.$found&quot; = .yes ]; then
+                found_dir=&quot;$dir&quot;
+                break
+            fi
+        done
+        IFS=&quot;$OIFS2&quot;
+
+        if [ &quot;.$found&quot; = .yes ]; then
+            if [ &quot;.$found_indefdir&quot; != .yes ]; then
+                eval &quot;dirlist=\&quot;\${DIRS_${found_type}}:\&quot;&quot;
+                case &quot;$dirlist&quot; in
+                    *:$found_dir:* ) ;;
+                    * ) eval &quot;DIRS_${found_type}=\&quot;\$DIRS_${found_type}:${found_dir}\&quot;&quot; ;;
+                esac
+                eval &quot;LIBS_${found_type}=\&quot;\$LIBS_${found_type}:$lib\&quot;&quot;
+            else
+                eval &quot;LIBS_${found_type}=\&quot;\$LIBS_${found_type}:$lib\&quot;&quot;
+            fi
+        else
+            LIBS_OBJ=&quot;$LIBS_OBJ:$lib&quot;
+            #dirlist=&quot;`echo $DIRS $DIRS_DEFAULT | sed -e 's/:/ /g'`&quot;
+            #echo &quot;slo:Warning: library \&quot;$lib\&quot; not found in any of the following dirs:&quot; 2&gt;&amp;1
+            #echo &quot;slo:Warning: $dirlist&quot; 1&gt;&amp;1
+        fi
+    done
+    IFS=&quot;$OIFS&quot;
+
+    #   also pass-through unused dirs even if it's useless
+    OIFS=&quot;$IFS&quot;; IFS=':'
+    for dir in $DIRS; do
+        dirlist=&quot;${DIRS_OBJ}:${DIRS_PIC}:${DIRS_DSO}:&quot;
+        case &quot;$dirlist&quot; in
+            *:$dir:* ) ;;
+            * ) DIRS_OBJ=&quot;$DIRS_OBJ:$dir&quot; ;;
+        esac
+    done
+    IFS=&quot;$OIFS&quot;
+
+    #   reassemble the options but separated by type
+    for type in OBJ PIC DSO; do
+        OIFS=&quot;$IFS&quot;; IFS=':'
+        eval &quot;libs=\&quot;\$LIBS_${type}\&quot;&quot;
+        opts=''
+        for lib in $libs; do
+            [ &quot;.$lib&quot; = . ] &amp;&amp; continue
+            opts=&quot;$opts -l$lib&quot;
+        done
+        eval &quot;LIBS_${type}=\&quot;$opts\&quot;&quot;
+
+        eval &quot;dirs=\&quot;\$DIRS_${type}\&quot;&quot;
+        opts=''
+        for dir in $dirs; do
+            [ &quot;.$dir&quot; = . ] &amp;&amp; continue
+            opts=&quot;$opts -L$dir&quot;
+        done
+        eval &quot;DIRS_${type}=\&quot;$opts\&quot;&quot;
+        IFS=&quot;$OIFS&quot;
+    done
+
+    #   give back results
+    for var in ARGV DIRS_OBJ LIBS_OBJ DIRS_PIC LIBS_PIC DIRS_DSO LIBS_DSO; do
+        eval &quot;val=\&quot;\$${var}\&quot;&quot;
+        val=&quot;`echo $val | sed -e 's/^ *//'`&quot;
+        echo &quot;${opt_p}${var}=\&quot;${val}\&quot;&quot;
+    done
+
+    shtool_exit 0
+    ;;
+
+scpp )
+    ##
+    ##  scpp -- Sharing C Pre-Processor
+    ##  Copyright (c) 1999-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+    ##
+
+    srcs=&quot;$*&quot;
+    output=&quot;${opt_o}.n&quot;
+
+    #   find a reasonable Awk
+    awk=''
+    paths=`echo $PATH |\
+           sed -e 's%/*:%:%g' -e 's%/$%%' \
+               -e 's/^:/.:/' -e 's/::/:.:/g' -e 's/:$/:./' \
+               -e 's/:/ /g'`
+    for name in gawk nawk awk; do
+        for path in $paths; do
+            if [ -r &quot;$path/$name&quot; ]; then
+                awk=&quot;$path/$name&quot;
+                break
+            fi
+        done
+        if [ &quot;.$awk&quot; != . ]; then
+            break
+        fi
+    done
+    if [ &quot;.$awk&quot; = . ]; then
+        echo &quot;$msgprefix:Error: cannot find a reasonable Awk&quot; 1&gt;&amp;2
+        shtool_exit 1
+    fi
+
+    #   parse source file(s)
+    if [ &quot;.$opt_v&quot; = .yes ]; then
+        echo &quot;Parsing:&quot; | $awk '{ printf(&quot;%s&quot;, $0); }' 1&gt;&amp;2
+    fi
+    for src in $srcs; do
+        if [ &quot;.$opt_v&quot; = .yes ]; then
+            echo $src | $awk '{ printf(&quot; %s&quot;, $0); }' 1&gt;&amp;2
+        fi
+        if [ &quot;.$opt_f&quot; != . ]; then
+            inputcmd=&quot;sed&quot;
+            OIFS=&quot;$IFS&quot;; IFS=&quot;$ASC_NL&quot;; set -- $opt_f; IFS=&quot;$OIFS&quot;
+            for e
+            do
+                inputcmd=&quot;$inputcmd -e '$e'&quot;
+            done
+            inputcmd=&quot;$inputcmd '$src'&quot;
+        else
+            inputcmd=&quot;cat '$src'&quot;
+        fi
+        eval $inputcmd |\
+        $awk '
+           BEGIN {
+               ln    = 0;
+               fln   = 0;
+               level = 0;
+               mode  = &quot;&quot;;
+               store = &quot;&quot;;
+           }
+           {
+               ln++;
+           }
+           /^#if.*/ {
+               level++;
+           }
+           /^#if [a-zA-Z_][a-zA-Z0-9_]* *$/ {
+               if ($2 == define) {
+                   mode = &quot;D&quot;;
+                   printf(&quot;D:#line %d \&quot;%s\&quot;\n&quot;, ln, src);
+                   next;
+               }
+           }
+           /^#endif.*/ {
+               level--;
+               if (mode == &quot;D&quot; &amp;&amp; level == 0) {
+                   mode = &quot;&quot;;
+                   next;
+               }
+           }
+           /^[a-zA-Z_][a-zA-Z0-9_].*;.*/ {
+               if ($1 == class) {
+                   printf(&quot;V:#line %d \&quot;%s\&quot;\n&quot;, ln, src);
+                   printf(&quot;V:%s\n&quot;, $0);
+                   printf(&quot;J:%s\n&quot;, $0);
+                   next;
+               }
+           }
+           /^[a-zA-Z_][a-zA-Z0-9_].*=.*/ {
+               if ($1 == class) {
+                   printf(&quot;V:#line %d \&quot;%s\&quot;\n&quot;, ln, src);
+                   printf(&quot;V:%s\n&quot;, $0);
+                   printf(&quot;J:%s\n&quot;, $0);
+                   next;
+               }
+           }
+           /^[a-zA-Z_][a-zA-Z0-9_]*/ {
+               if ($1 == class) {
+                   fln = ln;
+                   store = $0;
+                   mode = &quot;F&quot;;
+                   next;
+               }
+           }
+           /^\{ *$/ {
+               if (mode == &quot;F&quot;) {
+                   printf(&quot;F:#line %d \&quot;%s\&quot;\n&quot;, fln, src);
+                   printf(&quot;F:%s;\n&quot;, store);
+                   printf(&quot;I:%s;\n&quot;, store);
+                   store = &quot;&quot;;
+                   mode = &quot;&quot;;
+                   next;
+               }
+           }
+           {
+               if (mode == &quot;D&quot;)
+                   printf(&quot;D:%s\n&quot;, $0);
+               else if (mode == &quot;F&quot;)
+                   store = store &quot; &quot; $0;
+           }
+        ' &quot;src=$src&quot; &quot;define=$opt_D&quot; &quot;class=$opt_C&quot; &gt;&gt;$tmpfile
+    done
+    if [ &quot;.$opt_v&quot; = .yes ]; then
+        echo &quot;&quot; 1&gt;&amp;2
+    fi
+
+    #   start generating output header
+    echo &quot;/* $opt_o -- autogenerated from $opt_t, DO NOT EDIT! */&quot; &gt;$output
+    echo &quot;#line 1 \&quot;$opt_t\&quot;&quot; &gt;&gt;$output
+    sed &lt;$opt_t -e &quot;1,/^${opt_M} *\$/p&quot; -e 'd' |\
+    sed -e &quot;/^${opt_M} *\$/d&quot; &gt;&gt;$output
+
+    #   merge in the define blocks
+    grep '^D:' $tmpfile | sed -e 's/^D://' &gt;&gt;$output
+
+    #   generate standard prolog
+    echo &quot;#line 1 \&quot;_ON_THE_FLY_\&quot;&quot; &gt;&gt;$output
+    echo &quot;&quot; &gt;&gt;$output
+    echo &quot;/* make sure the scpp source extensions are skipped */&quot; &gt;&gt;$output
+    echo &quot;#define $opt_D 0&quot; &gt;&gt;$output
+    echo &quot;#define $opt_C /**/&quot; &gt;&gt;$output
+
+    #   generate namespace hiding for variables
+    echo &quot;&quot; &gt;&gt;$output
+    echo &quot;/* move intern variables to hidden namespace */&quot; &gt;&gt;$output
+    grep '^J:' $tmpfile | sed &gt;&gt;$output \
+        -e 's/^J://' \
+        -e 's/  */ /g' \
+        -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\)\[\];.*$/#define \1 __\1/' \
+        -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\)\[\] =.*$/#define \1 __\1/' \
+        -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\);.*$/#define \1 __\1/' \
+        -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\) =.*$/#define \1 __\1/'
+
+    #   generate namespace hiding for functions
+    echo &quot;&quot; &gt;&gt;$output
+    echo &quot;/* move intern functions to hidden namespace */&quot; &gt;&gt;$output
+    grep '^I:' $tmpfile | sed &gt;&gt;$output \
+        -e 's/^I://' \
+        -e 's/\([ (]\) */\1/g' \
+        -e 's/ *\([),]\)/\1/g' \
+        -e 's/^[^(]*[ *]\([a-zA-Z0-9_]*\)(.*$/#define \1 __\1/'
+
+    #   generate prototypes for variables
+    echo &quot;&quot; &gt;&gt;$output
+    echo &quot;/* prototypes for intern variables */&quot; &gt;&gt;$output
+    grep '^V:' $tmpfile | sed &gt;&gt;$output \
+        -e 's/^V://' \
+        -e 's/  */ /g' \
+        -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\[\]\);.*$/\1;/' \
+        -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\[\]\) =.*$/\1;/' \
+        -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\);.*$/\1;/' \
+        -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\) =.*$/\1;/' \
+        -e 's/ ;/;/g' \
+        -e &quot;s/^$opt_C /extern /&quot;
+
+    #   generate prototypes for functions
+    echo &quot;&quot; &gt;&gt;$output
+    echo &quot;/* prototypes for intern functions */&quot; &gt;&gt;$output
+    grep '^F:' $tmpfile | sed &gt;&gt;$output \
+        -e 's/^F://' \
+        -e 's/\([ (]\) */\1/g' \
+        -e 's/ *\([),]\)/\1/g' \
+        -e 's/\([* ]\)[a-zA-Z0-9_]*,/\1,/g' \
+        -e 's/\([* ]\)[a-zA-Z0-9_]*);/\1);/g' \
+        -e 's/(\*[a-zA-Z0-9_]*)(/(*)(/g' \
+        -e 's/\([ (]\) */\1/g' \
+        -e 's/ *\([),]\)/\1/g' \
+        -e &quot;s/^$opt_C /extern /&quot;
+
+    #   finish generating output header
+    n=`(echo ''; sed &lt;$opt_t -e &quot;1,/^${opt_M} *\$/p&quot; -e 'd') |\
+       wc -l | sed -e 's;^ *\([0-9]*\) *$;\1;'`
+    echo &quot;#line $n \&quot;$opt_t\&quot;&quot; &gt;&gt;$output
+    sed &lt;$opt_t -e &quot;/^${opt_M} *\$/,\$p&quot; -e 'd' |\
+    sed -e &quot;/^${opt_M} *\$/d&quot; &gt;&gt;$output
+
+    #   create final output file
+    if [ -f $opt_o ]; then
+        if [ &quot;.$opt_p&quot; = .yes ]; then
+            grep -v '^#line' $opt_o  &gt;$tmpfile.o
+            grep -v '^#line' $output &gt;$tmpfile.n
+            out_old=&quot;$tmpfile.o&quot;
+            out_new=&quot;$tmpfile.n&quot;
+        else
+            out_old=&quot;$opt_o&quot;
+            out_new=&quot;$output&quot;
+        fi
+        if cmp -s $out_old $out_new; then
+            :
+        else
+            cp $output $opt_o
+        fi
+    else
+        cp $output $opt_o
+    fi
+    rm -f $output
+    rm -f $tmpfile $tmpfile.* &gt;/dev/null 2&gt;&amp;1
+
+    shtool_exit 0
+    ;;
+
+version )
+    ##
+    ##  version -- Maintain a version information file
+    ##  Copyright (c) 1994-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+    ##
+
+    file=&quot;$1&quot;
+
+    #   determine prefix and name
+    name=&quot;$opt_n&quot;
+    prefix=&quot;$opt_p&quot;
+
+    #   determine current version
+    triple=&quot;$opt_s&quot;
+    if [ &quot;.$triple&quot; != . ]; then
+        #   use given triple
+        if [ &quot;.`echo $triple | grep '[0-9]*.[0-9]*[sabp.][0-9]*'`&quot; = . ]; then
+            echo &quot;$msgprefix:Error: invalid argument to option \`-s': \`$opt_s'&quot; 1&gt;&amp;2
+            shtool_exit 1
+        fi
+        eval `echo $triple |\
+              sed -e 's%\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\).*%\
+              ver=&quot;\1&quot;;rev=&quot;\2&quot;;typ=&quot;\3&quot;;lev=&quot;\4&quot;%'`
+        tim=calc
+    elif [ -r $file ]; then
+        #   determine triple from given file
+        eval `grep 'Version [0-9]*.[0-9]*[sabp.][0-9]* ([0-9]*-[a-zA-Z]*-[0-9]*)' $file |\
+              sed -e 's%.*Version \([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\) (\([0-9]*-[a-zA-Z]*-[0-9]*\)).*%\
+              ver=&quot;\1&quot;;rev=&quot;\2&quot;;typ=&quot;\3&quot;;lev=&quot;\4&quot;;tim=&quot;\5&quot;%' -e 'q'`
+    else
+        #   intialise to first version
+        ver=0
+        rev=1
+        typ=.
+        lev=0
+        tim=calc
+    fi
+
+    #   determine new version in batch
+    if [ &quot;.$opt_i&quot; != . ]; then
+        case $opt_i in
+            v ) ver=`expr $ver + 1`
+                rev=0
+                lev=0
+                ;;
+            r ) rev=`expr $rev + 1`
+                lev=0
+                ;;
+            l ) lev=`expr $lev + 1`
+                ;;
+            * ) echo &quot;$msgprefix:Error: invalid argument to option \`-i': \`$opt_i'&quot; 1&gt;&amp;2
+                shtool_exit 1
+                ;;
+        esac
+        tim=calc
+    fi
+
+    #   determine new version interactively
+    if [ &quot;.$opt_e&quot; = .yes ]; then
+        echo &quot;old version: ${ver}.${rev}${typ}${lev}&quot;
+        while [ 1 ]; do
+            echo dummy | awk '{ printf(&quot;new version: &quot;); }'
+            read triple
+            case $triple in
+                [0-9]*.[0-9]*[sabp.][0-9]* )
+                    ;;
+                * ) echo &quot;$msgprefix:Error: invalid version string entered: \`$triple'&quot; 1&gt;&amp;2
+                    continue
+                    ;;
+            esac
+            break
+        done
+        eval `echo $triple |\
+              sed -e 's%^\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\)$%\
+              ver=&quot;\1&quot;;rev=&quot;\2&quot;;typ=&quot;\3&quot;;lev=&quot;\4&quot;%'`
+        tim=calc
+    fi
+
+    #   determine hexadecimal and libtool value of version
+    case $typ in
+        a     ) typnum=0;  levnum=$lev ;;
+        b     ) typnum=1;  levnum=$lev ;;
+        p | . ) typnum=2;  levnum=$lev ;;
+        s     ) typnum=15; levnum=255  ;; # snapshots are special
+    esac
+    hex=`echo &quot;$ver:$rev:$typnum:$levnum&quot; |\
+         awk -F: '{ printf(&quot;0x%x%02x%1x%02x&quot;, $1, $2, $3, $4); }' |\
+         tr 'abcdef' 'ABCDEF'`
+    ltv=`echo &quot;$ver:$rev:$typnum:$levnum&quot; |\
+         awk -F: '{ printf(&quot;%d:%d&quot;, $1*10 + $2, $3*10 + $4); }'`
+
+    #   determine date
+    if [ &quot;.$tim&quot; = .calc ]; then
+        day=`date '+%d'`
+        month=`date '+%m'`
+        year=`date '+%Y' 2&gt;/dev/null`
+        if [ &quot;.$time_year&quot; = . ]; then
+            year=`date '+%y'`
+            case $year in
+                [5-9][0-9]) year=&quot;19$year&quot; ;;
+                [0-4][0-9]) year=&quot;20$year&quot; ;;
+            esac
+        fi
+        case $month in
+            1|01) month='Jan' ;;
+            2|02) month='Feb' ;;
+            3|03) month='Mar' ;;
+            4|04) month='Apr' ;;
+            5|05) month='May' ;;
+            6|06) month='Jun' ;;
+            7|07) month='Jul' ;;
+            8|08) month='Aug' ;;
+            9|09) month='Sep' ;;
+              10) month='Oct' ;;
+              11) month='Nov' ;;
+              12) month='Dec' ;;
+        esac
+        tim=&quot;${day}-${month}-${year}&quot;
+    fi
+
+    #   perform result actions
+    mode=show
+    if [ &quot;.$opt_i&quot; != . ]; then
+        mode=edit
+    elif [ &quot;.$opt_e&quot; = .yes ]; then
+        mode=edit
+    elif [ &quot;.$opt_s&quot; != . ]; then
+        mode=edit
+    fi
+    if [ &quot;.$mode&quot; = .show ]; then
+        #   just display the current version
+        case $opt_d in
+            short )
+                echo &quot;${ver}.${rev}${typ}${lev}&quot;
+                ;;
+            long )
+                echo &quot;${ver}.${rev}${typ}${lev} ($tim)&quot;
+                ;;
+            libtool )
+                echo &quot;${ltv}&quot;
+                ;;
+            hex )
+                echo &quot;${hex}&quot;
+                ;;
+            * ) echo &quot;$msgprefix:Error: invalid argument to option \`-d': \`$opt_d'&quot; 1&gt;&amp;2
+                shtool_exit 1
+                ;;
+        esac
+    else
+        #   update the version file
+
+        #   pre-generate various strings
+        triple=&quot;${ver}.${rev}${typ}${lev}&quot;
+        vHex=&quot;$hex&quot;
+        vShort=&quot;${triple}&quot;
+        vLong=&quot;${triple} (${tim})&quot;
+        vTeX=&quot;This is ${name}, Version ${triple} (${tim})&quot;
+        vGNU=&quot;${name} ${triple} (${tim})&quot;
+        vWeb=&quot;${name}/${triple}&quot;
+        vSCCS=&quot;@(#)${name} ${triple} (${tim})&quot;
+        vRCS=&quot;\$Id: ${name} ${triple} (${tim}) \$&quot;
+
+        #   determine string out of filename
+        #   (do NOT try to optimize this in any way because of portability)
+        filestr=`util_upper &quot;$file&quot; | tr './%+' '____' | sed -e 's/-/_/g'`
+
+        #   generate uppercase prefix
+        prefixupper=`util_upper &quot;$prefix&quot;`
+
+        #   create the version file according the the selected language
+        echo &quot;new version: ${vLong}&quot;
+
+        cp /dev/null $file
+        case $opt_l in
+            txt )
+                echo &gt;&gt;$file &quot;&quot;
+                echo &gt;&gt;$file &quot;  ${file} -- Version Information for ${name} (syntax: Text)&quot;
+                echo &gt;&gt;$file &quot;  [automatically generated and maintained by GNU shtool]&quot;
+                echo &gt;&gt;$file &quot;&quot;
+                echo &gt;&gt;$file &quot;  $vTeX&quot;
+                echo &gt;&gt;$file &quot;&quot;
+                ;;
+            c )
+                echo &gt;&gt;$file &quot;/*&quot;
+                echo &gt;&gt;$file &quot;**  ${file} -- Version Information for ${name} (syntax: C/C++)&quot;
+                echo &gt;&gt;$file &quot;**  [automatically generated and maintained by GNU shtool]&quot;
+                echo &gt;&gt;$file &quot;*/&quot;
+                echo &gt;&gt;$file &quot;&quot;
+                echo &gt;&gt;$file &quot;#ifdef _${filestr}_AS_HEADER_&quot;
+                echo &gt;&gt;$file &quot;&quot;
+                echo &gt;&gt;$file &quot;#ifndef _${filestr}_&quot;
+                echo &gt;&gt;$file &quot;#define _${filestr}_&quot;
+                echo &gt;&gt;$file &quot;&quot;
+                echo &gt;&gt;$file &quot;#define ${prefixupper}VERSION ${vHex}&quot;
+                echo &gt;&gt;$file &quot;&quot;
+                echo &gt;&gt;$file &quot;typedef struct {&quot;
+                echo &gt;&gt;$file &quot;    const int   v_hex;&quot;
+                echo &gt;&gt;$file &quot;    const char *v_short;&quot;
+                echo &gt;&gt;$file &quot;    const char *v_long;&quot;
+                echo &gt;&gt;$file &quot;    const char *v_tex;&quot;
+                echo &gt;&gt;$file &quot;    const char *v_gnu;&quot;
+                echo &gt;&gt;$file &quot;    const char *v_web;&quot;
+                echo &gt;&gt;$file &quot;    const char *v_sccs;&quot;
+                echo &gt;&gt;$file &quot;    const char *v_rcs;&quot;
+                echo &gt;&gt;$file &quot;} ${prefix}version_t;&quot;
+                echo &gt;&gt;$file &quot;&quot;
+                echo &gt;&gt;$file &quot;extern ${prefix}version_t ${prefix}version;&quot;
+                echo &gt;&gt;$file &quot;&quot;
+                echo &gt;&gt;$file &quot;#endif /* _${filestr}_ */&quot;
+                echo &gt;&gt;$file &quot;&quot;
+                echo &gt;&gt;$file &quot;#else /* _${filestr}_AS_HEADER_ */&quot;
+                echo &gt;&gt;$file &quot;&quot;
+                echo &gt;&gt;$file &quot;#define _${filestr}_AS_HEADER_&quot;
+                echo &gt;&gt;$file &quot;#include \&quot;${file}\&quot;&quot;
+                echo &gt;&gt;$file &quot;#undef  _${filestr}_AS_HEADER_&quot;
+                echo &gt;&gt;$file &quot;&quot;
+                echo &gt;&gt;$file &quot;${prefix}version_t ${prefix}version = {&quot;
+                echo &gt;&gt;$file &quot;    ${vHex},&quot;
+                echo &gt;&gt;$file &quot;    \&quot;${vShort}\&quot;,&quot;
+                echo &gt;&gt;$file &quot;    \&quot;${vLong}\&quot;,&quot;
+                echo &gt;&gt;$file &quot;    \&quot;${vTeX}\&quot;,&quot;
+                echo &gt;&gt;$file &quot;    \&quot;${vGNU}\&quot;,&quot;
+                echo &gt;&gt;$file &quot;    \&quot;${vWeb}\&quot;,&quot;
+                echo &gt;&gt;$file &quot;    \&quot;${vSCCS}\&quot;,&quot;
+                echo &gt;&gt;$file &quot;    \&quot;${vRCS}\&quot;&quot;
+                echo &gt;&gt;$file &quot;};&quot;
+                echo &gt;&gt;$file &quot;&quot;
+                echo &gt;&gt;$file &quot;#endif /* _${filestr}_AS_HEADER_ */&quot;
+                echo &gt;&gt;$file &quot;&quot;
+                ;;
+            m4 )
+                echo &gt;&gt;$file &quot;##&quot;
+                echo &gt;&gt;$file &quot;##  ${file} -- Version Information for ${name} (syntax: M4)&quot;
+                echo &gt;&gt;$file &quot;##  [automatically generated and maintained by GNU shtool]&quot;
+                echo &gt;&gt;$file &quot;##&quot;
+                echo &gt;&gt;$file &quot;&quot;
+                echo &gt;&gt;$file &quot;m4_define([v_hex],   [${vHex}])&quot;
+                echo &gt;&gt;$file &quot;m4_define([v_short], [${vShort}])&quot;
+                echo &gt;&gt;$file &quot;m4_define([v_long],  [${vLong}])&quot;
+                echo &gt;&gt;$file &quot;m4_define([v_tex],   [${vTeX}])&quot;
+                echo &gt;&gt;$file &quot;m4_define([v_gnu],   [${vGNU}])&quot;
+                echo &gt;&gt;$file &quot;m4_define([v_web],   [${vWeb}])&quot;
+                echo &gt;&gt;$file &quot;m4_define([v_sccs],  [${vSCCS}])&quot;
+                echo &gt;&gt;$file &quot;m4_define([v_rcs],   [${vRCS}])&quot;
+                echo &gt;&gt;$file &quot;&quot;
+                ;;
+            perl )
+                echo &gt;&gt;$file &quot;##&quot;
+                echo &gt;&gt;$file &quot;##  ${file} -- Version Information for ${name} (syntax: Perl)&quot;
+                echo &gt;&gt;$file &quot;##  [automatically generated and maintained by GNU shtool]&quot;
+                echo &gt;&gt;$file &quot;##&quot;
+                echo &gt;&gt;$file &quot;&quot;
+                echo &gt;&gt;$file &quot;our \$${prefix}version = {&quot;
+                echo &gt;&gt;$file &quot;    'v_hex'   =&gt; ${vHex},&quot;
+                echo &gt;&gt;$file &quot;    'v_short' =&gt; \&quot;${vShort}\&quot;,&quot;
+                echo &gt;&gt;$file &quot;    'v_long'  =&gt; \&quot;${vLong}\&quot;,&quot;
+                echo &gt;&gt;$file &quot;    'v_tex'   =&gt; \&quot;${vTeX}\&quot;,&quot;
+                echo &gt;&gt;$file &quot;    'v_gnu'   =&gt; \&quot;${vGNU}\&quot;,&quot;
+                echo &gt;&gt;$file &quot;    'v_web'   =&gt; \&quot;${vWeb}\&quot;,&quot;
+                echo &gt;&gt;$file &quot;    'v_sccs'  =&gt; \&quot;${vSCCS}\&quot;,&quot;
+                echo &gt;&gt;$file &quot;    'v_rcs'   =&gt; \&quot;\\${vRCS}/\&quot;&quot;
+                echo &gt;&gt;$file &quot;};&quot;
+                echo &gt;&gt;$file &quot;&quot;
+                echo &gt;&gt;$file &quot;1;&quot;
+                echo &gt;&gt;$file &quot;&quot;
+                ;;
+            python )
+                echo &gt;&gt;$file &quot;##&quot;
+                echo &gt;&gt;$file &quot;##  ${file} -- Version Information for ${name} (syntax: Python)&quot;
+                echo &gt;&gt;$file &quot;##  [automatically generated and maintained by GNU shtool]&quot;
+                echo &gt;&gt;$file &quot;##&quot;
+                echo &gt;&gt;$file &quot;&quot;
+                echo &gt;&gt;$file &quot;class ${prefix}version:&quot;
+                echo &gt;&gt;$file &quot;    v_hex       = ${vHex}&quot;
+                echo &gt;&gt;$file &quot;    v_short     = \&quot;${vShort}\&quot;&quot;
+                echo &gt;&gt;$file &quot;    v_long      = \&quot;${vLong}\&quot;&quot;
+                echo &gt;&gt;$file &quot;    v_tex       = \&quot;${vTeX}\&quot;&quot;
+                echo &gt;&gt;$file &quot;    v_gnu       = \&quot;${vGNU}\&quot;&quot;
+                echo &gt;&gt;$file &quot;    v_web       = \&quot;${vWeb}\&quot;&quot;
+                echo &gt;&gt;$file &quot;    v_sccs      = \&quot;${vSCCS}\&quot;&quot;
+                echo &gt;&gt;$file &quot;    v_rcs       = \&quot;${vRCS}\&quot;&quot;
+                echo &gt;&gt;$file &quot;&quot;
+                ;;
+            * ) echo &quot;$msgprefix:Error: invalid argument to option \`-l': \`$opt_l'&quot; 1&gt;&amp;2
+                shtool_exit 1
+                ;;
+        esac
+    fi
+
+    shtool_exit 0
+    ;;
+
+path )
+    ##
+    ##  path -- Deal with program paths
+    ##  Copyright (c) 1998-2007 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+    ##
+
+    namelist=&quot;$*&quot;
+
+    #   check whether the test command supports the -x option
+    if [ -x /bin/sh ] 2&gt;/dev/null; then
+        minusx=&quot;-x&quot;
+    else
+        minusx=&quot;-r&quot;
+    fi
+
+    #   split path string
+    paths=&quot;`echo $opt_p |\
+            sed -e 's/^:/.:/' \
+                -e 's/::/:.:/g' \
+                -e 's/:$/:./' \
+                -e 's/:/ /g'`&quot;
+
+    #   SPECIAL REQUEST
+    #   translate forward to reverse path
+    if [ &quot;.$opt_r&quot; = .yes ]; then
+        if [ &quot;x$namelist&quot; = &quot;x.&quot; ]; then
+            rp='.'
+        else
+            rp=''
+            for pe in `IFS=&quot;$IFS/&quot;; echo $namelist`; do
+                rp=&quot;../$rp&quot;
+            done
+        fi
+        echo $rp | sed -e 's:/$::'
+        shtool_exit 0
+    fi
+
+    #   SPECIAL REQUEST
+    #   strip out directory or base name
+    if [ &quot;.$opt_d&quot; = .yes ]; then
+        echo &quot;$namelist&quot; |\
+        sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;'
+        shtool_exit 0
+    fi
+    if [ &quot;.$opt_b&quot; = .yes ]; then
+        echo &quot;$namelist&quot; |\
+        sed -e 's;.*/\([^/]*\)$;\1;'
+        shtool_exit 0
+    fi
+
+    #   MAGIC SITUATION
+    #   Perl Interpreter (perl)
+    if [ &quot;.$opt_m&quot; = .yes ] &amp;&amp; [ &quot;.$namelist&quot; = .perl ]; then
+        rm -f $tmpfile &gt;/dev/null 2&gt;&amp;1
+        touch $tmpfile
+        found=0
+        pc=99
+        for dir in $paths; do
+            dir=`echo $dir | sed -e 's;/*$;;'`
+            nc=99
+            for name in perl perl5 miniperl; do
+                 if [ $minusx &quot;$dir/$name&quot; ] &amp;&amp; [ ! -d &quot;$dir/$name&quot; ]; then
+                     perl=&quot;$dir/$name&quot;
+                     pv=`$perl -e 'printf(&quot;%.3f&quot;, $]);'`
+                     echo &quot;$pv:$pc:$nc:$perl&quot; &gt;&gt;$tmpfile
+                     found=1
+                 fi
+                 nc=`expr $nc - 1`
+            done
+            pc=`expr $pc - 1`
+        done
+        if [ $found = 1 ]; then
+            perl=&quot;`cat $tmpfile | sort -r -u | sed -e 'q' | cut -d: -f4`&quot;
+            rm -f $tmpfile &gt;/dev/null 2&gt;&amp;1
+            echo &quot;$perl&quot;
+            shtool_exit 0
+        fi
+        rm -f $tmpfile &gt;/dev/null 2&gt;&amp;1
+        shtool_exit 1
+    fi
+
+    #   MAGIC SITUATION
+    #   C pre-processor (cpp)
+    if [ &quot;.$opt_m&quot; = .yes ] &amp;&amp; [ &quot;.$namelist&quot; = .cpp ]; then
+        echo &gt;$tmpfile.c &quot;#include &lt;assert.h&gt;&quot;
+        echo &gt;&gt;$tmpfile.c &quot;Syntax Error&quot;
+        #   1. try the standard cc -E approach
+        cpp=&quot;${CC-cc} -E&quot;
+        (eval &quot;$cpp $tmpfile.c &gt;/dev/null&quot;) 2&gt;$tmpfile.out
+        my_error=`grep -v '^ *+' $tmpfile.out`
+        if [ &quot;.$my_error&quot; != . ]; then
+            #   2. try the cc -E approach and GCC's -traditional-ccp option
+            cpp=&quot;${CC-cc} -E -traditional-cpp&quot;
+            (eval &quot;$cpp $tmpfile.c &gt;/dev/null&quot;) 2&gt;$tmpfile.out
+            my_error=`grep -v '^ *+' $tmpfile.out`
+            if [ &quot;.$my_error&quot; != . ]; then
+                #   3. try a standalone cpp command in path and lib dirs
+                for path in $paths /lib /usr/lib /usr/local/lib; do
+                    path=`echo $path | sed -e 's;/*$;;'`
+                    if [ $minusx &quot;$path/cpp&quot; ] &amp;&amp; [ ! -d &quot;$path/cpp&quot; ]; then
+                        cpp=&quot;$path/cpp&quot;
+                        break
+                    fi
+                done
+                if [ &quot;.$cpp&quot; != . ]; then
+                    (eval &quot;$cpp $tmpfile.c &gt;/dev/null&quot;) 2&gt;$tmpfile.out
+                    my_error=`grep -v '^ *+' $tmpfile.out`
+                    if [ &quot;.$my_error&quot; != . ]; then
+                        #   ok, we gave up...
+                        cpp=''
+                    fi
+                fi
+            fi
+        fi
+        rm -f $tmpfile &gt;/dev/null 2&gt;&amp;1
+        rm -f $tmpfile.c $tmpfile.out &gt;/dev/null 2&gt;&amp;1
+        if [ &quot;.$cpp&quot; != . ]; then
+            echo &quot;$cpp&quot;
+            shtool_exit 0
+        fi
+        shtool_exit 1
+    fi
+
+    #   STANDARD SITUATION
+    #   iterate over names
+    for name in $namelist; do
+        #   iterate over paths
+        for path in $paths; do
+            path=`echo $path | sed -e 's;/*$;;'`
+            if [ $minusx &quot;$path/$name&quot; ] &amp;&amp; [ ! -d &quot;$path/$name&quot; ]; then
+                if [ &quot;.$opt_s&quot; != .yes ]; then
+                    echo &quot;$path/$name&quot;
+                fi
+                shtool_exit 0
+            fi
+        done
+    done
+
+    shtool_exit 1
+    ;;
+
+esac
+
+shtool_exit 0
+
</ins><span class="cx">Property changes on: freeswitch/trunk/libs/uuid/shtool
</span><span class="cx">___________________________________________________________________
</span><span class="cx">Name: svn:executable
</span><span class="cx">   + *
</span></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid3"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid++.3 (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid++.3                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid++.3        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,307 @@
</span><ins>+.\&quot; Automatically generated by Pod::Man 2.16 (Pod::Simple 3.07)
+.\&quot;
+.\&quot; Standard preamble:
+.\&quot; ========================================================================
+.de Sh \&quot; Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \&quot; Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \&quot; Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \&quot; End verbatim text
+.ft R
+.fi
+..
+.\&quot; Set up some character translations and predefined strings.  \*(-- will
+.\&quot; give an unbreakable dash, \*(PI will give pi, \*(L&quot; will give a left
+.\&quot; double quote, and \*(R&quot; will give a right double quote.  \*(C+ will
+.\&quot; give a nicer C++.  Capital omega is used to do unbreakable dashes and
+.\&quot; therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
+.\&quot; nothing in troff, for use with C&lt;&gt;.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+.    ds -- \(*W-
+.    ds PI pi
+.    if (\n(.H=4u)&amp;(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\&quot; diablo 10 pitch
+.    if (\n(.H=4u)&amp;(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\&quot;  diablo 12 pitch
+.    ds L&quot; &quot;&quot;
+.    ds R&quot; &quot;&quot;
+.    ds C` 
+.    ds C' 
+'br\}
+.el\{\
+.    ds -- \|\(em\|
+.    ds PI \(*p
+.    ds L&quot; ``
+.    ds R&quot; ''
+'br\}
+.\&quot;
+.\&quot; Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.\&quot;
+.\&quot; If the F register is turned on, we'll generate index entries on stderr for
+.\&quot; titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\&quot; entries marked with X&lt;&gt; in POD.  Of course, you'll have to process the
+.\&quot; output yourself in some meaningful fashion.
+.ie \nF \{\
+.    de IX
+.    tm Index:\\$1\t\\n%\t&quot;\\$2&quot;
+..
+.    nr % 0
+.    rr F
+.\}
+.el \{\
+.    de IX
+..
+.\}
+.\&quot;
+.\&quot; Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\&quot; Fear.  Run.  Save yourself.  No user-serviceable parts.
+.    \&quot; fudge factors for nroff and troff
+.if n \{\
+.    ds #H 0
+.    ds #V .8m
+.    ds #F .3m
+.    ds #[ \f1
+.    ds #] \fP
+.\}
+.if t \{\
+.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+.    ds #V .6m
+.    ds #F 0
+.    ds #[ \&amp;
+.    ds #] \&amp;
+.\}
+.    \&quot; simple accents for nroff and troff
+.if n \{\
+.    ds ' \&amp;
+.    ds ` \&amp;
+.    ds ^ \&amp;
+.    ds , \&amp;
+.    ds ~ ~
+.    ds /
+.\}
+.if t \{\
+.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h&quot;|\\n:u&quot;
+.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+.    \&quot; troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+.    \&quot; corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+.    \&quot; for low resolution devices (crt and lpr)
+.if \n(.H&gt;23 .if \n(.V&gt;19 \
+\{\
+.    ds : e
+.    ds 8 ss
+.    ds o a
+.    ds d- d\h'-1'\(ga
+.    ds D- D\h'-1'\(hy
+.    ds th \o'bp'
+.    ds Th \o'LP'
+.    ds ae ae
+.    ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\&quot; ========================================================================
+.\&quot;
+.IX Title &quot;.::uuid++ 3&quot;
+.TH .::uuid++ 3 &quot;OSSP uuid 1.6.2&quot; &quot;04-Jul-2008&quot; &quot;Universally Unique Identifier&quot;
+.\&quot; For nroff, turn off justification.  Always turn off hyphenation; it makes
+.\&quot; way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH &quot;NAME&quot;
+\&amp;\fB\s-1OSSP\s0 uuid\fR \- \fBUniversally Unique Identifier\fR (\*(C+ \s-1API\s0)
+.SH &quot;VERSION&quot;
+.IX Header &quot;VERSION&quot;
+\&amp;\s-1OSSP\s0 uuid \s-11.6.2 (04-Jul-2008)\s0
+.SH &quot;DESCRIPTION&quot;
+.IX Header &quot;DESCRIPTION&quot;
+\&amp;\fBuuid++\fR is the \s-1ISO\-\*(C+\s0 language binding of the \fB\s-1OSSP\s0 uuid\fR C \s-1API\s0.
+It provides a thin \s-1ISO\-\*(C+\s0 class \fBuuid\fR wrapping the ISO-C \s-1API\s0 type
+\&amp;\fBuuid_t\fR.
+.SH &quot;APPLICATION PROGRAMMING INTERFACE&quot;
+.IX Header &quot;APPLICATION PROGRAMMING INTERFACE&quot;
+The \s-1ISO\-\*(C+\s0 Application Programming Interface (\s-1API\s0) of \fB\s-1OSSP\s0 uuid\fR
+consists of the following components:
+.Sh &quot;\s-1CONSTANTS\s0&quot;
+.IX Subsection &quot;CONSTANTS&quot;
+The constants are the same to those provided by the ISO-C \s-1API\s0.
+See \fIuuid\fR\|(3) for details.
+.Sh &quot;\s-1CLASSES\s0&quot;
+.IX Subsection &quot;CLASSES&quot;
+The following classes are provided:
+.IP &quot;\fBuuid\fR&quot; 4
+.IX Item &quot;uuid&quot;
+This is the class corresponding to the C \s-1API\s0 type \fBuuid_t\fR.
+It is the main object.
+.IP &quot;\fBuuid_error_t\fR&quot; 4
+.IX Item &quot;uuid_error_t&quot;
+This is the class corresponding to the C \s-1API\s0 function \fBuuid_error\fR.
+It is the object thrown as an exception in case of any errors.
+.Sh &quot;\s-1METHODS\s0&quot;
+.IX Subsection &quot;METHODS&quot;
+The following methods are provided:
+.IP &quot;\fBuuid\fR();&quot; 4
+.IX Item &quot;uuid();&quot;
+The standard constructor.
+.IP &quot;\fBuuid\fR(const uuid &amp;_obj);&quot; 4
+.IX Item &quot;uuid(const uuid &amp;_obj);&quot;
+The copy constructor for \fBuuid\fR class.
+.IP &quot;\fBuuid\fR(const uuid_t *_obj);&quot; 4
+.IX Item &quot;uuid(const uuid_t *_obj);&quot;
+The import constructor for C \s-1API\s0 objects.
+.IP &quot;\fBuuid\fR(const void *_bin);&quot; 4
+.IX Item &quot;uuid(const void *_bin);&quot;
+The import constructor for binary representation.
+.IP &quot;\fBuuid\fR(const char *_str);&quot; 4
+.IX Item &quot;uuid(const char *_str);&quot;
+The import constructor for string representation.
+.IP &quot;~\fBuuid\fR();&quot; 4
+.IX Item &quot;~uuid();&quot;
+The standard destructor for \fBuuid\fR class.
+.IP &quot;uuid &amp;\fBuuid::operator=\fR(const uuid &amp;_obj);&quot; 4
+.IX Item &quot;uuid &amp;uuid::operator=(const uuid &amp;_obj);&quot;
+The assignment operator corresponding to the copy constructor.
+.IP &quot;uuid &amp;\fBuuid::operator=\fR(const uuid_t *_obj);&quot; 4
+.IX Item &quot;uuid &amp;uuid::operator=(const uuid_t *_obj);&quot;
+The assignment operator corresponding to the import constructor for C \s-1API\s0 objects.
+.IP &quot;uuid &amp;\fBuuid::operator=\fR(const void *_bin);&quot; 4
+.IX Item &quot;uuid &amp;uuid::operator=(const void *_bin);&quot;
+The assignment operator corresponding to the import constructor for binary representation.
+.IP &quot;uuid &amp;\fBuuid::operator=\fR(const char *_str);&quot; 4
+.IX Item &quot;uuid &amp;uuid::operator=(const char *_str);&quot;
+The assignment operator corresponding to the import constructor for string and single integer value representation.
+.IP &quot;uuid \fBuuid::clone\fR(void);&quot; 4
+.IX Item &quot;uuid uuid::clone(void);&quot;
+Regular method corresponding to the C \s-1API\s0 function \fBuuid_clone\fR.
+.IP &quot;void \fBuuid::load\fR(const char *_name);&quot; 4
+.IX Item &quot;void uuid::load(const char *_name);&quot;
+Regular method corresponding to the C \s-1API\s0 function \fBuuid_load\fR.
+.IP &quot;void \fBuuid::make\fR(unsigned int _mode, ...);&quot; 4
+.IX Item &quot;void uuid::make(unsigned int _mode, ...);&quot;
+Regular method corresponding to the C \s-1API\s0 function \fBuuid_make\fR.
+.IP &quot;int \fBuuid::isnil\fR(void);&quot; 4
+.IX Item &quot;int uuid::isnil(void);&quot;
+Regular method corresponding to the C \s-1API\s0 function \fBuuid_isnil\fR.
+.IP &quot;int \fBuuid::compare\fR(const uuid &amp;_obj);&quot; 4
+.IX Item &quot;int uuid::compare(const uuid &amp;_obj);&quot;
+Regular method corresponding to the C \s-1API\s0 function \fBuuid_compare\fR.
+.IP &quot;int \fBuuid::operator==\fR(const uuid &amp;_obj);&quot; 4
+.IX Item &quot;int uuid::operator==(const uuid &amp;_obj);&quot;
+The comparison operator corresponding to \fBuuid_compare\fR usage for equality.
+.IP &quot;int \fBuuid::operator!=\fR(const uuid &amp;_obj);&quot; 4
+.IX Item &quot;int uuid::operator!=(const uuid &amp;_obj);&quot;
+The comparison operator corresponding to \fBuuid_compare\fR usage for inequality.
+.IP &quot;int \fBuuid::operator&lt;\fR(const uuid &amp;_obj);&quot; 4
+.IX Item &quot;int uuid::operator&lt;(const uuid &amp;_obj);&quot;
+The comparison operator corresponding to \fBuuid_compare\fR usage for less-than.
+.IP &quot;int \fBuuid::operator&lt;=\fR(const uuid &amp;_obj);&quot; 4
+.IX Item &quot;int uuid::operator&lt;=(const uuid &amp;_obj);&quot;
+The comparison operator corresponding to \fBuuid_compare\fR usage for less-than-or-equal.
+.IP &quot;int \fBuuid::operator&gt;\fR(const uuid &amp;_obj);&quot; 4
+.IX Item &quot;int uuid::operator&gt;(const uuid &amp;_obj);&quot;
+The comparison operator corresponding to \fBuuid_compare\fR usage for greater-than.
+.IP &quot;int \fBuuid::operator&gt;=\fR(const uuid &amp;_obj);&quot; 4
+.IX Item &quot;int uuid::operator&gt;=(const uuid &amp;_obj);&quot;
+The comparison operator corresponding to \fBuuid_compare\fR usage for greater-than-or-equal.
+.IP &quot;void \fBuuid::import\fR(const void *_bin);&quot; 4
+.IX Item &quot;void uuid::import(const void *_bin);&quot;
+Regular method corresponding to the C \s-1API\s0 function \fBuuid_import\fR for binary representation usage.
+.IP &quot;void \fBuuid::import\fR(const char *_str);&quot; 4
+.IX Item &quot;void uuid::import(const char *_str);&quot;
+Regular method corresponding to the C \s-1API\s0 function \fBuuid_import\fR for string representation usage.
+.IP &quot;void *\fBuuid::binary\fR(void);&quot; 4
+.IX Item &quot;void *uuid::binary(void);&quot;
+Regular method corresponding to the C \s-1API\s0 function \fBuuid_export\fR for binary representation usage.
+.IP &quot;char *\fBuuid::string\fR(void);&quot; 4
+.IX Item &quot;char *uuid::string(void);&quot;
+Regular method corresponding to the C \s-1API\s0 function \fBuuid_export\fR for string representation usage.
+.IP &quot;char *\fBuuid::integer\fR(void);&quot; 4
+.IX Item &quot;char *uuid::integer(void);&quot;
+Regular method corresponding to the C \s-1API\s0 function \fBuuid_export\fR for single integer value representation usage.
+.IP &quot;char *\fBuuid::summary\fR(void);&quot; 4
+.IX Item &quot;char *uuid::summary(void);&quot;
+Regular method corresponding to the C \s-1API\s0 function \fBuuid_export\fR for textual summary representation usage.
+.IP &quot;unsigned long \fBuuid::version\fR(void);&quot; 4
+.IX Item &quot;unsigned long uuid::version(void);&quot;
+Regular method corresponding to the C \s-1API\s0 function \fBuuid_version\fR.
+.IP &quot;\fBuuid_error_t\fR()&quot; 4
+.IX Item &quot;uuid_error_t()&quot;
+The standard constructor for \fBuuid_error_t\fR class.
+.IP &quot;\fBuuid_error_t\fR(uuid_rc_t _code)&quot; 4
+.IX Item &quot;uuid_error_t(uuid_rc_t _code)&quot;
+The standard constructor for \fBuuid_error_t\fR class with return code initialization.
+.IP &quot;~\fBuuid_error_t\fR()&quot; 4
+.IX Item &quot;~uuid_error_t()&quot;
+The standard destructor for \fBuuid_error_t\fR class.
+.IP &quot;void \fBuuid_error_t::code\fR(uuid_rc_t _code)&quot; 4
+.IX Item &quot;void uuid_error_t::code(uuid_rc_t _code)&quot;
+Regular method for setting the return code.
+.IP &quot;uuid_rc_t \fBuuid_error_t::code\fR(void)&quot; 4
+.IX Item &quot;uuid_rc_t uuid_error_t::code(void)&quot;
+Regular method for fetching the return code.
+.IP &quot;char *\fBuuid_error_t::string\fR(void)&quot; 4
+.IX Item &quot;char *uuid_error_t::string(void)&quot;
+Regular method for fetching the string corresponding to the current return code.
+.SH &quot;EXAMPLE&quot;
+.IX Header &quot;EXAMPLE&quot;
+The following shows an example usage of the \*(C+ \s-1API\s0. Exception handling is
+omitted for code simplification and has to be re-added for production
+code.
+.PP
+.Vb 5
+\&amp; /* generate a DCE 1.1 v1 UUID from system environment */
+\&amp; char *uuid_v1(void)
+\&amp; {
+\&amp;     uuid id;
+\&amp;     char *str;
+\&amp;
+\&amp;     id.make(UUID_MAKE_V1);
+\&amp;     str = id.string();
+\&amp;     return str;
+\&amp; }
+\&amp;
+\&amp; /* generate a DCE 1.1 v3 UUID from an URL */
+\&amp; char *uuid_v3(const char *url)
+\&amp; {
+\&amp;     uuid id;
+\&amp;     uuid id_ns;
+\&amp;     char *str;
+\&amp;
+\&amp;     id_ns.load(&quot;ns:URL&quot;);
+\&amp;     id.make(UUID_MAKE_V3, &amp;id_ns, url);
+\&amp;     str = id.string();
+\&amp;     return str;
+\&amp; }
+.Ve
+.SH &quot;SEE ALSO&quot;
+.IX Header &quot;SEE ALSO&quot;
+\&amp;\fIuuid\fR\|(3).
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuidcc"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid++.cc (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid++.cc                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid++.cc        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,301 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid++.cc: library C++ API implementation
+*/
+
+#include &lt;string.h&gt;
+#include &lt;stdarg.h&gt;
+
+#include &quot;uuid++.hh&quot;
+
+/*  standard constructor */
+uuid::uuid()
+{
+    uuid_rc_t rc;
+    if ((rc = uuid_create(&amp;ctx)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+}
+
+/*  copy constructor */
+uuid::uuid(const uuid &amp;obj)
+{
+    /* Notice: the copy constructor is the same as the assignment
+       operator (with the object as the argument) below, except that
+       (1) no check for self-assignment is required, (2) no existing
+       internals have to be destroyed and (3) no return value is given back. */
+    uuid_rc_t rc;
+    if ((rc = uuid_clone(obj.ctx, &amp;ctx)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+    return;
+}
+
+/*  extra constructor via C API object */
+uuid::uuid(const uuid_t *obj)
+{
+    uuid_rc_t rc;
+    if (obj == NULL)
+        throw uuid_error_t(UUID_RC_ARG);
+    if ((rc = uuid_clone(obj, &amp;ctx)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+    return;
+}
+
+/*  extra constructor via binary representation */
+uuid::uuid(const void *bin)
+{
+    uuid_rc_t rc;
+    if (bin == NULL)
+        throw uuid_error_t(UUID_RC_ARG);
+    if ((rc = uuid_create(&amp;ctx)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+    import(bin);
+    return;
+}
+
+/*  extra constructor via string representation */
+uuid::uuid(const char *str)
+{
+    uuid_rc_t rc;
+    if (str == NULL)
+        throw uuid_error_t(UUID_RC_ARG);
+    if ((rc = uuid_create(&amp;ctx)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+    import(str);
+    return;
+}
+
+/*  standard destructor */
+uuid::~uuid()
+{
+    uuid_destroy(ctx);
+    return;
+}
+
+/*  assignment operator: import of other C++ API object */
+uuid &amp;uuid::operator=(const uuid &amp;obj)
+{
+    uuid_rc_t rc;
+    if (this == &amp;obj)
+        return *this;
+    if ((rc = uuid_destroy(ctx)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+    if ((rc = uuid_clone(obj.ctx, &amp;ctx)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+    return *this;
+}
+
+/*  assignment operator: import of other C API object */
+uuid &amp;uuid::operator=(const uuid_t *obj)
+{
+    uuid_rc_t rc;
+    if (obj == NULL)
+        throw uuid_error_t(UUID_RC_ARG);
+    if ((rc = uuid_clone(obj, &amp;ctx)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+    return *this;
+}
+
+/*  assignment operator: import of binary representation */
+uuid &amp;uuid::operator=(const void *bin)
+{
+    if (bin == NULL)
+        throw uuid_error_t(UUID_RC_ARG);
+    import(bin);
+    return *this;
+}
+
+/*  assignment operator: import of string representation */
+uuid &amp;uuid::operator=(const char *str)
+{
+    if (str == NULL)
+        throw uuid_error_t(UUID_RC_ARG);
+    import(str);
+    return *this;
+}
+
+/*  method: clone object */
+uuid uuid::clone(void)
+{
+    return new uuid(this);
+}
+
+/*  method: loading existing UUID by name */
+void uuid::load(const char *name)
+{
+    uuid_rc_t rc;
+    if (name == NULL)
+        throw uuid_error_t(UUID_RC_ARG);
+    if ((rc = uuid_load(ctx, name)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+    return;
+}
+
+/*  method: making new UUID one from scratch */
+void uuid::make(unsigned int mode, ...)
+{
+    uuid_rc_t rc;
+    va_list ap;
+
+    va_start(ap, mode);
+    if ((mode &amp; UUID_MAKE_V3) || (mode &amp; UUID_MAKE_V5)) {
+        const uuid *ns = (const uuid *)va_arg(ap, const uuid *);
+        const char *name = (const char *)va_arg(ap, char *);
+        if (ns == NULL || name == NULL)
+            throw uuid_error_t(UUID_RC_ARG);
+        rc = uuid_make(ctx, mode, ns-&gt;ctx, name);
+    }
+    else
+        rc = uuid_make(ctx, mode);
+    va_end(ap);
+    if (rc != UUID_RC_OK)
+        throw uuid_error_t(rc);
+    return;
+}
+
+/*  method: comparison for Nil UUID */
+int uuid::isnil(void)
+{
+    uuid_rc_t rc;
+    int rv;
+
+    if ((rc = uuid_isnil(ctx, &amp;rv)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+    return rv;
+}
+
+/*  method: comparison against other object */
+int uuid::compare(const uuid &amp;obj)
+{
+    uuid_rc_t rc;
+    int rv;
+
+    if ((rc = uuid_compare(ctx, obj.ctx, &amp;rv)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+    return rv;
+}
+
+/*  method: comparison for equality */
+int uuid::operator==(const uuid &amp;obj)
+{
+    return (compare(obj) == 0);
+}
+
+/*  method: comparison for inequality */
+int uuid::operator!=(const uuid &amp;obj)
+{
+    return (compare(obj) != 0);
+}
+
+/*  method: comparison for lower-than */
+int uuid::operator&lt;(const uuid &amp;obj)
+{
+    return (compare(obj) &lt; 0);
+}
+
+/*  method: comparison for lower-than-or-equal */
+int uuid::operator&lt;=(const uuid &amp;obj)
+{
+    return (compare(obj) &lt;= 0);
+}
+
+/*  method: comparison for greater-than */
+int uuid::operator&gt;(const uuid &amp;obj)
+{
+    return (compare(obj) &gt; 0);
+}
+
+/*  method: comparison for greater-than-or-equal */
+int uuid::operator&gt;=(const uuid &amp;obj)
+{
+    return (compare(obj) &gt;= 0);
+}
+
+/*  method: import binary representation */
+void uuid::import(const void *bin)
+{
+    uuid_rc_t rc;
+    if ((rc = uuid_import(ctx, UUID_FMT_BIN, bin, UUID_LEN_BIN)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+    return;
+}
+
+/*  method: import string or single integer value representation */
+void uuid::import(const char *str)
+{
+    uuid_rc_t rc;
+    if ((rc = uuid_import(ctx, UUID_FMT_STR, str, UUID_LEN_STR)) != UUID_RC_OK)
+        if ((rc = uuid_import(ctx, UUID_FMT_SIV, str, UUID_LEN_SIV)) != UUID_RC_OK)
+            throw uuid_error_t(rc);
+    return;
+}
+
+/*  method: export binary representation */
+void *uuid::binary(void)
+{
+    uuid_rc_t rc;
+    void *bin = NULL;
+    if ((rc = uuid_export(ctx, UUID_FMT_BIN, &amp;bin, NULL)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+    return bin;
+}
+
+/*  method: export string representation */
+char *uuid::string(void)
+{
+    uuid_rc_t rc;
+    char *str = NULL;
+    if ((rc = uuid_export(ctx, UUID_FMT_STR, (void **)&amp;str, NULL)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+    return str;
+}
+
+/*  method: export single integer value representation */
+char *uuid::integer(void)
+{
+    uuid_rc_t rc;
+    char *str = NULL;
+    if ((rc = uuid_export(ctx, UUID_FMT_SIV, (void **)&amp;str, NULL)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+    return str;
+}
+
+/*  method: export textual summary representation */
+char *uuid::summary(void)
+{
+    uuid_rc_t rc;
+    char *txt = NULL;
+    if ((rc = uuid_export(ctx, UUID_FMT_TXT, (void **)&amp;txt, NULL)) != UUID_RC_OK)
+        throw uuid_error_t(rc);
+    return txt;
+}
+
+/*  method: return library version */
+unsigned long uuid::version(void)
+{
+    return uuid_version();
+}
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuidhh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid++.hh (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid++.hh                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid++.hh        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,98 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid++.hh: library C++ API definition
+*/
+
+#ifndef __UUIDXX_HH__
+#define __UUIDXX_HH__
+
+/* required C API header */
+#include &lt;stdlib.h&gt;
+#include &quot;uuid.h&quot;
+
+/* UUID object class */
+class uuid {
+    public:
+        /* construction &amp; destruction */
+                      uuid         ();                         /* standard constructor */
+                      uuid         (const uuid   &amp;_obj);       /* copy     constructor */
+                      uuid         (const uuid_t *_obj);       /* import   constructor */
+                      uuid         (const void   *_bin);       /* import   constructor */
+                      uuid         (const char   *_str);       /* import   constructor */
+                     ~uuid         ();                         /* destructor */
+
+        /* copying &amp; cloning */
+        uuid         &amp;operator=    (const uuid   &amp;_obj);       /* copy   assignment operator */
+        uuid         &amp;operator=    (const uuid_t *_obj);       /* import assignment operator */
+        uuid         &amp;operator=    (const void   *_bin);       /* import assignment operator */
+        uuid         &amp;operator=    (const char   *_str);       /* import assignment operator */
+        uuid          clone        (void);                     /* regular method */
+
+        /* content generation */
+        void          load         (const char *_name);        /* regular method */
+        void          make         (unsigned int _mode, ...);  /* regular method */
+
+        /* content comparison */
+        int           isnil        (void);                     /* regular method */
+        int           compare      (const uuid &amp;_obj);         /* regular method */
+        int           operator==   (const uuid &amp;_obj);         /* comparison operator */
+        int           operator!=   (const uuid &amp;_obj);         /* comparison operator */
+        int           operator&lt;    (const uuid &amp;_obj);         /* comparison operator */
+        int           operator&lt;=   (const uuid &amp;_obj);         /* comparison operator */
+        int           operator&gt;    (const uuid &amp;_obj);         /* comparison operator */
+        int           operator&gt;=   (const uuid &amp;_obj);         /* comparison operator */
+
+        /* content importing &amp; exporting */
+        void          import       (const void *_bin);         /* regular method */
+        void          import       (const char *_str);         /* regular method */
+        void         *binary       (void);                     /* regular method */
+        char         *string       (void);                     /* regular method */
+        char         *integer      (void);                     /* regular method */
+        char         *summary      (void);                     /* regular method */
+
+        unsigned long version      (void);                     /* regular method */
+
+    private:
+        uuid_t *ctx;
+};
+
+/* UUID exception class */
+class uuid_error_t {
+    public:
+                      uuid_error_t ()                     { code(UUID_RC_OK); };
+                      uuid_error_t (uuid_rc_t _code)      { code(_code); };
+                     ~uuid_error_t ()                     { };
+        void          code         (uuid_rc_t _code)      { rc = _code; };
+        uuid_rc_t     code         (void)                 { return rc; };
+        char         *string       (void)                 { return uuid_error(rc); };
+
+    private:
+        uuid_rc_t rc;
+};
+
+#endif /* __UUIDXX_HH__ */
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuidpod"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid++.pod (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid++.pod                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid++.pod        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,253 @@
</span><ins>+##
+##  OSSP uuid - Universally Unique Identifier
+##  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+##  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+##
+##  This file is part of OSSP uuid, a library for the generation
+##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+##  uuid++.pod: manual page for C++ API
+##
+
+=pod
+
+=head1 NAME
+
+B&lt;OSSP uuid&gt; - B&lt;Universally Unique Identifier&gt; (C++ API)
+
+=head1 VERSION
+
+OSSP uuid UUID_VERSION_STR
+
+=head1 DESCRIPTION
+
+B&lt;uuid++&gt; is the ISO-C++ language binding of the B&lt;OSSP uuid&gt; C API.
+It provides a thin ISO-C++ class B&lt;uuid&gt; wrapping the ISO-C API type
+B&lt;uuid_t&gt;.
+
+=head1 APPLICATION PROGRAMMING INTERFACE
+
+The ISO-C++ Application Programming Interface (API) of B&lt;OSSP uuid&gt;
+consists of the following components:
+
+=head2 CONSTANTS
+
+The constants are the same to those provided by the ISO-C API.
+See uuid(3) for details.
+
+=head2 CLASSES
+
+The following classes are provided:
+
+=over 4
+
+=item B&lt;uuid&gt;
+
+This is the class corresponding to the C API type B&lt;uuid_t&gt;.
+It is the main object.
+
+=item B&lt;uuid_error_t&gt;
+
+This is the class corresponding to the C API function B&lt;uuid_error&gt;.
+It is the object thrown as an exception in case of any errors.
+
+=back
+
+=head2 METHODS
+
+The following methods are provided:
+
+=over 4
+
+=item B&lt;uuid&gt;();
+
+The standard constructor.
+
+=item B&lt;uuid&gt;(const uuid &amp;_obj);
+
+The copy constructor for B&lt;uuid&gt; class.
+
+=item B&lt;uuid&gt;(const uuid_t *_obj);
+
+The import constructor for C API objects.
+
+=item B&lt;uuid&gt;(const void *_bin);
+
+The import constructor for binary representation.
+
+=item B&lt;uuid&gt;(const char *_str);
+
+The import constructor for string representation.
+
+=item ~B&lt;uuid&gt;();
+
+The standard destructor for B&lt;uuid&gt; class.
+
+=item uuid &amp;B&lt;uuid::operator=&gt;(const uuid &amp;_obj);
+
+The assignment operator corresponding to the copy constructor.
+
+=item uuid &amp;B&lt;uuid::operator=&gt;(const uuid_t *_obj);
+
+The assignment operator corresponding to the import constructor for C API objects.
+
+=item uuid &amp;B&lt;uuid::operator=&gt;(const void *_bin);
+
+The assignment operator corresponding to the import constructor for binary representation.
+
+=item uuid &amp;B&lt;uuid::operator=&gt;(const char *_str);
+
+The assignment operator corresponding to the import constructor for string and single integer value representation.
+
+=item uuid B&lt;uuid::clone&gt;(void);
+
+Regular method corresponding to the C API function B&lt;uuid_clone&gt;.
+
+=item void B&lt;uuid::load&gt;(const char *_name);
+
+Regular method corresponding to the C API function B&lt;uuid_load&gt;.
+
+=item void B&lt;uuid::make&gt;(unsigned int _mode, ...);
+
+Regular method corresponding to the C API function B&lt;uuid_make&gt;.
+
+=item int B&lt;uuid::isnil&gt;(void);
+
+Regular method corresponding to the C API function B&lt;uuid_isnil&gt;.
+
+=item int B&lt;uuid::compare&gt;(const uuid &amp;_obj);
+
+Regular method corresponding to the C API function B&lt;uuid_compare&gt;.
+
+=item int B&lt;uuid::operator==&gt;(const uuid &amp;_obj);
+
+The comparison operator corresponding to B&lt;uuid_compare&gt; usage for equality.
+
+=item int B&lt;uuid::operator!=&gt;(const uuid &amp;_obj);
+
+The comparison operator corresponding to B&lt;uuid_compare&gt; usage for inequality.
+
+=item int B&lt;uuid::operatorE&lt;lt&gt;&gt;(const uuid &amp;_obj);
+
+The comparison operator corresponding to B&lt;uuid_compare&gt; usage for less-than.
+
+=item int B&lt;uuid::operatorE&lt;lt&gt;=&gt;(const uuid &amp;_obj);
+
+The comparison operator corresponding to B&lt;uuid_compare&gt; usage for less-than-or-equal.
+
+=item int B&lt;uuid::operatorE&lt;gt&gt;&gt;(const uuid &amp;_obj);
+
+The comparison operator corresponding to B&lt;uuid_compare&gt; usage for greater-than.
+
+=item int B&lt;uuid::operatorE&lt;gt&gt;=&gt;(const uuid &amp;_obj);
+
+The comparison operator corresponding to B&lt;uuid_compare&gt; usage for greater-than-or-equal.
+
+=item void B&lt;uuid::import&gt;(const void *_bin);
+
+Regular method corresponding to the C API function B&lt;uuid_import&gt; for binary representation usage.
+
+=item void B&lt;uuid::import&gt;(const char *_str);
+
+Regular method corresponding to the C API function B&lt;uuid_import&gt; for string representation usage.
+
+=item void *B&lt;uuid::binary&gt;(void);
+
+Regular method corresponding to the C API function B&lt;uuid_export&gt; for binary representation usage.
+
+=item char *B&lt;uuid::string&gt;(void);
+
+Regular method corresponding to the C API function B&lt;uuid_export&gt; for string representation usage.
+
+=item char *B&lt;uuid::integer&gt;(void);
+
+Regular method corresponding to the C API function B&lt;uuid_export&gt; for single integer value representation usage.
+
+=item char *B&lt;uuid::summary&gt;(void);
+
+Regular method corresponding to the C API function B&lt;uuid_export&gt; for textual summary representation usage.
+
+=item unsigned long B&lt;uuid::version&gt;(void);
+
+Regular method corresponding to the C API function B&lt;uuid_version&gt;.
+
+=item B&lt;uuid_error_t&gt;()
+
+The standard constructor for B&lt;uuid_error_t&gt; class.
+
+=item B&lt;uuid_error_t&gt;(uuid_rc_t _code)
+
+The standard constructor for B&lt;uuid_error_t&gt; class with return code initialization.
+
+=item ~B&lt;uuid_error_t&gt;()
+
+The standard destructor for B&lt;uuid_error_t&gt; class.
+
+=item void B&lt;uuid_error_t::code&gt;(uuid_rc_t _code)
+
+Regular method for setting the return code.
+
+=item uuid_rc_t B&lt;uuid_error_t::code&gt;(void)
+
+Regular method for fetching the return code.
+
+=item char *B&lt;uuid_error_t::string&gt;(void)
+
+Regular method for fetching the string corresponding to the current return code.
+
+=back
+
+=head1 EXAMPLE
+
+The following shows an example usage of the C++ API. Exception handling is
+omitted for code simplification and has to be re-added for production
+code.
+
+ /* generate a DCE 1.1 v1 UUID from system environment */
+ char *uuid_v1(void)
+ {
+     uuid id;
+     char *str;
+
+     id.make(UUID_MAKE_V1);
+     str = id.string();
+     return str;
+ }
+
+ /* generate a DCE 1.1 v3 UUID from an URL */
+ char *uuid_v3(const char *url)
+ {
+     uuid id;
+     uuid id_ns;
+     char *str;
+
+     id_ns.load(&quot;ns:URL&quot;);
+     id.make(UUID_MAKE_V3, &amp;id_ns, url);
+     str = id.string();
+     return str;
+ }
+
+=head1 SEE ALSO
+
+uuid(3).
+
+=cut
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuidconfig1"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid-config.1 (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid-config.1                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid-config.1        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,236 @@
</span><ins>+.\&quot; Automatically generated by Pod::Man 2.16 (Pod::Simple 3.07)
+.\&quot;
+.\&quot; Standard preamble:
+.\&quot; ========================================================================
+.de Sh \&quot; Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \&quot; Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \&quot; Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \&quot; End verbatim text
+.ft R
+.fi
+..
+.\&quot; Set up some character translations and predefined strings.  \*(-- will
+.\&quot; give an unbreakable dash, \*(PI will give pi, \*(L&quot; will give a left
+.\&quot; double quote, and \*(R&quot; will give a right double quote.  \*(C+ will
+.\&quot; give a nicer C++.  Capital omega is used to do unbreakable dashes and
+.\&quot; therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
+.\&quot; nothing in troff, for use with C&lt;&gt;.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+.    ds -- \(*W-
+.    ds PI pi
+.    if (\n(.H=4u)&amp;(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\&quot; diablo 10 pitch
+.    if (\n(.H=4u)&amp;(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\&quot;  diablo 12 pitch
+.    ds L&quot; &quot;&quot;
+.    ds R&quot; &quot;&quot;
+.    ds C` 
+.    ds C' 
+'br\}
+.el\{\
+.    ds -- \|\(em\|
+.    ds PI \(*p
+.    ds L&quot; ``
+.    ds R&quot; ''
+'br\}
+.\&quot;
+.\&quot; Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.\&quot;
+.\&quot; If the F register is turned on, we'll generate index entries on stderr for
+.\&quot; titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\&quot; entries marked with X&lt;&gt; in POD.  Of course, you'll have to process the
+.\&quot; output yourself in some meaningful fashion.
+.ie \nF \{\
+.    de IX
+.    tm Index:\\$1\t\\n%\t&quot;\\$2&quot;
+..
+.    nr % 0
+.    rr F
+.\}
+.el \{\
+.    de IX
+..
+.\}
+.\&quot;
+.\&quot; Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\&quot; Fear.  Run.  Save yourself.  No user-serviceable parts.
+.    \&quot; fudge factors for nroff and troff
+.if n \{\
+.    ds #H 0
+.    ds #V .8m
+.    ds #F .3m
+.    ds #[ \f1
+.    ds #] \fP
+.\}
+.if t \{\
+.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+.    ds #V .6m
+.    ds #F 0
+.    ds #[ \&amp;
+.    ds #] \&amp;
+.\}
+.    \&quot; simple accents for nroff and troff
+.if n \{\
+.    ds ' \&amp;
+.    ds ` \&amp;
+.    ds ^ \&amp;
+.    ds , \&amp;
+.    ds ~ ~
+.    ds /
+.\}
+.if t \{\
+.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h&quot;|\\n:u&quot;
+.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+.    \&quot; troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+.    \&quot; corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+.    \&quot; for low resolution devices (crt and lpr)
+.if \n(.H&gt;23 .if \n(.V&gt;19 \
+\{\
+.    ds : e
+.    ds 8 ss
+.    ds o a
+.    ds d- d\h'-1'\(ga
+.    ds D- D\h'-1'\(hy
+.    ds th \o'bp'
+.    ds Th \o'LP'
+.    ds ae ae
+.    ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\&quot; ========================================================================
+.\&quot;
+.IX Title &quot;UUID-CONFIG 1&quot;
+.TH UUID-CONFIG 1 &quot;OSSP uuid 1.6.2&quot; &quot;04-Jul-2008&quot; &quot;Universally Unique Identifier&quot;
+.\&quot; For nroff, turn off justification.  Always turn off hyphenation; it makes
+.\&quot; way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH &quot;NAME&quot;
+\&amp;\fBuuid-config\fR \- \fB\s-1OSSP\s0 uuid \s-1API\s0 build utility\fR
+.SH &quot;VERSION&quot;
+.IX Header &quot;VERSION&quot;
+\&amp;\s-1OSSP\s0 uuid \s-11.6.2 (04-Jul-2008)\s0
+.SH &quot;SYNOPSIS&quot;
+.IX Header &quot;SYNOPSIS&quot;
+\&amp;\fBuuid-config\fR
+[\fB\-\-help\fR]
+[\fB\-\-version\fR]
+[\fB\-\-all\fR]
+[\fB\-\-prefix\fR]
+[\fB\-\-exec\-prefix\fR]
+[\fB\-\-bindir\fR]
+[\fB\-\-libdir\fR]
+[\fB\-\-includedir\fR]
+[\fB\-\-mandir\fR]
+[\fB\-\-datadir\fR]
+[\fB\-\-acdir\fR]
+[\fB\-\-cflags\fR]
+[\fB\-\-ldflags\fR]
+[\fB\-\-libs\fR]
+.SH &quot;DESCRIPTION&quot;
+.IX Header &quot;DESCRIPTION&quot;
+The \fBuuid-config\fR program is a little helper utility for easy configuring and
+building applications based on the \fIuuid\fR\|(3) library.  It can be used to query the
+C compiler and linker flags which are required to correctly compile and link
+the application against the \fIuuid\fR\|(3) library.
+.SH &quot;OPTIONS&quot;
+.IX Header &quot;OPTIONS&quot;
+\&amp;\fBuuid-config\fR accepts the following options:
+.IP &quot;\fB\-\-help\fR&quot; 2
+.IX Item &quot;--help&quot;
+Prints the short usage information.
+.IP &quot;\fB\-\-version\fR&quot; 2
+.IX Item &quot;--version&quot;
+Prints the version number and date of the installed \fIuuid\fR\|(3) library.
+.IP &quot;\fB\-\-all\fR&quot; 2
+.IX Item &quot;--all&quot;
+Forces the output of all flags, that is, including extra flags which are not
+\&amp;\fB\s-1OSSP\s0 uuid\fR specific.
+.IP &quot;\fB\-\-prefix\fR&quot; 2
+.IX Item &quot;--prefix&quot;
+Prints the installation prefix of architecture independent files
+.IP &quot;\fB\-\-exec\-prefix\fR&quot; 2
+.IX Item &quot;--exec-prefix&quot;
+Prints the installation prefix of architecture dependent files.
+.IP &quot;\fB\-\-bindir\fR&quot; 2
+.IX Item &quot;--bindir&quot;
+Prints the installation directory of binaries.
+.IP &quot;\fB\-\-libdir\fR&quot; 2
+.IX Item &quot;--libdir&quot;
+Prints the installation directory of libraries.
+.IP &quot;\fB\-\-includedir\fR&quot; 2
+.IX Item &quot;--includedir&quot;
+Prints the installation directory of include headers.
+.IP &quot;\fB\-\-mandir\fR&quot; 2
+.IX Item &quot;--mandir&quot;
+Prints the installation directory of manual pages.
+.IP &quot;\fB\-\-datadir\fR&quot; 2
+.IX Item &quot;--datadir&quot;
+Prints the installation directory of shared data.
+.IP &quot;\fB\-\-acdir\fR&quot; 2
+.IX Item &quot;--acdir&quot;
+Prints the installation directory of \fBautoconf\fR data.
+.IP &quot;\fB\-\-cflags\fR&quot; 2
+.IX Item &quot;--cflags&quot;
+Prints the C compiler flags which are needed to compile the \fIuuid\fR\|(3)\-based
+application. The output is usually added to the \f(CW\*(C`CFLAGS\*(C'\fR uuidiable of the
+applications \f(CW\*(C`Makefile\*(C'\fR.
+.IP &quot;\fB\-\-ldflags\fR&quot; 2
+.IX Item &quot;--ldflags&quot;
+Prints the linker flags (\f(CW\*(C`\-L\*(C'\fR) which are needed to link the application with
+the \fIuuid\fR\|(3) library. The output is usually added to the \f(CW\*(C`LDFLAGS\*(C'\fR uuidiable of
+the applications \f(CW\*(C`Makefile\*(C'\fR.
+.IP &quot;\fB\-\-libs\fR&quot; 2
+.IX Item &quot;--libs&quot;
+Prints the library flags (\f(CW\*(C`\-l\*(C'\fR) which are needed to link the application with
+the C \fIuuid\fR\|(3) library. The output is usually added to the \f(CW\*(C`LIBS\*(C'\fR uuidiable of the
+applications \f(CW\*(C`Makefile\*(C'\fR.
+.SH &quot;EXAMPLE&quot;
+.IX Header &quot;EXAMPLE&quot;
+.Vb 4
+\&amp; CC      = cc
+\&amp; CFLAGS  = \-O \`uuid\-config \-\-cflags\`
+\&amp; LDFLAGS = \`uuid\-config \-\-ldflags\`
+\&amp; LIBS    = \-lm \`uuid\-config \-\-libs\`
+\&amp;
+\&amp; all: foo
+\&amp; foo: foo.o
+\&amp;     $(CC) $(LDFLAGS) \-o foo foo.o $(LIBS)
+\&amp; foo.o: foo.c
+\&amp;     $(CC) $(CFLAGS) \-c foo.c
+.Ve
+.SH &quot;SEE ALSO&quot;
+.IX Header &quot;SEE ALSO&quot;
+\&amp;\fIuuid\fR\|(3), \fIuuid\fR\|(1), \fIOSSP::uuid\fR\|(3).
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuidconfigin"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid-config.in (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid-config.in                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid-config.in        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,145 @@
</span><ins>+#!/bin/sh
+##
+##  OSSP uuid - Universally Unique Identifier
+##  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+##  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+##
+##  This file is part of OSSP uuid, a library for the generation
+##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+##  uuid-config.in: library build utility
+##
+
+DIFS=' 
+'
+
+prefix=&quot;@prefix@&quot;
+exec_prefix=&quot;@exec_prefix@&quot;
+datarootdir=&quot;@datarootdir@&quot;
+
+uuid_prefix=&quot;$prefix&quot;
+uuid_exec_prefix=&quot;$exec_prefix&quot;
+uuid_bindir=&quot;@bindir@&quot;
+uuid_libdir=&quot;@libdir@&quot;
+uuid_includedir=&quot;@includedir@&quot;
+uuid_mandir=&quot;@mandir@&quot;
+uuid_datadir=&quot;@datadir@&quot;
+uuid_acdir=&quot;@datadir@/aclocal&quot;
+uuid_cflags=&quot;@CFLAGS@&quot;
+uuid_ldflags=&quot;@LDFLAGS@&quot;
+uuid_libs=&quot;@LIBS@&quot;
+uuid_version=&quot;@UUID_VERSION_STR@&quot;
+
+help=no
+version=no
+
+usage=&quot;uuid-config&quot;
+usage=&quot;$usage [--help] [--version] [--all]&quot;
+usage=&quot;$usage [--prefix] [--exec-prefix] [--bindir] [--libdir] [--includedir] [--mandir] [--datadir] [--acdir]&quot;
+usage=&quot;$usage [--cflags] [--ldflags] [--libs]&quot;
+if [ $# -eq 0 ]; then
+    echo &quot;uuid-config:Error: Invalid option&quot; 1&gt;&amp;2
+    echo &quot;uuid-config:Usage: $usage&quot; 1&gt;&amp;2
+    exit 1
+fi
+output=''
+output_extra=''
+all=no
+prev=''
+OIFS=&quot;$IFS&quot; IFS=&quot;$DIFS&quot;
+for option
+do
+    if [ &quot;.$prev&quot; != . ]; then
+        eval &quot;$prev=\$option&quot;
+        prev=''
+        continue
+    fi
+    case &quot;$option&quot; in
+        -*=*) optarg=`echo &quot;$option&quot; | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+           *) optarg='' ;;
+    esac
+    case &quot;$option&quot; in
+        --help|-h)
+            echo &quot;Usage: $usage&quot;
+            exit 0
+            ;;
+        --version|-v)
+            echo &quot;OSSP uuid $uuid_version&quot;
+            exit 0
+            ;;
+        --all)
+            all=yes
+            ;;
+        --prefix)
+            output=&quot;$output $uuid_prefix&quot;
+            ;;
+        --exec-prefix)
+            output=&quot;$output $uuid_exec_prefix&quot;
+            ;;
+        --bindir)
+            output=&quot;$output $uuid_bindir&quot;
+            ;;
+        --libdir)
+            output=&quot;$output $uuid_libdir&quot;
+            ;;
+        --includedir)
+            output=&quot;$output $uuid_includedir&quot;
+            ;;
+        --mandir)
+            output=&quot;$output $uuid_mandir&quot;
+            ;;
+        --datadir)
+            output=&quot;$output $uuid_datadir&quot;
+            ;;
+        --acdir)
+            output=&quot;$output $uuid_acdir&quot;
+            ;;
+        --cflags)
+            output=&quot;$output -I$uuid_includedir&quot;
+            output_extra=&quot;$output_extra $uuid_cflags&quot;
+            ;;
+        --ldflags)
+            output=&quot;$output -L$uuid_libdir&quot;
+            output_extra=&quot;$output_extra $uuid_ldflags&quot;
+            ;;
+        --libs)
+            output=&quot;$output -luuid&quot;
+            output_extra=&quot;$output_extra $uuid_libs&quot;
+            ;;
+        * )
+            echo &quot;uuid-config:Error: Invalid option&quot; 1&gt;&amp;2
+            echo &quot;uuid-config:Usage: $usage&quot; 1&gt;&amp;2
+            exit 1;
+            ;;
+    esac
+done
+IFS=&quot;$OIFS&quot;
+if [ &quot;.$prev&quot; != . ]; then
+    echo &quot;uuid-config:Error: missing argument to --`echo $prev | sed 's/_/-/g'`&quot; 1&gt;&amp;2
+    exit 1
+fi
+if [ &quot;.$output&quot; != . ]; then
+    if [ &quot;.$all&quot; = .yes ]; then
+        output=&quot;$output $output_extra&quot;
+    fi
+    echo $output
+fi
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuidconfigpod"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid-config.pod (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid-config.pod                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid-config.pod        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,155 @@
</span><ins>+#!/bin/sh
+##
+##  OSSP uuid - Universally Unique Identifier
+##  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+##  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+##
+##  This file is part of OSSP uuid, a library for the generation
+##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+##  uuid-config.pod: library build utility manpage
+##
+
+=pod
+
+=head1 NAME
+
+B&lt;uuid-config&gt; - B&lt;OSSP uuid API build utility&gt;
+
+=head1 VERSION
+
+OSSP uuid UUID_VERSION_STR
+
+=head1 SYNOPSIS
+
+B&lt;uuid-config&gt;
+[B&lt;--help&gt;]
+[B&lt;--version&gt;]
+[B&lt;--all&gt;]
+[B&lt;--prefix&gt;]
+[B&lt;--exec-prefix&gt;]
+[B&lt;--bindir&gt;]
+[B&lt;--libdir&gt;]
+[B&lt;--includedir&gt;]
+[B&lt;--mandir&gt;]
+[B&lt;--datadir&gt;]
+[B&lt;--acdir&gt;]
+[B&lt;--cflags&gt;]
+[B&lt;--ldflags&gt;]
+[B&lt;--libs&gt;]
+
+=head1 DESCRIPTION
+
+The B&lt;uuid-config&gt; program is a little helper utility for easy configuring and
+building applications based on the uuid(3) library.  It can be used to query the
+C compiler and linker flags which are required to correctly compile and link
+the application against the uuid(3) library.
+
+=head1 OPTIONS
+
+B&lt;uuid-config&gt; accepts the following options:
+
+=over 2
+
+=item B&lt;--help&gt;
+
+Prints the short usage information.
+
+=item B&lt;--version&gt;
+
+Prints the version number and date of the installed uuid(3) library.
+
+=item B&lt;--all&gt;
+
+Forces the output of all flags, that is, including extra flags which are not
+B&lt;OSSP uuid&gt; specific.
+
+=item B&lt;--prefix&gt;
+
+Prints the installation prefix of architecture independent files
+
+=item B&lt;--exec-prefix&gt;
+
+Prints the installation prefix of architecture dependent files.
+
+=item B&lt;--bindir&gt;
+
+Prints the installation directory of binaries.
+
+=item B&lt;--libdir&gt;
+
+Prints the installation directory of libraries.
+
+=item B&lt;--includedir&gt;
+
+Prints the installation directory of include headers.
+
+=item B&lt;--mandir&gt;
+
+Prints the installation directory of manual pages.
+
+=item B&lt;--datadir&gt;
+
+Prints the installation directory of shared data.
+
+=item B&lt;--acdir&gt;
+
+Prints the installation directory of B&lt;autoconf&gt; data.
+
+=item B&lt;--cflags&gt;
+
+Prints the C compiler flags which are needed to compile the uuid(3)-based
+application. The output is usually added to the C&lt;CFLAGS&gt; uuidiable of the
+applications C&lt;Makefile&gt;.
+
+=item B&lt;--ldflags&gt;
+
+Prints the linker flags (C&lt;-L&gt;) which are needed to link the application with
+the uuid(3) library. The output is usually added to the C&lt;LDFLAGS&gt; uuidiable of
+the applications C&lt;Makefile&gt;.
+
+=item B&lt;--libs&gt;
+
+Prints the library flags (C&lt;-l&gt;) which are needed to link the application with
+the C uuid(3) library. The output is usually added to the C&lt;LIBS&gt; uuidiable of the
+applications C&lt;Makefile&gt;.
+
+=back
+
+=head1 EXAMPLE
+
+ CC      = cc
+ CFLAGS  = -O `uuid-config --cflags`
+ LDFLAGS = `uuid-config --ldflags`
+ LIBS    = -lm `uuid-config --libs`
+
+ all: foo
+ foo: foo.o
+     $(CC) $(LDFLAGS) -o foo foo.o $(LIBS)
+ foo.o: foo.c
+     $(CC) $(CFLAGS) -c foo.c
+
+=head1 SEE ALSO
+
+uuid(3), uuid(1), OSSP::uuid(3).
+
+=cut
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid1"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid.1 (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid.1                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid.1        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,291 @@
</span><ins>+.\&quot; Automatically generated by Pod::Man 2.16 (Pod::Simple 3.07)
+.\&quot;
+.\&quot; Standard preamble:
+.\&quot; ========================================================================
+.de Sh \&quot; Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \&quot; Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \&quot; Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \&quot; End verbatim text
+.ft R
+.fi
+..
+.\&quot; Set up some character translations and predefined strings.  \*(-- will
+.\&quot; give an unbreakable dash, \*(PI will give pi, \*(L&quot; will give a left
+.\&quot; double quote, and \*(R&quot; will give a right double quote.  \*(C+ will
+.\&quot; give a nicer C++.  Capital omega is used to do unbreakable dashes and
+.\&quot; therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
+.\&quot; nothing in troff, for use with C&lt;&gt;.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+.    ds -- \(*W-
+.    ds PI pi
+.    if (\n(.H=4u)&amp;(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\&quot; diablo 10 pitch
+.    if (\n(.H=4u)&amp;(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\&quot;  diablo 12 pitch
+.    ds L&quot; &quot;&quot;
+.    ds R&quot; &quot;&quot;
+.    ds C` 
+.    ds C' 
+'br\}
+.el\{\
+.    ds -- \|\(em\|
+.    ds PI \(*p
+.    ds L&quot; ``
+.    ds R&quot; ''
+'br\}
+.\&quot;
+.\&quot; Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.\&quot;
+.\&quot; If the F register is turned on, we'll generate index entries on stderr for
+.\&quot; titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\&quot; entries marked with X&lt;&gt; in POD.  Of course, you'll have to process the
+.\&quot; output yourself in some meaningful fashion.
+.ie \nF \{\
+.    de IX
+.    tm Index:\\$1\t\\n%\t&quot;\\$2&quot;
+..
+.    nr % 0
+.    rr F
+.\}
+.el \{\
+.    de IX
+..
+.\}
+.\&quot;
+.\&quot; Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\&quot; Fear.  Run.  Save yourself.  No user-serviceable parts.
+.    \&quot; fudge factors for nroff and troff
+.if n \{\
+.    ds #H 0
+.    ds #V .8m
+.    ds #F .3m
+.    ds #[ \f1
+.    ds #] \fP
+.\}
+.if t \{\
+.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+.    ds #V .6m
+.    ds #F 0
+.    ds #[ \&amp;
+.    ds #] \&amp;
+.\}
+.    \&quot; simple accents for nroff and troff
+.if n \{\
+.    ds ' \&amp;
+.    ds ` \&amp;
+.    ds ^ \&amp;
+.    ds , \&amp;
+.    ds ~ ~
+.    ds /
+.\}
+.if t \{\
+.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h&quot;|\\n:u&quot;
+.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+.    \&quot; troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+.    \&quot; corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+.    \&quot; for low resolution devices (crt and lpr)
+.if \n(.H&gt;23 .if \n(.V&gt;19 \
+\{\
+.    ds : e
+.    ds 8 ss
+.    ds o a
+.    ds d- d\h'-1'\(ga
+.    ds D- D\h'-1'\(hy
+.    ds th \o'bp'
+.    ds Th \o'LP'
+.    ds ae ae
+.    ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\&quot; ========================================================================
+.\&quot;
+.IX Title &quot;UUID 1&quot;
+.TH UUID 1 &quot;OSSP uuid 1.6.2&quot; &quot;04-Jul-2008&quot; &quot;Universally Unique Identifier&quot;
+.\&quot; For nroff, turn off justification.  Always turn off hyphenation; it makes
+.\&quot; way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH &quot;NAME&quot;
+\&amp;\fB\s-1OSSP\s0 uuid\fR \- \fBUniversally Unique Identifier Command-Line Tool\fR
+.SH &quot;VERSION&quot;
+.IX Header &quot;VERSION&quot;
+\&amp;\s-1OSSP\s0 uuid \s-11.6.2 (04-Jul-2008)\s0
+.SH &quot;SYNOPSIS&quot;
+.IX Header &quot;SYNOPSIS&quot;
+\&amp;\fBuuid\fR
+[\fB\-v\fR \fIversion\fR]
+[\fB\-m\fR]
+[\fB\-n\fR \fIcount\fR]
+[\fB\-1\fR]
+[\fB\-F\fR \fIformat\fR]
+[\fB\-o\fR \fIfilename\fR]
+[\fInamespace\fR \fIname\fR]
+.PP
+\&amp;\fBuuid\fR
+\&amp;\fB\-d\fR
+[\fB\-r\fR]
+[\fB\-o\fR \fIfilename\fR]
+\&amp;\fIuuid\fR
+.SH &quot;DESCRIPTION&quot;
+.IX Header &quot;DESCRIPTION&quot;
+\&amp;\fB\s-1OSSP\s0 uuid\fR is a \s-1ISO\-C:1999\s0 application programming interface (\s-1API\s0) and
+corresponding command line interface (\s-1CLI\s0) for the generation of \s-1DCE\s0
+1.1, \s-1ISO/IEC\s0 11578:1996 and \s-1IETF\s0 \s-1RFC\-4122\s0 compliant \fIUniversally Unique
+Identifier\fR (\s-1UUID\s0). It supports \s-1DCE\s0 1.1 variant UUIDs of version 1 (time
+and node based), version 3 (name based, \s-1MD5\s0), version 4 (random number
+based) and version 5 (name based, \s-1SHA\-1\s0). Additional \s-1API\s0 bindings are
+provided for the languages \s-1ISO\-\*(C+:1998\s0, Perl:5 and \s-1PHP:4/5\s0. Optional
+backward compatibility exists for the ISO-C \s-1DCE\-1\s0.1 and Perl Data::UUID
+APIs.
+.PP
+UUIDs are 128 bit numbers which are intended to have a high likelihood
+of uniqueness over space and time and are computationally difficult
+to guess. They are globally unique identifiers which can be locally
+generated without contacting a global registration authority. UUIDs
+are intended as unique identifiers for both mass tagging objects
+with an extremely short lifetime and to reliably identifying very
+persistent objects across a network.
+.PP
+This is the command line interface (\s-1CLI\s0) of \fB\s-1OSSP\s0 uuid\fR. For a
+detailed description of UUIDs see the documentation of the application
+programming interface (\s-1API\s0) in \fIuuid\fR\|(3).
+.SH &quot;OPTIONS&quot;
+.IX Header &quot;OPTIONS&quot;
+.IP &quot;\fB\-v\fR \fIversion\fR&quot; 3
+.IX Item &quot;-v version&quot;
+Sets the version of the generated \s-1DCE\s0 1.1 variant \s-1UUID\s0. Supported
+are \fIversion\fR &quot;\f(CW1\fR\*(L&quot;, \*(R&quot;\f(CW3\fR\*(L&quot;, \*(R&quot;\f(CW4\fR\*(L&quot; and \*(R&quot;\f(CW5\fR\*(L&quot;. The default is \*(R&quot;\f(CW1\fR&quot;.
+.Sp
+For version 3 and version 5 UUIDs the additional command line arguments
+\&amp;\fInamespace\fR and \fIname\fR have to be given. The \fInamespace\fR is either
+a \s-1UUID\s0 in string representation or an identifier for internally
+pre-defined namespace UUIDs (currently known are &quot;\f(CW\*(C`ns:DNS\*(C'\fR\*(L&quot;,
+\&amp;\*(R&quot;\f(CW\*(C`ns:URL\*(C'\fR\*(L&quot;, \*(R&quot;\f(CW\*(C`ns:OID\*(C'\fR\*(L&quot;, and \*(R&quot;\f(CW\*(C`ns:X500\*(C'\fR&quot;). The \fIname\fR is a string of
+arbitrary length.
+.IP &quot;\fB\-m\fR&quot; 3
+.IX Item &quot;-m&quot;
+Forces the use of a random multi-cast \s-1MAC\s0 address when generating
+version 1 UUIDs. By default the real physical \s-1MAC\s0 address of the system
+is used.
+.IP &quot;\fB\-n\fR \fIcount\fR&quot; 3
+.IX Item &quot;-n count&quot;
+Generate \fIcount\fR UUIDs instead of just a single one (the default).
+.IP &quot;\fB\-1\fR&quot; 3
+.IX Item &quot;-1&quot;
+If option \fB\-n\fR is used with a \fIcount\fR greater than \f(CW1\fR, then this
+option can enforce the reset the \s-1UUID\s0 context for each generated \s-1UUID\s0.
+This makes no difference for \fIversion\fR \f(CW3\fR, \f(CW4\fR and \f(CW5\fR UUIDs. But
+version \f(CW1\fR UUIDs are based on the previously generated \s-1UUID\s0 which is
+remembered in the \s-1UUID\s0 context of the \s-1API\s0. Option \fB\-1\fR deletes the
+remembered \s-1UUID\s0 on each iteration.
+.IP &quot;\fB\-F\fR \fIformat\fR&quot; 3
+.IX Item &quot;-F format&quot;
+Representation format for importing or exporting an \s-1UUID\s0. The
+following (case insensitive) format identifiers are currently recognized:
+.RS 3
+.ie n .IP &quot;\*(C`BIN\*(C' (binary representation)&quot; 4
+.el .IP &quot;\f(CW\*(C`BIN\*(C'\fR (binary representation)&quot; 4
+.IX Item &quot;BIN (binary representation)&quot;
+This is the raw 128 bit network byte order binary representation of a
+\&amp;\s-1UUID\s0. Example is the octet stream \f(CW\*(C`0xF8 0x1D 0x4F 0xAE 0x7D 0xEC 0x11
+0xD0 0xA7 0x65 0x00 0xA0 0xC9 0x1E 0x6B 0xF6\*(C'\fR.
+.ie n .IP &quot;\*(C`STR\*(C' (string representation)&quot; 4
+.el .IP &quot;\f(CW\*(C`STR\*(C'\fR (string representation)&quot; 4
+.IX Item &quot;STR (string representation)&quot;
+This is the 36 character hexadecimal \s-1ASCII\s0 string representation of a
+\&amp;\s-1UUID\s0. Example is the string &quot;\f(CW\*(C`f81d4fae\-7dec\-11d0\-a765\-00a0c91e6bf6\*(C'\fR&quot;.
+.ie n .IP &quot;\*(C`SIV\*(C' (single integer value representation)&quot; 4
+.el .IP &quot;\f(CW\*(C`SIV\*(C'\fR (single integer value representation)&quot; 4
+.IX Item &quot;SIV (single integer value representation)&quot;
+This is the maximum 39 character long single integer
+value representation of a \s-1UUID\s0. Example is the string
+&quot;\f(CW329800735698586629295641978511506172918\fR&quot;.
+.RE
+.RS 3
+.RE
+.IP &quot;\fB\-o\fR \fIfilename\fR&quot; 3
+.IX Item &quot;-o filename&quot;
+Write output to \fIfilename\fR instead of to \fIstdout\fR.
+.IP &quot;\fB\-d\fR&quot; 3
+.IX Item &quot;-d&quot;
+Decode a given \s-1UUID\s0 (given as a command line argument or if the command
+line argument is &quot;\f(CW\*(C`\-\*(C'\fR&quot; the \s-1UUID\s0 is read from \fIstdin\fR) and dump textual
+information about the \s-1UUID\s0.
+.SH &quot;EXAMPLES&quot;
+.IX Header &quot;EXAMPLES&quot;
+.Vb 3
+\&amp; # generate DCE 1.1 v1 UUID (time and node based)
+\&amp; $ uuid \-v1
+\&amp; 01c47915\-4777\-11d8\-bc70\-0090272ff725
+\&amp;
+\&amp; # decode and dump DCE 1.1 v1 UUID (time and node based)
+\&amp; $ uuid \-d 01c47915\-4777\-11d8\-bc70\-0090272ff725
+\&amp; encode: STR:     01c47915\-4777\-11d8\-bc70\-0090272ff725
+\&amp;         SIV:     2349374037528578887923094374772111141
+\&amp; decode: variant: DCE 1.1, ISO/IEC 11578:1996
+\&amp;         version: 1 (time and node based)
+\&amp;         content: time:  2004\-01\-15 16:22:26.376322.1 UTC
+\&amp;                  clock: 15472 (usually random)
+\&amp;                  node:  00:90:27:2f:f7:25 (global unicast)
+\&amp;
+\&amp; # generate DCE 1.1 v3 UUID (name based)
+\&amp; $ uuid \-v3 ns:URL http://www.ossp.org/
+\&amp; 02d9e6d5\-9467\-382e\-8f9b\-9300a64ac3cd
+\&amp;
+\&amp; # decode and dump DCE 1.1 v3 UUID (name based)
+\&amp; $ uuid \-d 02d9e6d5\-9467\-382e\-8f9b\-9300a64ac3cd
+\&amp; encode: STR:     02d9e6d5\-9467\-382e\-8f9b\-9300a64ac3cd
+\&amp;         SIV:     3789866285607910888100818383505376205
+\&amp; decode: variant: DCE 1.1, ISO/IEC 11578:1996
+\&amp;         version: 3 (name based, MD5)
+\&amp;         content: 02:D9:E6:D5:94:67:08:2E:0F:9B:93:00:A6:4A:C3:CD
+\&amp;                  (not decipherable: MD5 message digest only)
+\&amp;
+\&amp; # generate DCE 1.1 v4 UUID 4 (random data based)
+\&amp; $ uuid \-v4
+\&amp; eb424026\-6f54\-4ef8\-a4d0\-bb658a1fc6cf
+\&amp;
+\&amp; # decode and dump DCE 1.1 v4 UUID 4 (random data based)
+\&amp; $ uuid \-d eb424026\-6f54\-4ef8\-a4d0\-bb658a1fc6cf
+\&amp; encode: STR:     eb424026\-6f54\-4ef8\-a4d0\-bb658a1fc6cf
+\&amp;         SIV:     312712571721458096795100956955942831823
+\&amp; decode: variant: DCE 1.1, ISO/IEC 11578:1996
+\&amp;         version: 4 (random data based)
+\&amp;         content: EB:42:40:26:6F:54:0E:F8:24:D0:BB:65:8A:1F:C6:CF
+\&amp;                  (no semantics: random data only)
+.Ve
+.SH &quot;SEE ALSO&quot;
+.IX Header &quot;SEE ALSO&quot;
+\&amp;\fIuuid\fR\|(3), \fIOSSP::uuid\fR\|(3).
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid3"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid.3 (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid.3                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid.3        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,578 @@
</span><ins>+.\&quot; Automatically generated by Pod::Man 2.16 (Pod::Simple 3.07)
+.\&quot;
+.\&quot; Standard preamble:
+.\&quot; ========================================================================
+.de Sh \&quot; Subsection heading
+.br
+.if t .Sp
+.ne 5
+.PP
+\fB\\$1\fR
+.PP
+..
+.de Sp \&quot; Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \&quot; Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \&quot; End verbatim text
+.ft R
+.fi
+..
+.\&quot; Set up some character translations and predefined strings.  \*(-- will
+.\&quot; give an unbreakable dash, \*(PI will give pi, \*(L&quot; will give a left
+.\&quot; double quote, and \*(R&quot; will give a right double quote.  \*(C+ will
+.\&quot; give a nicer C++.  Capital omega is used to do unbreakable dashes and
+.\&quot; therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
+.\&quot; nothing in troff, for use with C&lt;&gt;.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+.    ds -- \(*W-
+.    ds PI pi
+.    if (\n(.H=4u)&amp;(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\&quot; diablo 10 pitch
+.    if (\n(.H=4u)&amp;(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\&quot;  diablo 12 pitch
+.    ds L&quot; &quot;&quot;
+.    ds R&quot; &quot;&quot;
+.    ds C` 
+.    ds C' 
+'br\}
+.el\{\
+.    ds -- \|\(em\|
+.    ds PI \(*p
+.    ds L&quot; ``
+.    ds R&quot; ''
+'br\}
+.\&quot;
+.\&quot; Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.\&quot;
+.\&quot; If the F register is turned on, we'll generate index entries on stderr for
+.\&quot; titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
+.\&quot; entries marked with X&lt;&gt; in POD.  Of course, you'll have to process the
+.\&quot; output yourself in some meaningful fashion.
+.ie \nF \{\
+.    de IX
+.    tm Index:\\$1\t\\n%\t&quot;\\$2&quot;
+..
+.    nr % 0
+.    rr F
+.\}
+.el \{\
+.    de IX
+..
+.\}
+.\&quot;
+.\&quot; Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\&quot; Fear.  Run.  Save yourself.  No user-serviceable parts.
+.    \&quot; fudge factors for nroff and troff
+.if n \{\
+.    ds #H 0
+.    ds #V .8m
+.    ds #F .3m
+.    ds #[ \f1
+.    ds #] \fP
+.\}
+.if t \{\
+.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+.    ds #V .6m
+.    ds #F 0
+.    ds #[ \&amp;
+.    ds #] \&amp;
+.\}
+.    \&quot; simple accents for nroff and troff
+.if n \{\
+.    ds ' \&amp;
+.    ds ` \&amp;
+.    ds ^ \&amp;
+.    ds , \&amp;
+.    ds ~ ~
+.    ds /
+.\}
+.if t \{\
+.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h&quot;|\\n:u&quot;
+.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+.    \&quot; troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+.    \&quot; corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+.    \&quot; for low resolution devices (crt and lpr)
+.if \n(.H&gt;23 .if \n(.V&gt;19 \
+\{\
+.    ds : e
+.    ds 8 ss
+.    ds o a
+.    ds d- d\h'-1'\(ga
+.    ds D- D\h'-1'\(hy
+.    ds th \o'bp'
+.    ds Th \o'LP'
+.    ds ae ae
+.    ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\&quot; ========================================================================
+.\&quot;
+.IX Title &quot;.::uuid 3&quot;
+.TH .::uuid 3 &quot;OSSP uuid 1.6.2&quot; &quot;04-Jul-2008&quot; &quot;Universally Unique Identifier&quot;
+.\&quot; For nroff, turn off justification.  Always turn off hyphenation; it makes
+.\&quot; way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH &quot;NAME&quot;
+\&amp;\fB\s-1OSSP\s0 uuid\fR \- \fBUniversally Unique Identifier\fR
+.SH &quot;VERSION&quot;
+.IX Header &quot;VERSION&quot;
+\&amp;\s-1OSSP\s0 uuid \s-11.6.2 (04-Jul-2008)\s0
+.SH &quot;DESCRIPTION&quot;
+.IX Header &quot;DESCRIPTION&quot;
+\&amp;\fB\s-1OSSP\s0 uuid\fR is a \s-1ISO\-C:1999\s0 application programming interface (\s-1API\s0) and
+corresponding command line interface (\s-1CLI\s0) for the generation of \s-1DCE\s0
+1.1, \s-1ISO/IEC\s0 11578:1996 and \s-1IETF\s0 \s-1RFC\-4122\s0 compliant \fIUniversally Unique
+Identifier\fR (\s-1UUID\s0). It supports \s-1DCE\s0 1.1 variant UUIDs of version 1 (time
+and node based), version 3 (name based, \s-1MD5\s0), version 4 (random number
+based) and version 5 (name based, \s-1SHA\-1\s0). Additional \s-1API\s0 bindings are
+provided for the languages \s-1ISO\-\*(C+:1998\s0, Perl:5 and \s-1PHP:4/5\s0. Optional
+backward compatibility exists for the ISO-C \s-1DCE\-1\s0.1 and Perl Data::UUID
+APIs.
+.PP
+UUIDs are 128 bit numbers which are intended to have a high likelihood
+of uniqueness over space and time and are computationally difficult
+to guess. They are globally unique identifiers which can be locally
+generated without contacting a global registration authority. UUIDs
+are intended as unique identifiers for both mass tagging objects
+with an extremely short lifetime and to reliably identifying very
+persistent objects across a network.
+.PP
+This is the ISO-C application programming interface (\s-1API\s0) of \fB\s-1OSSP\s0 uuid\fR.
+.Sh &quot;\s-1UUID\s0 Binary Representation&quot;
+.IX Subsection &quot;UUID Binary Representation&quot;
+According to the \s-1DCE\s0 1.1, \s-1ISO/IEC\s0 11578:1996 and \s-1IETF\s0 \s-1RFC\-4122\s0
+standards, a \s-1DCE\s0 1.1 variant \s-1UUID\s0 is a 128 bit number defined out of 7
+fields, each field a multiple of an octet in size and stored in network
+byte order:
+.PP
+.Vb 11
+\&amp;                                                    [4]
+\&amp;                                                   version
+\&amp;                                                 \-\-&gt;|  |&lt;\-\-
+\&amp;                                                    |  |
+\&amp;                                                    |  |  [16]
+\&amp;                [32]                      [16]      |  |time_hi
+\&amp;              time_low                  time_mid    | _and_version
+\&amp;    |&lt;\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-&gt;||&lt;\-\-\-\-\-\-\-\-\-\-\-\-&gt;||&lt;\-\-\-\-\-\-\-\-\-\-\-\-&gt;|
+\&amp;    | MSB                          ||              ||  |           |
+\&amp;    | /                            ||              ||  |           |
+\&amp;    |/                             ||              ||  |           |
+\&amp;
+\&amp;    +\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-+~~
+\&amp;    |  15  ||  14  ||  13  ||  12  ||  11  ||  10  |####9  ||   8  |
+\&amp;    | MSO  ||      ||      ||      ||      ||      |####   ||      |
+\&amp;    +\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-+~~
+\&amp;    7654321076543210765432107654321076543210765432107654321076543210
+\&amp;
+\&amp;  ~~+\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-+
+\&amp;    ##* 7  ||   6  ||   5  ||   4  ||   3  ||   2  ||   1  ||   0  |
+\&amp;    ##*    ||      ||      ||      ||      ||      ||      ||  LSO |
+\&amp;  ~~+\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-++\-\-\-\-\-\-+
+\&amp;    7654321076543210765432107654321076543210765432107654321076543210
+\&amp;
+\&amp;    | |    ||      ||                                             /|
+\&amp;    | |    ||      ||                                            / |
+\&amp;    | |    ||      ||                                          LSB |
+\&amp;    |&lt;\-\-\-\-&gt;||&lt;\-\-\-\-&gt;||&lt;\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-&gt;|
+\&amp;    |clk_seq clk_seq                      node
+\&amp;    |_hi_res _low                         [48]
+\&amp;    |[5\-6]    [8]
+\&amp;    | |
+\&amp; \-\-&gt;| |&lt;\-\-
+\&amp;  variant
+\&amp;   [2\-3]
+.Ve
+.PP
+An example of a \s-1UUID\s0 binary representation is the octet stream \f(CW\*(C`0xF8
+0x1D 0x4F 0xAE 0x7D 0xEC 0x11 0xD0 0xA7 0x65 0x00 0xA0 0xC9 0x1E 0x6B
+0xF6\*(C'\fR. The binary representation format is exactly what the \fB\s-1OSSP\s0 uuid\fR
+\&amp;\s-1API\s0 functions \fBuuid_import\fR() and \fBuuid_export\fR() deal with under
+\&amp;\f(CW\*(C`UUID_FMT_BIN\*(C'\fR.
+.Sh &quot;\s-1UUID\s0 \s-1ASCII\s0 String Representation&quot;
+.IX Subsection &quot;UUID ASCII String Representation&quot;
+According to the \s-1DCE\s0 1.1, \s-1ISO/IEC\s0 11578:1996 and \s-1IETF\s0 \s-1RFC\-4122\s0
+standards, a \s-1DCE\s0 1.1 variant \s-1UUID\s0 is represented as an \s-1ASCII\s0 string
+consisting of 8 hexadecimal digits followed by a hyphen, then three
+groups of 4 hexadecimal digits each followed by a hyphen, then 12
+hexadecimal digits. Formally, the string representation is defined by
+the following grammar:
+.PP
+.Vb 10
+\&amp; uuid                        = &lt;time_low&gt; &quot;\-&quot;
+\&amp;                               &lt;time_mid&gt; &quot;\-&quot;
+\&amp;                               &lt;time_high_and_version&gt; &quot;\-&quot;
+\&amp;                               &lt;clock_seq_high_and_reserved&gt;
+\&amp;                               &lt;clock_seq_low&gt; &quot;\-&quot;
+\&amp;                               &lt;node&gt;
+\&amp; time_low                    = 4*&lt;hex_octet&gt;
+\&amp; time_mid                    = 2*&lt;hex_octet&gt;
+\&amp; time_high_and_version       = 2*&lt;hex_octet&gt;
+\&amp; clock_seq_high_and_reserved = &lt;hex_octet&gt;
+\&amp; clock_seq_low               = &lt;hex_octet&gt;
+\&amp; node                        = 6*&lt;hex_octet&gt;
+\&amp; hex_octet                   = &lt;hex_digit&gt; &lt;hex_digit&gt;
+\&amp; hex_digit                   = &quot;0&quot;|&quot;1&quot;|&quot;2&quot;|&quot;3&quot;|&quot;4&quot;|&quot;5&quot;|&quot;6&quot;|&quot;7&quot;|&quot;8&quot;|&quot;9&quot;
+\&amp;                              |&quot;a&quot;|&quot;b&quot;|&quot;c&quot;|&quot;d&quot;|&quot;e&quot;|&quot;f&quot;
+\&amp;                              |&quot;A&quot;|&quot;B&quot;|&quot;C&quot;|&quot;D&quot;|&quot;E&quot;|&quot;F&quot;
+.Ve
+.PP
+An example of a \s-1UUID\s0 string representation is the \s-1ASCII\s0 string
+&quot;\f(CW\*(C`f81d4fae\-7dec\-11d0\-a765\-00a0c91e6bf6\*(C'\fR&quot;. The string representation
+format is exactly what the \fB\s-1OSSP\s0 uuid\fR \s-1API\s0 functions \fBuuid_import\fR()
+and \fBuuid_export\fR() deal with under \f(CW\*(C`UUID_FMT_STR\*(C'\fR.
+.PP
+Notice: a corresponding \s-1URL\s0 can be generated out of a \s-1ASCII\s0 string
+representation of an \s-1UUID\s0 by prefixing with &quot;\f(CW\*(C`urn:uuid:\*(C'\fR\*(L&quot; as in
+\&amp;\*(R&quot;\f(CW\*(C`urn:uuid:f81d4fae\-7dec\-11d0\-a765\-00a0c91e6bf6\*(C'\fR&quot;.
+.Sh &quot;\s-1UUID\s0 Single Integer Value Representation&quot;
+.IX Subsection &quot;UUID Single Integer Value Representation&quot;
+According to the \s-1ISO/IEC\s0 11578:1996 and ITU-T Rec. X.667 standards, a
+\&amp;\s-1DCE\s0 1.1 variant \s-1UUID\s0 can be also represented as a single integer value
+consisting of a decimal number with up to 39 digits.
+.PP
+An example of a \s-1UUID\s0 single integer value representation is the decimal
+number &quot;\f(CW329800735698586629295641978511506172918\fR&quot;. The string
+representation format is exactly what the \fB\s-1OSSP\s0 uuid\fR \s-1API\s0 functions
+\&amp;\fBuuid_import\fR() and \fBuuid_export\fR() deal with under \f(CW\*(C`UUID_FMT_SIV\*(C'\fR.
+.PP
+Notice: a corresponding \s-1ISO\s0 \s-1OID\s0 can be generated under the
+\&amp;\*(L&quot;{\fIjoint\-iso\-itu\-t\fR\|(2) uuid(25)}\*(R&quot; arc out of a single integer value
+representation of a \s-1UUID\s0 by prefixing with &quot;\f(CW2.25.\fR\*(L&quot;. An example \s-1OID\s0
+is \*(R&quot;\f(CW2.25.329800735698586629295641978511506172918\fR\*(L&quot;. Additionally,
+an \s-1URL\s0 can be generated by further prefixing with \*(R&quot;\f(CW\*(C`urn:oid:\*(C'\fR\*(L&quot; as in
+\&amp;\*(R&quot;\f(CW\*(C`urn:oid:2.25.329800735698586629295641978511506172918\*(C'\fR&quot;.
+.Sh &quot;\s-1UUID\s0 Variants and Versions&quot;
+.IX Subsection &quot;UUID Variants and Versions&quot;
+A \s-1UUID\s0 has a variant and version. The variant defines the layout of the
+\&amp;\s-1UUID\s0. The version defines the content of the \s-1UUID\s0. The \s-1UUID\s0 variant
+supported in \fB\s-1OSSP\s0 uuid\fR is the \s-1DCE\s0 1.1 variant only. The \s-1DCE\s0 1.1 \s-1UUID\s0
+variant versions supported in \fB\s-1OSSP\s0 uuid\fR are:
+.IP &quot;\fBVersion 1\fR (time and node based)&quot; 4
+.IX Item &quot;Version 1 (time and node based)&quot;
+These are the classical UUIDs, created out of a 60\-bit system time,
+a 14\-bit local clock sequence and 48\-bit system \s-1MAC\s0 address. The \s-1MAC\s0
+address can be either the real one of a physical network interface card
+(\s-1NIC\s0) or a random multi-cast \s-1MAC\s0 address. Version 1 UUIDs are usually
+used as one-time global unique identifiers.
+.IP &quot;\fBVersion 3\fR (name based, \s-1MD5\s0)&quot; 4
+.IX Item &quot;Version 3 (name based, MD5)&quot;
+These are UUIDs which are based on the 128\-bit \s-1MD5\s0 message digest of the
+concatenation of a 128\-bit namespace \s-1UUID\s0 and a name string of arbitrary
+length. Version 3 UUIDs are usually used for non-unique but repeatable
+message digest identifiers.
+.IP &quot;\fBVersion 4\fR (random data based)&quot; 4
+.IX Item &quot;Version 4 (random data based)&quot;
+These are UUIDs which are based on just 128\-bit of random data. Version
+4 UUIDs are usually used as one-time local unique identifiers.
+.IP &quot;\fBVersion 5\fR (name based, \s-1SHA\-1\s0)&quot; 4
+.IX Item &quot;Version 5 (name based, SHA-1)&quot;
+These are UUIDs which are based on the 160\-bit \s-1SHA\-1\s0 message digest of the
+concatenation of a 128\-bit namespace \s-1UUID\s0 and a name string of arbitrary
+length. Version 5 UUIDs are usually used for non-unique but repeatable
+message digest identifiers.
+.Sh &quot;\s-1UUID\s0 Uniqueness&quot;
+.IX Subsection &quot;UUID Uniqueness&quot;
+Version 1 UUIDs are guaranteed to be unique through combinations of
+hardware addresses, time stamps and random seeds. There is a reference
+in the \s-1UUID\s0 to the hardware (\s-1MAC\s0) address of the first network interface
+card (\s-1NIC\s0) on the host which generated the \s-1UUID\s0 \*(-- this reference
+is intended to ensure the \s-1UUID\s0 will be unique in space as the \s-1MAC\s0
+address of every network card is assigned by a single global authority
+(\s-1IEEE\s0) and is guaranteed to be unique. The next component in a \s-1UUID\s0
+is a timestamp which, as clock always (should) move forward, will
+be unique in time. Just in case some part of the above goes wrong
+(the hardware address cannot be determined or the clock moved steps
+backward), there is a random clock sequence component placed into the
+\&amp;\s-1UUID\s0 as a \*(L&quot;catch-all\*(R&quot; for uniqueness.
+.PP
+Version 3 and version 5 UUIDs are guaranteed to be inherently globally
+unique if the combination of namespace and name used to generate them is
+unique.
+.PP
+Version 4 UUIDs are not guaranteed to be globally unique, because they
+are generated out of locally gathered pseudo-random numbers only.
+Nevertheless there is still a high likelihood of uniqueness over space
+and time and that they are computationally difficult to guess.
+.Sh &quot;Nil \s-1UUID\s0&quot;
+.IX Subsection &quot;Nil UUID&quot;
+There is a special \fINil\fR \s-1UUID\s0 consisting of all octets set to zero in
+the binary representation. It can be used as a special \s-1UUID\s0 value which does
+not conflict with real UUIDs.
+.SH &quot;APPLICATION PROGRAMMING INTERFACE&quot;
+.IX Header &quot;APPLICATION PROGRAMMING INTERFACE&quot;
+The ISO-C Application Programming Interface (\s-1API\s0) of \fB\s-1OSSP\s0 uuid\fR
+consists of the following components.
+.Sh &quot;\s-1CONSTANTS\s0&quot;
+.IX Subsection &quot;CONSTANTS&quot;
+The following constants are provided:
+.IP &quot;\fB\s-1UUID_VERSION\s0\fR&quot; 4
+.IX Item &quot;UUID_VERSION&quot;
+The hexadecimal encoded \fB\s-1OSSP\s0 uuid\fR version. This allows compile-time
+checking of the \fB\s-1OSSP\s0 uuid\fR version. For run-time checking use
+\&amp;\fBuuid_version\fR() instead.
+.Sp
+The hexadecimal encoding for a version &quot;$\fIv\fR.$\fIr\fR$\fIt\fR$\fIl\fR&quot; is
+calculated with the \fB\s-1GNU\s0 shtool\fR \fBversion\fR command and is (in
+Perl-style for concise description) &quot;sprintf('0x%x%02x%d%02x', $\fIv\fR,
+$\fIr\fR, {qw(s 9 . 2 b 1 a 0)}\-&gt;{$\fIt\fR}, ($\fIt\fR eq 's' ? 99 : $\fIl\fR))\*(L&quot;,
+i.e., the version 0.9.6 is encoded as \*(R&quot;0x009206&quot;.
+.IP &quot;\fB\s-1UUID_LEN_BIN\s0\fR, \fB\s-1UUID_LEN_STR\s0\fR, \fB\s-1UUID_LEN_SIV\s0\fR&quot; 4
+.IX Item &quot;UUID_LEN_BIN, UUID_LEN_STR, UUID_LEN_SIV&quot;
+The number of octets of the \s-1UUID\s0 binary and string representations.
+Notice that the lengths of the string representation (\fB\s-1UUID_LEN_STR\s0\fR)
+and the lengths of the single integer value representation
+(\fB\s-1UUID_LEN_SIV\s0\fR) does \fInot\fR include the necessary \f(CW\*(C`NUL\*(C'\fR termination
+character.
+.IP &quot;\fB\s-1UUID_MAKE_V1\s0\fR, \fB\s-1UUID_MAKE_V3\s0\fR, \fB\s-1UUID_MAKE_V4\s0\fR, \fB\s-1UUID_MAKE_V5\s0\fR, \fB\s-1UUID_MAKE_MC\s0\fR&quot; 4
+.IX Item &quot;UUID_MAKE_V1, UUID_MAKE_V3, UUID_MAKE_V4, UUID_MAKE_V5, UUID_MAKE_MC&quot;
+The \fImode\fR bits for use with \fBuuid_make\fR(). The \fB\s-1UUID_MAKE_V\s0\fR\fIN\fR
+specify which \s-1UUID\s0 version to generate. The \fB\s-1UUID_MAKE_MC\s0\fR forces the
+use of a random multi-cast \s-1MAC\s0 address instead of the real physical \s-1MAC\s0
+address in version 1 UUIDs.
+.IP &quot;\fB\s-1UUID_RC_OK\s0\fR, \fB\s-1UUID_RC_ARG\s0\fR, \fB\s-1UUID_RC_MEM\s0\fR, \fB\s-1UUID_RC_SYS\s0\fR, \fB\s-1UUID_RC_INT\s0\fR, \fB\s-1UUID_RC_IMP\s0\fR&quot; 4
+.IX Item &quot;UUID_RC_OK, UUID_RC_ARG, UUID_RC_MEM, UUID_RC_SYS, UUID_RC_INT, UUID_RC_IMP&quot;
+The possible numerical return-codes of \s-1API\s0 functions.
+The \f(CW\*(C`UUID_RC_OK\*(C'\fR indicates success, the others indicate errors.
+Use \fBuuid_error\fR() to translate them into string versions.
+.IP &quot;\fB\s-1UUID_FMT_BIN\s0\fR, \fB\s-1UUID_FMT_STR\s0\fR, \fB\s-1UUID_FMT_SIV\s0\fR, \fB\s-1UUID_FMT_TXT\s0\fR&quot; 4
+.IX Item &quot;UUID_FMT_BIN, UUID_FMT_STR, UUID_FMT_SIV, UUID_FMT_TXT&quot;
+The \fIfmt\fR formats for use with \fBuuid_import\fR() and \fBuuid_export\fR().
+The \fB\s-1UUID_FMT_BIN\s0\fR indicates the \s-1UUID\s0 binary representation (of
+length \fB\s-1UUID_LEN_BIN\s0\fR), the \fB\s-1UUID_FMT_STR\s0\fR indicates the \s-1UUID\s0 string
+representation (of length \fB\s-1UUID_LEN_STR\s0\fR), the \fB\s-1UUID_FMT_SIV\s0\fR
+indicates the \s-1UUID\s0 single integer value representation (of maximum
+length \fB\s-1UUID_LEN_SIV\s0\fR) and the \fB\s-1UUID_FMT_TXT\s0\fR indicates the textual
+description (of arbitrary length) of a \s-1UUID\s0.
+.Sh &quot;\s-1FUNCTIONS\s0&quot;
+.IX Subsection &quot;FUNCTIONS&quot;
+The following functions are provided:
+.IP &quot;uuid_rc_t \fBuuid_create\fR(uuid_t **\fIuuid\fR);&quot; 4
+.IX Item &quot;uuid_rc_t uuid_create(uuid_t **uuid);&quot;
+Create a new \s-1UUID\s0 object and store a pointer to it in \f(CW\*(C`*\*(C'\fR\fIuuid\fR.
+A \s-1UUID\s0 object consists of an internal representation of a \s-1UUID\s0, the
+internal \s-1PRNG\s0 and \s-1MD5\s0 generator contexts, and cached \s-1MAC\s0 address and
+timestamp information. The initial \s-1UUID\s0 is the \fINil\fR \s-1UUID\s0.
+.IP &quot;uuid_rc_t \fBuuid_destroy\fR(uuid_t *\fIuuid\fR);&quot; 4
+.IX Item &quot;uuid_rc_t uuid_destroy(uuid_t *uuid);&quot;
+Destroy \s-1UUID\s0 object \fIuuid\fR.
+.IP &quot;uuid_rc_t \fBuuid_clone\fR(const uuid_t *\fIuuid\fR, uuid_t **\fIuuid_clone\fR);&quot; 4
+.IX Item &quot;uuid_rc_t uuid_clone(const uuid_t *uuid, uuid_t **uuid_clone);&quot;
+Clone \s-1UUID\s0 object \fIuuid\fR and store new \s-1UUID\s0 object in \fIuuid_clone\fR.
+.IP &quot;uuid_rc_t \fBuuid_isnil\fR(const uuid_t *\fIuuid\fR, int *\fIresult\fR);&quot; 4
+.IX Item &quot;uuid_rc_t uuid_isnil(const uuid_t *uuid, int *result);&quot;
+Checks whether the \s-1UUID\s0 in \fIuuid\fR is the \fINil\fR \s-1UUID\s0.
+If this is the case, it returns \fItrue\fR in \f(CW\*(C`*\*(C'\fR\fIresult\fR.
+Else it returns \fIfalse\fR in \f(CW\*(C`*\*(C'\fR\fIresult\fR.
+.IP &quot;uuid_rc_t \fBuuid_compare\fR(const uuid_t *\fIuuid\fR, const uuid_t *\fIuuid2\fR, int *\fIresult\fR);&quot; 4
+.IX Item &quot;uuid_rc_t uuid_compare(const uuid_t *uuid, const uuid_t *uuid2, int *result);&quot;
+Compares the order of the two UUIDs in \fIuuid1\fR and \fIuuid2\fR
+and returns the result in \f(CW\*(C`*\*(C'\fR\fIresult\fR: \f(CW\*(C`\-1\*(C'\fR if \fIuuid1\fR is
+smaller than \fIuuid2\fR, \f(CW0\fR if \fIuuid1\fR is equal to \fIuuid2\fR
+and \f(CW+1\fR if \fIuuid1\fR is greater than \fIuuid2\fR.
+.IP &quot;uuid_rc_t \fBuuid_import\fR(uuid_t *\fIuuid\fR, uuid_fmt_t \fIfmt\fR, const void *\fIdata_ptr\fR, size_t \fIdata_len\fR);&quot; 4
+.IX Item &quot;uuid_rc_t uuid_import(uuid_t *uuid, uuid_fmt_t fmt, const void *data_ptr, size_t data_len);&quot;
+Imports a \s-1UUID\s0 \fIuuid\fR from an external representation of format \fIfmt\fR.
+The data is read from the buffer at \fIdata_ptr\fR which contains at least
+\&amp;\fIdata_len\fR bytes.
+.Sp
+The format of the external representation is specified by \fIfmt\fR and the
+minimum expected length in \fIdata_len\fR depends on it. Valid values for
+\&amp;\fIfmt\fR are \fB\s-1UUID_FMT_BIN\s0\fR, \fB\s-1UUID_FMT_STR\s0\fR and \fB\s-1UUID_FMT_SIV\s0\fR.
+.IP &quot;uuid_rc_t \fBuuid_export\fR(const uuid_t *\fIuuid\fR, uuid_fmt_t \fIfmt\fR, void *\fIdata_ptr\fR, size_t *\fIdata_len\fR);&quot; 4
+.IX Item &quot;uuid_rc_t uuid_export(const uuid_t *uuid, uuid_fmt_t fmt, void *data_ptr, size_t *data_len);&quot;
+Exports a \s-1UUID\s0 \fIuuid\fR into an external representation of format
+\&amp;\fIfmt\fR. Valid values for \fIfmt\fR are \fB\s-1UUID_FMT_BIN\s0\fR, \fB\s-1UUID_FMT_STR\s0\fR,
+\&amp;\fB\s-1UUID_FMT_SIV\s0\fR and \fB\s-1UUID_FMT_TXT\s0\fR.
+.Sp
+The data is written to the buffer whose location is obtained
+by dereferencing \fIdata_ptr\fR after a \*(L&quot;cast\*(R&quot; to the appropriate
+pointer-to-pointer type. Hence the generic pointer argument \fIdata_ptr\fR
+is expected to be a pointer to a \*(L&quot;pointer of a particular type\*(R&quot;, i.e.,
+it has to be of type &quot;\f(CW\*(C`unsigned char **\*(C'\fR&quot; for \fB\s-1UUID_FMT_BIN\s0\fR and
+&quot;\f(CW\*(C`char **\*(C'\fR&quot; for \fB\s-1UUID_FMT_STR\s0\fR, \fB\s-1UUID_FMT_SIV\s0\fR and \fB\s-1UUID_FMT_TXT\s0\fR.
+.Sp
+The buffer has to be room for at least \f(CW\*(C`*\*(C'\fR\fIdata_len\fR bytes. If the
+value of the pointer after \*(L&quot;casting\*(R&quot; and dereferencing \fIdata_ptr\fR
+is \f(CW\*(C`NULL\*(C'\fR, \fIdata_len\fR is ignored as input and a new buffer is
+allocated and returned in the pointer after \*(L&quot;casting\*(R&quot; and dereferencing
+\&amp;\fIdata_ptr\fR (the caller has to \fIfree\fR\|(3) it later on).
+.Sp
+If \fIdata_len\fR is not \f(CW\*(C`NULL\*(C'\fR, the number of available bytes in the
+buffer has to be provided in \f(CW\*(C`*\*(C'\fR\fIdata_len\fR and the number of actually
+written bytes are returned in \f(CW\*(C`*\*(C'\fR\fIdata_len\fR again. The minimum
+required buffer length depends on the external representation as
+specified by \fIfmt\fR and is at least \fB\s-1UUID_LEN_BIN\s0\fR for \fB\s-1UUID_FMT_BIN\s0\fR,
+\&amp;\fB\s-1UUID_LEN_STR\s0\fR for \fB\s-1UUID_FMT_STR\s0\fR and \fB\s-1UUID_LEN_SIV\s0\fR for
+\&amp;\fB\s-1UUID_FMT_SIV\s0\fR. For \fB\s-1UUID_FMT_TXT\s0\fR a buffer of unspecified length is
+required and hence it is recommended to allow \fB\s-1OSSP\s0 uuid\fR to allocate
+the buffer as necessary.
+.IP &quot;uuid_rc_t \fBuuid_load\fR(uuid_t *\fIuuid\fR, const char *\fIname\fR);&quot; 4
+.IX Item &quot;uuid_rc_t uuid_load(uuid_t *uuid, const char *name);&quot;
+Loads a pre-defined \s-1UUID\s0 value into the \s-1UUID\s0 object \fIuuid\fR. The
+following \fIname\fR arguments are currently known:
+.RS 4
+.IP &quot;\fIname\fR      \fI\s-1UUID\s0\fR&quot; 4
+.IX Item &quot;name      UUID&quot;
+.PD 0
+.IP &quot;nil       00000000\-0000\-0000\-0000\-000000000000&quot; 4
+.IX Item &quot;nil       00000000-0000-0000-0000-000000000000&quot;
+.IP &quot;ns:DNS    6ba7b810\-9dad\-11d1\-80b4\-00c04fd430c8&quot; 4
+.IX Item &quot;ns:DNS    6ba7b810-9dad-11d1-80b4-00c04fd430c8&quot;
+.IP &quot;ns:URL    6ba7b811\-9dad\-11d1\-80b4\-00c04fd430c8&quot; 4
+.IX Item &quot;ns:URL    6ba7b811-9dad-11d1-80b4-00c04fd430c8&quot;
+.IP &quot;ns:OID    6ba7b812\-9dad\-11d1\-80b4\-00c04fd430c8&quot; 4
+.IX Item &quot;ns:OID    6ba7b812-9dad-11d1-80b4-00c04fd430c8&quot;
+.IP &quot;ns:X500   6ba7b814\-9dad\-11d1\-80b4\-00c04fd430c8&quot; 4
+.IX Item &quot;ns:X500   6ba7b814-9dad-11d1-80b4-00c04fd430c8&quot;
+.RE
+.RS 4
+.PD
+.Sp
+The &quot;\f(CW\*(C`ns:\*(C'\fR\fI\s-1XXX\s0\fR&quot; are names of pre-defined name-space UUIDs for use in
+the generation of \s-1DCE\s0 1.1 version 3 and version 5 UUIDs.
+.RE
+.IP &quot;uuid_rc_t \fBuuid_make\fR(uuid_t *\fIuuid\fR, unsigned int \fImode\fR, ...);&quot; 4
+.IX Item &quot;uuid_rc_t uuid_make(uuid_t *uuid, unsigned int mode, ...);&quot;
+Generates a new \s-1UUID\s0 in \fIuuid\fR according to \fImode\fR and optional
+arguments (dependent on \fImode\fR).
+.Sp
+If \fImode\fR contains the \f(CW\*(C`UUID_MAKE_V1\*(C'\fR bit, a \s-1DCE\s0 1.1 variant \s-1UUID\s0 of
+version 1 is generated. Then optionally the bit \f(CW\*(C`UUID_MAKE_MC\*(C'\fR forces
+the use of random multi-cast \s-1MAC\s0 address instead of the real physical
+\&amp;\s-1MAC\s0 address (the default). The \s-1UUID\s0 is generated out of the 60\-bit current
+system time, a 12\-bit clock sequence and the 48\-bit \s-1MAC\s0 address.
+.Sp
+If \fImode\fR contains the \f(CW\*(C`UUID_MAKE_V3\*(C'\fR or \f(CW\*(C`UUID_MAKE_V5\*(C'\fR bit, a \s-1DCE\s0
+1.1 variant \s-1UUID\s0 of version 3 or 5 is generated and two additional
+arguments are expected: first, a namespace \s-1UUID\s0 object (\f(CW\*(C`uuid_t *\*(C'\fR).
+Second, a name string of arbitrary length (\f(CW\*(C`const char *\*(C'\fR). The \s-1UUID\s0 is
+generated out of the 128\-bit \s-1MD5\s0 or 160\-bit \s-1SHA\-1\s0 from the concatenated
+octet stream of namespace \s-1UUID\s0 and name string.
+.Sp
+If \fImode\fR contains the \f(CW\*(C`UUID_MAKE_V4\*(C'\fR bit, a \s-1DCE\s0 1.1 variant \s-1UUID\s0
+of version 4 is generated. The \s-1UUID\s0 is generated out of 128\-bit random
+data.
+.IP &quot;char *\fBuuid_error\fR(uuid_rc_t \fIrc\fR);&quot; 4
+.IX Item &quot;char *uuid_error(uuid_rc_t rc);&quot;
+Returns a constant string representation corresponding to the
+return-code \fIrc\fR for use in displaying \fB\s-1OSSP\s0 uuid\fR errors.
+.IP &quot;unsigned long \fBuuid_version\fR(void);&quot; 4
+.IX Item &quot;unsigned long uuid_version(void);&quot;
+Returns the hexadecimal encoded \fB\s-1OSSP\s0 uuid\fR version as compiled into
+the library object files. This allows run-time checking of the \fB\s-1OSSP\s0
+uuid\fR version. For compile-time checking use \f(CW\*(C`UUID_VERSION\*(C'\fR instead.
+.SH &quot;EXAMPLE&quot;
+.IX Header &quot;EXAMPLE&quot;
+The following shows an example usage of the \s-1API\s0. Error handling is
+omitted for code simplification and has to be re-added for production
+code.
+.PP
+.Vb 5
+\&amp; /* generate a DCE 1.1 v1 UUID from system environment */
+\&amp; char *uuid_v1(void)
+\&amp; {
+\&amp;     uuid_t *uuid;
+\&amp;     char *str;
+\&amp;
+\&amp;     uuid_create(&amp;uuid);
+\&amp;     uuid_make(uuid, UUID_MAKE_V1);
+\&amp;     str = NULL;
+\&amp;     uuid_export(uuid, UUID_FMT_STR, &amp;str, NULL);
+\&amp;     uuid_destroy(uuid);
+\&amp;     return str;
+\&amp; }
+\&amp;
+\&amp; /* generate a DCE 1.1 v3 UUID from an URL */
+\&amp; char *uuid_v3(const char *url)
+\&amp; {
+\&amp;     uuid_t *uuid;
+\&amp;     uuid_t *uuid_ns;
+\&amp;     char *str;
+\&amp;
+\&amp;     uuid_create(&amp;uuid);
+\&amp;     uuid_create(&amp;uuid_ns);
+\&amp;     uuid_load(uuid_ns, &quot;ns:URL&quot;);
+\&amp;     uuid_make(uuid, UUID_MAKE_V3, uuid_ns, url);
+\&amp;     str = NULL;
+\&amp;     uuid_export(uuid, UUID_FMT_STR, &amp;str, NULL);
+\&amp;     uuid_destroy(uuid_ns);
+\&amp;     uuid_destroy(uuid);
+\&amp;     return str;
+\&amp; }
+.Ve
+.SH &quot;SEE ALSO&quot;
+.IX Header &quot;SEE ALSO&quot;
+The following are references to \fB\s-1UUID\s0\fR documentation and specifications:
+.IP &quot;\(bu&quot; 4
+\&amp;\fBA Universally Unique IDentifier (\s-1UUID\s0) \s-1URN\s0 Namespace\fR,
+P. Leach, M. Mealling, R. Salz,
+\&amp;\s-1IETF\s0 \s-1RFC\-4122\s0,
+July 2005, 32 pages,
+http://www.ietf.org/rfc/rfc4122.txt
+.IP &quot;\(bu&quot; 4
+Information Technology \*(-- Open Systems Interconnection (\s-1OSI\s0),
+\&amp;\fBProcedures for the operation of \s-1OSI\s0 Registration Authorities:
+Generation and Registration of Universally Unique Identifiers (UUIDs)
+and their Use as \s-1ASN\s0.1 Object Identifier Components\fR,
+\&amp;\s-1ISO/IEC\s0 9834\-8:2004 / ITU-T Rec. X.667, 2004,
+December 2004, 25 pages,
+http://www.itu.int/ITU\-T/studygroups/com17/oid/X.667\-E.pdf
+.IP &quot;\(bu&quot; 4
+\&amp;\fB\s-1DCE\s0 1.1: Remote Procedure Call\fR,
+appendix \fBUniversally Unique Identifier\fR,
+Open Group Technical Standard
+Document Number C706, August 1997, 737 pages,
+(supersedes C309 \s-1DCE:\s0 Remote Procedure Call 8/1994,
+which was basis for \s-1ISO/IEC\s0 11578:1996 specification),
+http://www.opengroup.org/publications/catalog/c706.htm
+.IP &quot;\(bu&quot; 4
+Information technology \*(-- Open Systems Interconnection (\s-1OSI\s0),
+\&amp;\fBRemote Procedure Call (\s-1RPC\s0)\fR,
+\&amp;\s-1ISO/IEC\s0 11578:1996,
+August 2001, 570 pages, (\s-1CHF\s0 340,00),
+http://www.iso.ch/cate/d2229.html
+.IP &quot;\(bu&quot; 4
+\&amp;\fB\s-1HTTP\s0 Extensions for Distributed Authoring (WebDAV)\fR,
+section \fB6.4.1 Node Field Generation Without the \s-1IEEE\s0 802 Address\fR,
+\&amp;\s-1IETF\s0 \s-1RFC\-2518\s0,
+February 1999, 94 pages,
+http://www.ietf.org/rfc/rfc2518.txt
+.IP &quot;\(bu&quot; 4
+\&amp;\fB\s-1DCE\s0 1.1 compliant \s-1UUID\s0 functions\fR,
+FreeBSD manual pages \fIuuid\fR\|(3) and \fIuuidgen\fR\|(2),
+http://www.freebsd.org/cgi/man.cgi?query=uuid&amp;manpath=FreeBSD+6.0\-RELEASE
+.SH &quot;HISTORY&quot;
+.IX Header &quot;HISTORY&quot;
+\&amp;\fB\s-1OSSP\s0 uuid\fR was implemented in January 2004 by Ralf S. Engelschall
+&lt;rse@engelschall.com&gt;. It was prompted by the use of UUIDs
+in the \fB\s-1OSSP\s0 as\fR and \fBOpenPKG\fR projects. It is a clean room
+implementation intended to be strictly standards compliant and maximum
+portable.
+.SH &quot;SEE ALSO&quot;
+.IX Header &quot;SEE ALSO&quot;
+\&amp;\fIuuid\fR\|(1), \fIuuid\-config\fR\|(1), \fIOSSP::uuid\fR\|(3).
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuidac"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid.ac (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid.ac                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid.ac        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,206 @@
</span><ins>+dnl ##
+dnl ##  OSSP uuid - Universally Unique Identifier
+dnl ##  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+dnl ##  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+dnl ##
+dnl ##  This file is part of OSSP uuid, a library for the generation
+dnl ##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+dnl ##
+dnl ##  Permission to use, copy, modify, and distribute this software for
+dnl ##  any purpose with or without fee is hereby granted, provided that
+dnl ##  the above copyright notice and this permission notice appear in all
+dnl ##  copies.
+dnl ##
+dnl ##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+dnl ##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+dnl ##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+dnl ##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+dnl ##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+dnl ##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+dnl ##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+dnl ##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+dnl ##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+dnl ##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+dnl ##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+dnl ##  SUCH DAMAGE.
+dnl ##
+dnl ##  uuid.ac: UUID specific Autoconf checks
+dnl ##
+
+dnl #   Check for anything OSSP uuid wants to know
+dnl #   configure.in:
+dnl #     UUID_CHECK_ALL
+
+AC_DEFUN([UUID_CHECK_ALL],[
+    dnl #   make sure libnsl and libsocket are linked in if they exist
+    AC_CHECK_LIB(nsl, gethostname)
+    if test &quot;.`echo $LIBS | grep nsl`&quot; = .; then
+        AC_CHECK_LIB(nsl, gethostbyname)
+    fi
+    AC_CHECK_LIB(socket, accept)
+
+    dnl #  check for portable va_copy()
+    AC_CHECK_VA_COPY()
+
+    dnl #   check for system headers
+    AC_CHECK_HEADERS(sys/types.h sys/param.h sys/time.h sys/socket.h sys/sockio.h sys/ioctl.h sys/select.h)
+    AC_CHECK_HEADERS(netdb.h ifaddrs.h net/if.h net/if_dl.h net/if_arp.h netinet/in.h arpa/inet.h,,,
+[[
+#if HAVE_SYS_TYPES_H
+#include &lt;sys/types.h&gt;
+#endif
+#if HAVE_SYS_SOCKET_H
+#include &lt;sys/socket.h&gt;
+#endif
+#if HAVE_SYS_IOCTL_H
+#include &lt;sys/ioctl.h&gt;
+#endif
+]])
+
+    dnl #   check for existence of particular C structures
+    AC_MSG_CHECKING(for struct timeval)
+    AC_TRY_COMPILE([
+#ifdef HAVE_UNISTD_H
+#include &lt;unistd.h&gt;
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include &lt;sys/types.h&gt;
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include &lt;sys/time.h&gt;
+#endif
+#include &lt;time.h&gt;
+    ],[ struct timeval tv; ],
+    [ msg=&quot;yes&quot; ], [ msg=&quot;no&quot; ])
+    if test &quot;.$msg&quot; = .yes; then
+        AC_DEFINE(HAVE_STRUCT_TIMEVAL, 1, [define if exists &quot;struct timeval&quot;])
+    fi
+    AC_MSG_RESULT([$msg])
+
+    dnl #   check for functions
+    AC_CHECK_FUNCS(getifaddrs nanosleep Sleep gettimeofday clock_gettime)
+
+    dnl #   check size of built-in types
+    AC_CHECK_TYPES([long long, long double])
+    AC_CHECK_SIZEOF(char, 1)
+    AC_CHECK_SIZEOF(unsigned char, 1)
+    AC_CHECK_SIZEOF(short, 2)
+    AC_CHECK_SIZEOF(unsigned short, 2)
+    AC_CHECK_SIZEOF(int, 4)
+    AC_CHECK_SIZEOF(unsigned int, 4)
+    AC_CHECK_SIZEOF(long, 4)
+    AC_CHECK_SIZEOF(unsigned long, 4)
+    AC_CHECK_SIZEOF(long long, 8)
+    AC_CHECK_SIZEOF(unsigned long long, 8)
+
+    dnl #   configure option --with-dce
+    AC_ARG_WITH([dce],
+        AC_HELP_STRING([--with-dce], [build DCE 1.1 backward compatibility API]),
+        [ac_cv_with_dce=$withval], [ac_cv_with_dce=no])
+    AC_CACHE_CHECK([whether to build DCE 1.1 backward compatibility API], [ac_cv_with_dce], [ac_cv_with_dce=no])
+    if test &quot;.$ac_cv_with_dce&quot; = &quot;.yes&quot;; then
+        AC_DEFINE(WITH_DCE, 1, [whether to build DCE 1.1 backward compatibility API])
+        WITH_DCE='yes'
+        DCE_NAME='$(DCE_NAME)'
+    else
+        WITH_DCE='no'
+        DCE_NAME=''
+    fi
+    AC_SUBST(WITH_DCE)
+    AC_SUBST(DCE_NAME)
+
+    dnl #   configure option --with-cxx
+    AC_ARG_WITH([cxx],
+        AS_HELP_STRING([--with-cxx], [build C++ bindings to C API]),
+        [ac_cv_with_cxx=$withval], [ac_cv_with_cxx=no])
+    AC_CACHE_CHECK([whether to build C++ bindings to C API], [ac_cv_with_cxx], [ac_cv_with_cxx=no])
+    if test &quot;.$ac_cv_with_cxx&quot; = &quot;.yes&quot;; then
+        AC_DEFINE(WITH_CXX, 1, [whether to build C++ bindings to C API])
+        WITH_CXX='yes'
+        CXX_NAME='$(CXX_NAME)'
+        AC_PROG_CXX
+    else
+        WITH_CXX='no'
+        CXX_NAME=''
+    fi
+    AC_SUBST(CXX_NAME)
+    AC_SUBST(WITH_CXX)
+
+    dnl #   configure option --with-perl
+    AC_ARG_WITH([perl],
+        AS_HELP_STRING([--with-perl], [build Perl bindings to C API]),
+        [ac_cv_with_perl=$withval], [ac_cv_with_perl=no])
+    AC_CACHE_CHECK([whether to build Perl bindings to C API], [ac_cv_with_perl], [ac_cv_with_perl=no])
+    AC_ARG_WITH([perl-compat],
+        AS_HELP_STRING([--with-perl-compat], [build Perl compatibility API]),
+        [ac_cv_with_perl_compat=$withval], [ac_cv_with_perl_compat=no])
+    AC_CACHE_CHECK([whether to build Perl compatibility API], [ac_cv_with_perl_compat], [ac_cv_with_perl_compat=no])
+    if test &quot;.$ac_cv_with_perl&quot; = &quot;.yes&quot;; then
+        AC_DEFINE(WITH_PERL, 1, [whether to build Perl bindings to C API])
+        WITH_PERL='yes'
+        PERL_NAME='$(PERL_NAME)'
+    else
+        WITH_PERL='no'
+        PERL_NAME=''
+    fi
+    if test &quot;.$ac_cv_with_perl_compat&quot; = &quot;.yes&quot;; then
+        AC_DEFINE(WITH_PERL_COMPAT, 1, [whether to build Perl compatibility API])
+        WITH_PERL_COMPAT=1
+    else
+        WITH_PERL_COMPAT=0
+    fi
+    AC_SUBST(PERL_NAME)
+    AC_SUBST(WITH_PERL)
+    AC_SUBST(WITH_PERL_COMPAT)
+    AC_PATH_PROG(PERL, perl, NA)
+    if test &quot;.$ac_cv_with_perl&quot; = &quot;.yes&quot; -a &quot;.$PERL&quot; = &quot;.NA&quot;; then
+        AC_ERROR([required Perl interpreter not found in \$PATH])
+    fi
+    
+    dnl #   configure option --with-php
+    AC_ARG_WITH([php],
+        AS_HELP_STRING([--with-php], [build PHP bindings to C API]),
+        [ac_cv_with_php=$withval], [ac_cv_with_php=no])
+    AC_CACHE_CHECK([whether to build PHP bindings to C API], [ac_cv_with_php], [ac_cv_with_php=no])
+    if test &quot;.$ac_cv_with_php&quot; = &quot;.yes&quot;; then
+        AC_DEFINE(WITH_PHP, 1, [whether to build PHP bindings to C API])
+        WITH_PHP='yes'
+        PHP_NAME='$(PHP_NAME)'
+    else
+        WITH_PHP='no'
+        PHP_NAME=''
+    fi
+    AC_SUBST(PHP_NAME)
+    AC_SUBST(WITH_PHP)
+    AC_PATH_PROGS(PHP, php5 php, NA)
+    if test &quot;.$ac_cv_with_php&quot; = &quot;.yes&quot; -a &quot;.$PHP&quot; = &quot;.NA&quot;; then
+        AC_ERROR([required PHP interpreter not found in \$PATH])
+    fi
+    if test &quot;.$ac_cv_with_php&quot; = &quot;.yes&quot;; then
+        (cd php &amp;&amp; make -f Makefile.local config PHP=$PHP)
+    fi
+
+    dnl #   configure option --with-pgsql
+    AC_ARG_WITH([pgsql],
+        AS_HELP_STRING([--with-pgsql], [build PostgreSQL bindings to C API]),
+        [ac_cv_with_pgsql=$withval], [ac_cv_with_pgsql=no])
+    AC_CACHE_CHECK([whether to build PostgreSQL bindings to C API], [ac_cv_with_pgsql], [ac_cv_with_pgsql=no])
+    if test &quot;.$ac_cv_with_pgsql&quot; = &quot;.yes&quot;; then
+        AC_DEFINE(WITH_PGSQL, 1, [whether to build PostgreSQL bindings to C API])
+        WITH_PGSQL='yes'
+        PGSQL_NAME='$(PGSQL_NAME)'
+    else
+        WITH_PGSQL='no'
+        PGSQL_NAME=''
+    fi
+    AC_SUBST(PGSQL_NAME)
+    AC_SUBST(WITH_PGSQL)
+    AC_PATH_PROGS(PG_CONFIG, pg_config, NA)
+    if test &quot;.$ac_cv_with_pgsql&quot; = &quot;.yes&quot; -a &quot;.$PG_CONFIG&quot; = &quot;.NA&quot;; then
+        AC_ERROR([required PostgreSQL pg_config utility not found in \$PATH])
+    fi
+    if test &quot;.$ac_cv_with_pgsql&quot; = &quot;.yes&quot; -a &quot;.`${MAKE-make} -v 2&gt;/dev/null | grep GNU`&quot; = .; then
+        AC_ERROR([PostgreSQL bindings require GNU make to build])
+    fi
+])
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuidc"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid.c (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid.c                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid.c        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,1217 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid.c: library API implementation
+*/
+
+/* own headers (part 1/2) */
+#include &quot;uuid.h&quot;
+#include &quot;uuid_ac.h&quot;
+
+/* system headers */
+#include &lt;stdio.h&gt;
+#include &lt;stdlib.h&gt;
+#include &lt;stdarg.h&gt;
+#include &lt;string.h&gt;
+#include &lt;unistd.h&gt;
+#include &lt;ctype.h&gt;
+#include &lt;fcntl.h&gt;
+#include &lt;time.h&gt;
+#include &lt;sys/time.h&gt;
+#include &lt;sys/types.h&gt;
+
+/* own headers (part 2/2) */
+#include &quot;uuid_vers.h&quot;
+#include &quot;uuid_md5.h&quot;
+#include &quot;uuid_sha1.h&quot;
+#include &quot;uuid_prng.h&quot;
+#include &quot;uuid_mac.h&quot;
+#include &quot;uuid_time.h&quot;
+#include &quot;uuid_ui64.h&quot;
+#include &quot;uuid_ui128.h&quot;
+#include &quot;uuid_str.h&quot;
+#include &quot;uuid_bm.h&quot;
+#include &quot;uuid_ac.h&quot;
+
+/* maximum number of 100ns ticks of the actual resolution of system clock
+   (which in our case is 1us (= 1000ns) because we use gettimeofday(2) */
+#define UUIDS_PER_TICK 10
+
+/* time offset between UUID and Unix Epoch time according to standards.
+   (UUID UTC base time is October 15, 1582
+    Unix UTC base time is January  1, 1970) */
+#define UUID_TIMEOFFSET &quot;01B21DD213814000&quot;
+
+/* IEEE 802 MAC address encoding/decoding bit fields */
+#define IEEE_MAC_MCBIT BM_OCTET(0,0,0,0,0,0,0,1)
+#define IEEE_MAC_LOBIT BM_OCTET(0,0,0,0,0,0,1,0)
+
+/* IEEE 802 MAC address octet length */
+#define IEEE_MAC_OCTETS 6
+
+/* UUID binary representation according to UUID standards */
+typedef struct {
+    uuid_uint32_t  time_low;                  /* bits  0-31 of time field */
+    uuid_uint16_t  time_mid;                  /* bits 32-47 of time field */
+    uuid_uint16_t  time_hi_and_version;       /* bits 48-59 of time field plus 4 bit version */
+    uuid_uint8_t   clock_seq_hi_and_reserved; /* bits  8-13 of clock sequence field plus 2 bit variant */
+    uuid_uint8_t   clock_seq_low;             /* bits  0-7  of clock sequence field */
+    uuid_uint8_t   node[IEEE_MAC_OCTETS];     /* bits  0-47 of node MAC address */
+} uuid_obj_t;
+
+/* abstract data type (ADT) of API */
+struct uuid_st {
+    uuid_obj_t     obj;                       /* inlined UUID object */
+    prng_t        *prng;                      /* RPNG sub-object */
+    md5_t         *md5;                       /* MD5 sub-object */
+    sha1_t        *sha1;                      /* SHA-1 sub-object */
+    uuid_uint8_t   mac[IEEE_MAC_OCTETS];      /* pre-determined MAC address */
+    struct timeval time_last;                 /* last retrieved timestamp */
+    unsigned long  time_seq;                  /* last timestamp sequence counter */
+};
+
+/* create UUID object */
+uuid_rc_t uuid_create(uuid_t **uuid)
+{
+    uuid_t *obj;
+
+    /* argument sanity check */
+    if (uuid == NULL)
+        return UUID_RC_ARG;
+
+    /* allocate UUID object */
+    if ((obj = (uuid_t *)malloc(sizeof(uuid_t))) == NULL)
+        return UUID_RC_MEM;
+
+    /* create PRNG, MD5 and SHA1 sub-objects */
+    if (prng_create(&amp;obj-&gt;prng) != PRNG_RC_OK) {
+        free(obj);
+        return UUID_RC_INT;
+    }
+    if (md5_create(&amp;obj-&gt;md5) != MD5_RC_OK) {
+        (void)prng_destroy(obj-&gt;prng);
+        free(obj);
+        return UUID_RC_INT;
+    }
+    if (sha1_create(&amp;obj-&gt;sha1) != SHA1_RC_OK) {
+        (void)md5_destroy(obj-&gt;md5);
+        (void)prng_destroy(obj-&gt;prng);
+        free(obj);
+        return UUID_RC_INT;
+    }
+
+    /* set UUID object initially to &quot;Nil UUID&quot; */
+    if (uuid_load(obj, &quot;nil&quot;) != UUID_RC_OK) {
+        (void)sha1_destroy(obj-&gt;sha1);
+        (void)md5_destroy(obj-&gt;md5);
+        (void)prng_destroy(obj-&gt;prng);
+        free(obj);
+        return UUID_RC_INT;
+    }
+
+    /* resolve MAC address for insertion into node field of UUIDs */
+    if (!mac_address((unsigned char *)(obj-&gt;mac), sizeof(obj-&gt;mac))) {
+        memset(obj-&gt;mac, 0, sizeof(obj-&gt;mac));
+        obj-&gt;mac[0] = BM_OCTET(1,0,0,0,0,0,0,0);
+    }
+
+    /* initialize time attributes */
+    obj-&gt;time_last.tv_sec  = 0;
+    obj-&gt;time_last.tv_usec = 0;
+    obj-&gt;time_seq = 0;
+
+    /* store result object */
+    *uuid = obj;
+
+    return UUID_RC_OK;
+}
+
+/* destroy UUID object */
+uuid_rc_t uuid_destroy(uuid_t *uuid)
+{
+    /* argument sanity check */
+    if (uuid == NULL)
+        return UUID_RC_ARG;
+
+    /* destroy PRNG, MD5 and SHA-1 sub-objects */
+    (void)prng_destroy(uuid-&gt;prng);
+    (void)md5_destroy(uuid-&gt;md5);
+    (void)sha1_destroy(uuid-&gt;sha1);
+
+    /* free UUID object */
+    free(uuid);
+
+    return UUID_RC_OK;
+}
+
+/* clone UUID object */
+uuid_rc_t uuid_clone(const uuid_t *uuid, uuid_t **clone)
+{
+    uuid_t *obj;
+
+    /* argument sanity check */
+    if (uuid == NULL || uuid_clone == NULL)
+        return UUID_RC_ARG;
+
+    /* allocate UUID object */
+    if ((obj = (uuid_t *)malloc(sizeof(uuid_t))) == NULL)
+        return UUID_RC_MEM;
+
+    /* clone entire internal state */
+    memcpy(obj, uuid, sizeof(uuid_t));
+
+    /* re-initialize with new PRNG, MD5 and SHA1 sub-objects */
+    if (prng_create(&amp;obj-&gt;prng) != PRNG_RC_OK) {
+        free(obj);
+        return UUID_RC_INT;
+    }
+    if (md5_create(&amp;obj-&gt;md5) != MD5_RC_OK) {
+        (void)prng_destroy(obj-&gt;prng);
+        free(obj);
+        return UUID_RC_INT;
+    }
+    if (sha1_create(&amp;obj-&gt;sha1) != SHA1_RC_OK) {
+        (void)md5_destroy(obj-&gt;md5);
+        (void)prng_destroy(obj-&gt;prng);
+        free(obj);
+        return UUID_RC_INT;
+    }
+
+    /* store result object */
+    *clone = obj;
+
+    return UUID_RC_OK;
+}
+
+/* check whether UUID object represents &quot;Nil UUID&quot; */
+uuid_rc_t uuid_isnil(const uuid_t *uuid, int *result)
+{
+    const unsigned char *ucp;
+    int i;
+
+    /* sanity check argument(s) */
+    if (uuid == NULL || result == NULL)
+        return UUID_RC_ARG;
+
+    /* a &quot;Nil UUID&quot; is defined as all octets zero, so check for this case */
+    *result = UUID_TRUE;
+    for (i = 0, ucp = (unsigned char *)&amp;(uuid-&gt;obj); i &lt; UUID_LEN_BIN; i++) {
+        if (*ucp++ != (unsigned char)'\0') {
+            *result = UUID_FALSE;
+            break;
+        }
+    }
+
+    return UUID_RC_OK;
+}
+
+/* compare UUID objects */
+uuid_rc_t uuid_compare(const uuid_t *uuid1, const uuid_t *uuid2, int *result)
+{
+    int r;
+
+    /* argument sanity check */
+    if (result == NULL)
+        return UUID_RC_ARG;
+
+    /* convenience macro for setting result */
+#define RESULT(r) \
+    /*lint -save -e801 -e717*/ \
+    do { \
+        *result = (r); \
+        goto result_exit; \
+    } while (0) \
+    /*lint -restore*/
+
+    /* special cases: NULL or equal UUIDs */
+    if (uuid1 == uuid2)
+        RESULT(0);
+    if (uuid1 == NULL &amp;&amp; uuid2 == NULL)
+        RESULT(0);
+    if (uuid1 == NULL)
+        RESULT((uuid_isnil(uuid2, &amp;r) == UUID_RC_OK ? r : 0) ? 0 : -1);
+    if (uuid2 == NULL)
+        RESULT((uuid_isnil(uuid1, &amp;r) == UUID_RC_OK ? r : 0) ? 0 : 1);
+
+    /* standard cases: regular different UUIDs */
+    if (uuid1-&gt;obj.time_low != uuid2-&gt;obj.time_low)
+        RESULT((uuid1-&gt;obj.time_low &lt; uuid2-&gt;obj.time_low) ? -1 : 1);
+    if ((r = (int)uuid1-&gt;obj.time_mid
+           - (int)uuid2-&gt;obj.time_mid) != 0)
+        RESULT((r &lt; 0) ? -1 : 1);
+    if ((r = (int)uuid1-&gt;obj.time_hi_and_version
+           - (int)uuid2-&gt;obj.time_hi_and_version) != 0)
+        RESULT((r &lt; 0) ? -1 : 1);
+    if ((r = (int)uuid1-&gt;obj.clock_seq_hi_and_reserved
+           - (int)uuid2-&gt;obj.clock_seq_hi_and_reserved) != 0)
+        RESULT((r &lt; 0) ? -1 : 1);
+    if ((r = (int)uuid1-&gt;obj.clock_seq_low
+           - (int)uuid2-&gt;obj.clock_seq_low) != 0)
+        RESULT((r &lt; 0) ? -1 : 1);
+    if ((r = memcmp(uuid1-&gt;obj.node, uuid2-&gt;obj.node, sizeof(uuid1-&gt;obj.node))) != 0)
+        RESULT((r &lt; 0) ? -1 : 1);
+
+    /* default case: the keys are equal */
+    *result = 0;
+
+    result_exit:
+    return UUID_RC_OK;
+}
+
+/* INTERNAL: unpack UUID binary presentation into UUID object
+   (allows in-place operation for internal efficiency!) */
+static uuid_rc_t uuid_import_bin(uuid_t *uuid, const void *data_ptr, size_t data_len)
+{
+    const uuid_uint8_t *in;
+    uuid_uint32_t tmp32;
+    uuid_uint16_t tmp16;
+    unsigned int i;
+
+    /* sanity check argument(s) */
+    if (uuid == NULL || data_ptr == NULL || data_len &lt; UUID_LEN_BIN)
+        return UUID_RC_ARG;
+
+    /* treat input data buffer as octet stream */
+    in = (const uuid_uint8_t *)data_ptr;
+
+    /* unpack &quot;time_low&quot; field */
+    tmp32 = (uuid_uint32_t)(*in++);
+    tmp32 = (tmp32 &lt;&lt; 8) | (uuid_uint32_t)(*in++);
+    tmp32 = (tmp32 &lt;&lt; 8) | (uuid_uint32_t)(*in++);
+    tmp32 = (tmp32 &lt;&lt; 8) | (uuid_uint32_t)(*in++);
+    uuid-&gt;obj.time_low = tmp32;
+
+    /* unpack &quot;time_mid&quot; field */
+    tmp16 = (uuid_uint16_t)(*in++);
+    tmp16 = (uuid_uint16_t)(tmp16 &lt;&lt; 8) | (uuid_uint16_t)(*in++);
+    uuid-&gt;obj.time_mid = tmp16;
+
+    /* unpack &quot;time_hi_and_version&quot; field */
+    tmp16 = (uuid_uint16_t)*in++;
+    tmp16 = (uuid_uint16_t)(tmp16 &lt;&lt; 8) | (uuid_uint16_t)(*in++);
+    uuid-&gt;obj.time_hi_and_version = tmp16;
+
+    /* unpack &quot;clock_seq_hi_and_reserved&quot; field */
+    uuid-&gt;obj.clock_seq_hi_and_reserved = *in++;
+
+    /* unpack &quot;clock_seq_low&quot; field */
+    uuid-&gt;obj.clock_seq_low = *in++;
+
+    /* unpack &quot;node&quot; field */
+    for (i = 0; i &lt; (unsigned int)sizeof(uuid-&gt;obj.node); i++)
+        uuid-&gt;obj.node[i] = *in++;
+
+    return UUID_RC_OK;
+}
+
+/* INTERNAL: pack UUID object into binary representation
+   (allows in-place operation for internal efficiency!) */
+static uuid_rc_t uuid_export_bin(const uuid_t *uuid, void *_data_ptr, size_t *data_len)
+{
+    uuid_uint8_t **data_ptr;
+    uuid_uint8_t *out;
+    uuid_uint32_t tmp32;
+    uuid_uint16_t tmp16;
+    unsigned int i;
+
+    /* cast generic data pointer to particular pointer to pointer type */
+    data_ptr = (uuid_uint8_t **)_data_ptr;
+
+    /* sanity check argument(s) */
+    if (uuid == NULL || data_ptr == NULL)
+        return UUID_RC_ARG;
+
+    /* optionally allocate octet data buffer */
+    if (*data_ptr == NULL) {
+        if ((*data_ptr = (uuid_uint8_t *)malloc(sizeof(uuid_t))) == NULL)
+            return UUID_RC_MEM;
+        if (data_len != NULL)
+            *data_len = UUID_LEN_BIN;
+    }
+    else {
+        if (data_len == NULL)
+            return UUID_RC_ARG;
+        if (*data_len &lt; UUID_LEN_BIN)
+            return UUID_RC_MEM;
+        *data_len = UUID_LEN_BIN;
+    }
+
+    /* treat output data buffer as octet stream */
+    out = *data_ptr;
+
+    /* pack &quot;time_low&quot; field */
+    tmp32 = uuid-&gt;obj.time_low;
+    out[3] = (uuid_uint8_t)(tmp32 &amp; 0xff); tmp32 &gt;&gt;= 8;
+    out[2] = (uuid_uint8_t)(tmp32 &amp; 0xff); tmp32 &gt;&gt;= 8;
+    out[1] = (uuid_uint8_t)(tmp32 &amp; 0xff); tmp32 &gt;&gt;= 8;
+    out[0] = (uuid_uint8_t)(tmp32 &amp; 0xff);
+
+    /* pack &quot;time_mid&quot; field */
+    tmp16 = uuid-&gt;obj.time_mid;
+    out[5] = (uuid_uint8_t)(tmp16 &amp; 0xff); tmp16 &gt;&gt;= 8;
+    out[4] = (uuid_uint8_t)(tmp16 &amp; 0xff);
+
+    /* pack &quot;time_hi_and_version&quot; field */
+    tmp16 = uuid-&gt;obj.time_hi_and_version;
+    out[7] = (uuid_uint8_t)(tmp16 &amp; 0xff); tmp16 &gt;&gt;= 8;
+    out[6] = (uuid_uint8_t)(tmp16 &amp; 0xff);
+
+    /* pack &quot;clock_seq_hi_and_reserved&quot; field */
+    out[8] = uuid-&gt;obj.clock_seq_hi_and_reserved;
+
+    /* pack &quot;clock_seq_low&quot; field */
+    out[9] = uuid-&gt;obj.clock_seq_low;
+
+    /* pack &quot;node&quot; field */
+    for (i = 0; i &lt; (unsigned int)sizeof(uuid-&gt;obj.node); i++)
+        out[10+i] = uuid-&gt;obj.node[i];
+
+    return UUID_RC_OK;
+}
+
+/* INTERNAL: check for valid UUID string representation syntax */
+static int uuid_isstr(const char *str, size_t str_len)
+{
+    int i;
+    const char *cp;
+
+    /* example reference:
+       f81d4fae-7dec-11d0-a765-00a0c91e6bf6
+       012345678901234567890123456789012345
+       0         1         2         3       */
+    if (str == NULL)
+        return UUID_FALSE;
+    if (str_len == 0)
+        str_len = strlen(str);
+    if (str_len &lt; UUID_LEN_STR)
+        return UUID_FALSE;
+    for (i = 0, cp = str; i &lt; UUID_LEN_STR; i++, cp++) {
+        if ((i == 8) || (i == 13) || (i == 18) || (i == 23)) {
+            if (*cp == '-')
+                continue;
+            else
+                return UUID_FALSE;
+        }
+        if (!isxdigit((int)(*cp)))
+            return UUID_FALSE;
+    }
+    return UUID_TRUE;
+}
+
+/* INTERNAL: import UUID object from string representation */
+static uuid_rc_t uuid_import_str(uuid_t *uuid, const void *data_ptr, size_t data_len)
+{
+    uuid_uint16_t tmp16;
+    const char *cp;
+    char hexbuf[3];
+    const char *str;
+    unsigned int i;
+
+    /* sanity check argument(s) */
+    if (uuid == NULL || data_ptr == NULL || data_len &lt; UUID_LEN_STR)
+        return UUID_RC_ARG;
+
+    /* check for correct UUID string representation syntax */
+    str = (const char *)data_ptr;
+    if (!uuid_isstr(str, 0))
+        return UUID_RC_ARG;
+
+    /* parse hex values of &quot;time&quot; parts */
+    uuid-&gt;obj.time_low            = (uuid_uint32_t)strtoul(str,    NULL, 16);
+    uuid-&gt;obj.time_mid            = (uuid_uint16_t)strtoul(str+9,  NULL, 16);
+    uuid-&gt;obj.time_hi_and_version = (uuid_uint16_t)strtoul(str+14, NULL, 16);
+
+    /* parse hex values of &quot;clock&quot; parts */
+    tmp16 = (uuid_uint16_t)strtoul(str+19, NULL, 16);
+    uuid-&gt;obj.clock_seq_low             = (uuid_uint8_t)(tmp16 &amp; 0xff); tmp16 &gt;&gt;= 8;
+    uuid-&gt;obj.clock_seq_hi_and_reserved = (uuid_uint8_t)(tmp16 &amp; 0xff);
+
+    /* parse hex values of &quot;node&quot; part */
+    cp = str+24;
+    hexbuf[2] = '\0';
+    for (i = 0; i &lt; (unsigned int)sizeof(uuid-&gt;obj.node); i++) {
+        hexbuf[0] = *cp++;
+        hexbuf[1] = *cp++;
+        uuid-&gt;obj.node[i] = (uuid_uint8_t)strtoul(hexbuf, NULL, 16);
+    }
+
+    return UUID_RC_OK;
+}
+
+/* INTERNAL: import UUID object from single integer value representation */
+static uuid_rc_t uuid_import_siv(uuid_t *uuid, const void *data_ptr, size_t data_len)
+{
+    const char *str;
+    uuid_uint8_t tmp_bin[UUID_LEN_BIN];
+    ui128_t ui, ui2;
+    uuid_rc_t rc;
+    int i;
+
+    /* sanity check argument(s) */
+    if (uuid == NULL || data_ptr == NULL || data_len &lt; 1)
+        return UUID_RC_ARG;
+
+    /* check for correct UUID single integer value syntax */
+    str = (const char *)data_ptr;
+    for (i = 0; i &lt; (int)data_len; i++)
+        if (!isdigit((int)str[i]))
+            return UUID_RC_ARG;
+
+    /* parse single integer value representation (SIV) */
+    ui = ui128_s2i(str, NULL, 10);
+
+    /* import octets into UUID binary representation */
+    for (i = 0; i &lt; UUID_LEN_BIN; i++) {
+        ui = ui128_rol(ui, 8, &amp;ui2);
+        tmp_bin[i] = (uuid_uint8_t)(ui128_i2n(ui2) &amp; 0xff);
+    }
+
+    /* import into internal UUID representation */
+    if ((rc = uuid_import(uuid, UUID_FMT_BIN, (void *)&amp;tmp_bin, UUID_LEN_BIN)) != UUID_RC_OK)
+        return rc;
+
+    return UUID_RC_OK;
+}
+
+/* INTERNAL: export UUID object to string representation */
+static uuid_rc_t uuid_export_str(const uuid_t *uuid, void *_data_ptr, size_t *data_len)
+{
+    char **data_ptr;
+    char *data_buf;
+
+    /* cast generic data pointer to particular pointer to pointer type */
+    data_ptr = (char **)_data_ptr;
+
+    /* sanity check argument(s) */
+    if (uuid == NULL || data_ptr == NULL)
+        return UUID_RC_ARG;
+
+    /* determine output buffer */
+    if (*data_ptr == NULL) {
+        if ((data_buf = (char *)malloc(UUID_LEN_STR+1)) == NULL)
+            return UUID_RC_MEM;
+        if (data_len != NULL)
+            *data_len = UUID_LEN_STR+1;
+    }
+    else {
+        data_buf = (char *)(*data_ptr);
+        if (data_len == NULL)
+            return UUID_RC_ARG;
+        if (*data_len &lt; UUID_LEN_STR+1)
+            return UUID_RC_MEM;
+        *data_len = UUID_LEN_STR+1;
+    }
+
+    /* format UUID into string representation */
+    if (str_snprintf(data_buf, UUID_LEN_STR+1,
+        &quot;%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x&quot;,
+        (unsigned long)uuid-&gt;obj.time_low,
+        (unsigned int)uuid-&gt;obj.time_mid,
+        (unsigned int)uuid-&gt;obj.time_hi_and_version,
+        (unsigned int)uuid-&gt;obj.clock_seq_hi_and_reserved,
+        (unsigned int)uuid-&gt;obj.clock_seq_low,
+        (unsigned int)uuid-&gt;obj.node[0],
+        (unsigned int)uuid-&gt;obj.node[1],
+        (unsigned int)uuid-&gt;obj.node[2],
+        (unsigned int)uuid-&gt;obj.node[3],
+        (unsigned int)uuid-&gt;obj.node[4],
+        (unsigned int)uuid-&gt;obj.node[5]) != UUID_LEN_STR) {
+        if (*data_ptr == NULL)
+            free(data_buf);
+        return UUID_RC_INT;
+    }
+
+    /* pass back new buffer if locally allocated */
+    if (*data_ptr == NULL)
+        *data_ptr = data_buf;
+
+    return UUID_RC_OK;
+}
+
+/* INTERNAL: export UUID object to single integer value representation */
+static uuid_rc_t uuid_export_siv(const uuid_t *uuid, void *_data_ptr, size_t *data_len)
+{
+    char **data_ptr;
+    char *data_buf;
+    void *tmp_ptr;
+    size_t tmp_len;
+    uuid_uint8_t tmp_bin[UUID_LEN_BIN];
+    ui128_t ui, ui2;
+    uuid_rc_t rc;
+    int i;
+
+    /* cast generic data pointer to particular pointer to pointer type */
+    data_ptr = (char **)_data_ptr;
+
+    /* sanity check argument(s) */
+    if (uuid == NULL || data_ptr == NULL)
+        return UUID_RC_ARG;
+
+    /* determine output buffer */
+    if (*data_ptr == NULL) {
+        if ((data_buf = (char *)malloc(UUID_LEN_SIV+1)) == NULL)
+            return UUID_RC_MEM;
+        if (data_len != NULL)
+            *data_len = UUID_LEN_SIV+1;
+    }
+    else {
+        data_buf = (char *)(*data_ptr);
+        if (data_len == NULL)
+            return UUID_RC_ARG;
+        if (*data_len &lt; UUID_LEN_SIV+1)
+            return UUID_RC_MEM;
+        *data_len = UUID_LEN_SIV+1;
+    }
+
+    /* export into UUID binary representation */
+    tmp_ptr = (void *)&amp;tmp_bin;
+    tmp_len = sizeof(tmp_bin);
+    if ((rc = uuid_export(uuid, UUID_FMT_BIN, &amp;tmp_ptr, &amp;tmp_len)) != UUID_RC_OK) {
+        if (*data_ptr == NULL)
+            free(data_buf);
+        return rc;
+    }
+
+    /* import from UUID binary representation */
+    ui = ui128_zero();
+    for (i = 0; i &lt; UUID_LEN_BIN; i++) {
+        ui2 = ui128_n2i((unsigned long)tmp_bin[i]);
+        ui = ui128_rol(ui, 8, NULL);
+        ui = ui128_or(ui, ui2);
+    }
+
+    /* format into single integer value representation */
+    (void)ui128_i2s(ui, data_buf, UUID_LEN_SIV+1, 10);
+
+    /* pass back new buffer if locally allocated */
+    if (*data_ptr == NULL)
+        *data_ptr = data_buf;
+
+    return UUID_RC_OK;
+}
+
+/* decoding tables */
+static struct {
+    uuid_uint8_t num;
+    const char *desc;
+} uuid_dectab_variant[] = {
+    { (uuid_uint8_t)BM_OCTET(0,0,0,0,0,0,0,0), &quot;reserved (NCS backward compatible)&quot; },
+    { (uuid_uint8_t)BM_OCTET(1,0,0,0,0,0,0,0), &quot;DCE 1.1, ISO/IEC 11578:1996&quot; },
+    { (uuid_uint8_t)BM_OCTET(1,1,0,0,0,0,0,0), &quot;reserved (Microsoft GUID)&quot; },
+    { (uuid_uint8_t)BM_OCTET(1,1,1,0,0,0,0,0), &quot;reserved (future use)&quot; }
+};
+static struct {
+    int num;
+    const char *desc;
+} uuid_dectab_version[] = {
+    { 1, &quot;time and node based&quot; },
+    { 3, &quot;name based, MD5&quot; },
+    { 4, &quot;random data based&quot; },
+    { 5, &quot;name based, SHA-1&quot; }
+};
+
+/* INTERNAL: dump UUID object as descriptive text */
+static uuid_rc_t uuid_export_txt(const uuid_t *uuid, void *_data_ptr, size_t *data_len)
+{
+    char **data_ptr;
+    uuid_rc_t rc;
+    char **out;
+    char *out_ptr;
+    size_t out_len;
+    const char *version;
+    const char *variant;
+    char *content;
+    int isnil;
+    uuid_uint8_t tmp8;
+    uuid_uint16_t tmp16;
+    uuid_uint32_t tmp32;
+    uuid_uint8_t tmp_bin[UUID_LEN_BIN];
+    char tmp_str[UUID_LEN_STR+1];
+    char tmp_siv[UUID_LEN_SIV+1];
+    void *tmp_ptr;
+    size_t tmp_len;
+    ui64_t t;
+    ui64_t t_offset;
+    int t_nsec;
+    int t_usec;
+    time_t t_sec;
+    char t_buf[19+1]; /* YYYY-MM-DD HH:MM:SS */
+    struct tm *tm;
+    int i;
+
+    /* cast generic data pointer to particular pointer to pointer type */
+    data_ptr = (char **)_data_ptr;
+
+    /* sanity check argument(s) */
+    if (uuid == NULL || data_ptr == NULL)
+        return UUID_RC_ARG;
+
+    /* initialize output buffer */
+    out_ptr = NULL;
+    out = &amp;out_ptr;
+
+    /* check for special case of &quot;Nil UUID&quot; */
+    if ((rc = uuid_isnil(uuid, &amp;isnil)) != UUID_RC_OK)
+        return rc;
+
+    /* decode into various representations */
+    tmp_ptr = (void *)&amp;tmp_str;
+    tmp_len = sizeof(tmp_str);
+    if ((rc = uuid_export(uuid, UUID_FMT_STR, &amp;tmp_ptr, &amp;tmp_len)) != UUID_RC_OK)
+        return rc;
+    tmp_ptr = (void *)&amp;tmp_siv;
+    tmp_len = sizeof(tmp_siv);
+    if ((rc = uuid_export(uuid, UUID_FMT_SIV, &amp;tmp_ptr, &amp;tmp_len)) != UUID_RC_OK)
+        return rc;
+    (void)str_rsprintf(out, &quot;encode: STR:     %s\n&quot;, tmp_str);
+    (void)str_rsprintf(out, &quot;        SIV:     %s\n&quot;, tmp_siv);
+
+    /* decode UUID variant */
+    tmp8 = uuid-&gt;obj.clock_seq_hi_and_reserved;
+    if (isnil)
+        variant = &quot;n.a.&quot;;
+    else {
+        variant = &quot;unknown&quot;;
+        for (i = 7; i &gt;= 0; i--) {
+            if ((tmp8 &amp; (uuid_uint8_t)BM_BIT(i,1)) == 0) {
+                tmp8 &amp;= ~(uuid_uint8_t)BM_MASK(i,0);
+                break;
+            }
+        }
+        for (i = 0; i &lt; (int)(sizeof(uuid_dectab_variant)/sizeof(uuid_dectab_variant[0])); i++) {
+            if (uuid_dectab_variant[i].num == tmp8) {
+                variant = uuid_dectab_variant[i].desc;
+                break;
+            }
+        }
+    }
+    (void)str_rsprintf(out, &quot;decode: variant: %s\n&quot;, variant);
+
+    /* decode UUID version */
+    tmp16 = (BM_SHR(uuid-&gt;obj.time_hi_and_version, 12) &amp; (uuid_uint16_t)BM_MASK(3,0));
+    if (isnil)
+        version = &quot;n.a.&quot;;
+    else {
+        version = &quot;unknown&quot;;
+        for (i = 0; i &lt; (int)(sizeof(uuid_dectab_version)/sizeof(uuid_dectab_version[0])); i++) {
+            if (uuid_dectab_version[i].num == (int)tmp16) {
+                version = uuid_dectab_version[i].desc;
+                break;
+            }
+        }
+    }
+    str_rsprintf(out, &quot;        version: %d (%s)\n&quot;, (int)tmp16, version);
+
+    /*
+     * decode UUID content
+     */
+
+    if (tmp8 == BM_OCTET(1,0,0,0,0,0,0,0) &amp;&amp; tmp16 == 1) {
+        /* decode DCE 1.1 version 1 UUID */
+
+        /* decode system time */
+        t = ui64_rol(ui64_n2i((unsigned long)(uuid-&gt;obj.time_hi_and_version &amp; BM_MASK(11,0))), 48, NULL),
+        t = ui64_or(t, ui64_rol(ui64_n2i((unsigned long)(uuid-&gt;obj.time_mid)), 32, NULL));
+        t = ui64_or(t, ui64_n2i((unsigned long)(uuid-&gt;obj.time_low)));
+        t_offset = ui64_s2i(UUID_TIMEOFFSET, NULL, 16);
+        t = ui64_sub(t, t_offset, NULL);
+        t = ui64_divn(t, 10, &amp;t_nsec);
+        t = ui64_divn(t, 1000000, &amp;t_usec);
+        t_sec = (time_t)ui64_i2n(t);
+        tm = gmtime(&amp;t_sec);
+        (void)strftime(t_buf, sizeof(t_buf), &quot;%Y-%m-%d %H:%M:%S&quot;, tm);
+        (void)str_rsprintf(out, &quot;        content: time:  %s.%06d.%d UTC\n&quot;, t_buf, t_usec, t_nsec);
+
+        /* decode clock sequence */
+        tmp32 = ((uuid-&gt;obj.clock_seq_hi_and_reserved &amp; BM_MASK(5,0)) &lt;&lt; 8)
+                + uuid-&gt;obj.clock_seq_low;
+        (void)str_rsprintf(out, &quot;                 clock: %ld (usually random)\n&quot;, (long)tmp32);
+
+        /* decode node MAC address */
+        (void)str_rsprintf(out, &quot;                 node:  %02x:%02x:%02x:%02x:%02x:%02x (%s %s)\n&quot;,
+            (unsigned int)uuid-&gt;obj.node[0],
+            (unsigned int)uuid-&gt;obj.node[1],
+            (unsigned int)uuid-&gt;obj.node[2],
+            (unsigned int)uuid-&gt;obj.node[3],
+            (unsigned int)uuid-&gt;obj.node[4],
+            (unsigned int)uuid-&gt;obj.node[5],
+            (uuid-&gt;obj.node[0] &amp; IEEE_MAC_LOBIT ? &quot;local&quot; : &quot;global&quot;),
+            (uuid-&gt;obj.node[0] &amp; IEEE_MAC_MCBIT ? &quot;multicast&quot; : &quot;unicast&quot;));
+    }
+    else {
+        /* decode anything else as hexadecimal byte-string only */
+
+        /* determine annotational hint */
+        content = &quot;not decipherable: unknown UUID version&quot;;
+        if (isnil)
+            content = &quot;special case: DCE 1.1 Nil UUID&quot;;
+        else if (tmp16 == 3)
+            content = &quot;not decipherable: MD5 message digest only&quot;;
+        else if (tmp16 == 4)
+            content = &quot;no semantics: random data only&quot;;
+        else if (tmp16 == 5)
+            content = &quot;not decipherable: truncated SHA-1 message digest only&quot;;
+
+        /* pack UUID into binary representation */
+        tmp_ptr = (void *)&amp;tmp_bin;
+        tmp_len = sizeof(tmp_bin);
+        if ((rc = uuid_export(uuid, UUID_FMT_BIN, &amp;tmp_ptr, &amp;tmp_len)) != UUID_RC_OK)
+            return rc;
+
+        /* mask out version and variant parts */
+        tmp_bin[6] &amp;= BM_MASK(3,0);
+        tmp_bin[8] &amp;= BM_MASK(5,0);
+
+        /* dump as colon-seperated hexadecimal byte-string */
+        (void)str_rsprintf(out,
+            &quot;        content: %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n&quot;
+            &quot;                 (%s)\n&quot;,
+            (unsigned int)tmp_bin[0],  (unsigned int)tmp_bin[1],  (unsigned int)tmp_bin[2],
+            (unsigned int)tmp_bin[3],  (unsigned int)tmp_bin[4],  (unsigned int)tmp_bin[5],
+            (unsigned int)tmp_bin[6],  (unsigned int)tmp_bin[7],  (unsigned int)tmp_bin[8],
+            (unsigned int)tmp_bin[9],  (unsigned int)tmp_bin[10], (unsigned int)tmp_bin[11],
+            (unsigned int)tmp_bin[12], (unsigned int)tmp_bin[13], (unsigned int)tmp_bin[14],
+            (unsigned int)tmp_bin[15], content);
+    }
+
+    /* provide result */
+    out_len = strlen(out_ptr)+1;
+    if (*data_ptr == NULL) {
+        *data_ptr = (void *)out_ptr;
+        if (data_len != NULL)
+            *data_len = out_len;
+    }
+    else {
+        if (data_len == NULL)
+            return UUID_RC_ARG;
+        if (*data_len &lt; out_len)
+            return UUID_RC_MEM;
+        memcpy(*data_ptr, out_ptr, out_len);
+    }
+
+    return UUID_RC_OK;
+}
+
+/* UUID importing */
+uuid_rc_t uuid_import(uuid_t *uuid, uuid_fmt_t fmt, const void *data_ptr, size_t data_len)
+{
+    uuid_rc_t rc;
+
+    /* sanity check argument(s) */
+    if (uuid == NULL || data_ptr == NULL)
+        return UUID_RC_ARG;
+
+    /* dispatch into format-specific functions */
+    switch (fmt) {
+        case UUID_FMT_BIN: rc = uuid_import_bin(uuid, data_ptr, data_len); break;
+        case UUID_FMT_STR: rc = uuid_import_str(uuid, data_ptr, data_len); break;
+        case UUID_FMT_SIV: rc = uuid_import_siv(uuid, data_ptr, data_len); break;
+        case UUID_FMT_TXT: rc = UUID_RC_IMP; /* not implemented */ break;
+        default:           rc = UUID_RC_ARG;
+    }
+
+    return rc;
+}
+
+/* UUID exporting */
+uuid_rc_t uuid_export(const uuid_t *uuid, uuid_fmt_t fmt, void *data_ptr, size_t *data_len)
+{
+    uuid_rc_t rc;
+
+    /* sanity check argument(s) */
+    if (uuid == NULL || data_ptr == NULL)
+        return UUID_RC_ARG;
+
+    /* dispatch into format-specific functions */
+    switch (fmt) {
+        case UUID_FMT_BIN: rc = uuid_export_bin(uuid, data_ptr, data_len); break;
+        case UUID_FMT_STR: rc = uuid_export_str(uuid, data_ptr, data_len); break;
+        case UUID_FMT_SIV: rc = uuid_export_siv(uuid, data_ptr, data_len); break;
+        case UUID_FMT_TXT: rc = uuid_export_txt(uuid, data_ptr, data_len); break;
+        default:           rc = UUID_RC_ARG;
+    }
+
+    return rc;
+}
+
+/* INTERNAL: brand UUID with version and variant */
+static void uuid_brand(uuid_t *uuid, unsigned int version)
+{
+    /* set version (as given) */
+    uuid-&gt;obj.time_hi_and_version &amp;= BM_MASK(11,0);
+    uuid-&gt;obj.time_hi_and_version |= (uuid_uint16_t)BM_SHL(version, 12);
+
+    /* set variant (always DCE 1.1 only) */
+    uuid-&gt;obj.clock_seq_hi_and_reserved &amp;= BM_MASK(5,0);
+    uuid-&gt;obj.clock_seq_hi_and_reserved |= BM_SHL(0x02, 6);
+    return;
+}
+
+/* INTERNAL: generate UUID version 1: time, clock and node based */
+static uuid_rc_t uuid_make_v1(uuid_t *uuid, unsigned int mode, va_list ap)
+{
+    struct timeval time_now;
+    ui64_t t;
+    ui64_t offset;
+    ui64_t ov;
+    uuid_uint16_t clck;
+
+    /*
+     *  GENERATE TIME
+     */
+
+    /* determine current system time and sequence counter */
+    for (;;) {
+        /* determine current system time */
+        if (time_gettimeofday(&amp;time_now) == -1)
+            return UUID_RC_SYS;
+
+        /* check whether system time changed since last retrieve */
+        if (!(   time_now.tv_sec  == uuid-&gt;time_last.tv_sec
+              &amp;&amp; time_now.tv_usec == uuid-&gt;time_last.tv_usec)) {
+            /* reset time sequence counter and continue */
+            uuid-&gt;time_seq = 0;
+            break;
+        }
+
+        /* until we are out of UUIDs per tick, increment
+           the time/tick sequence counter and continue */
+        if (uuid-&gt;time_seq &lt; UUIDS_PER_TICK) {
+            uuid-&gt;time_seq++;
+            break;
+        }
+
+        /* stall the UUID generation until the system clock (which
+           has a gettimeofday(2) resolution of 1us) catches up */
+        time_usleep(1);
+    }
+
+    /* convert from timeval (sec,usec) to OSSP ui64 (100*nsec) format */
+    t = ui64_n2i((unsigned long)time_now.tv_sec);
+    t = ui64_muln(t, 1000000, NULL);
+    t = ui64_addn(t, (int)time_now.tv_usec, NULL);
+    t = ui64_muln(t, 10, NULL);
+
+    /* adjust for offset between UUID and Unix Epoch time */
+    offset = ui64_s2i(UUID_TIMEOFFSET, NULL, 16);
+    t = ui64_add(t, offset, NULL);
+
+    /* compensate for low resolution system clock by adding
+       the time/tick sequence counter */
+    if (uuid-&gt;time_seq &gt; 0)
+        t = ui64_addn(t, (int)uuid-&gt;time_seq, NULL);
+
+    /* store the 60 LSB of the time in the UUID */
+    t = ui64_rol(t, 16, &amp;ov);
+    uuid-&gt;obj.time_hi_and_version =
+        (uuid_uint16_t)(ui64_i2n(ov) &amp; 0x00000fff); /* 12 of 16 bit only! */
+    t = ui64_rol(t, 16, &amp;ov);
+    uuid-&gt;obj.time_mid =
+        (uuid_uint16_t)(ui64_i2n(ov) &amp; 0x0000ffff); /* all 16 bit */
+    t = ui64_rol(t, 32, &amp;ov);
+    uuid-&gt;obj.time_low =
+        (uuid_uint32_t)(ui64_i2n(ov) &amp; 0xffffffff); /* all 32 bit */
+
+    /*
+     *  GENERATE CLOCK
+     */
+
+    /* retrieve current clock sequence */
+    clck = ((uuid-&gt;obj.clock_seq_hi_and_reserved &amp; BM_MASK(5,0)) &lt;&lt; 8)
+           + uuid-&gt;obj.clock_seq_low;
+
+    /* generate new random clock sequence (initially or if the
+       time has stepped backwards) or else just increase it */
+    if (   clck == 0
+        || (   time_now.tv_sec &lt; uuid-&gt;time_last.tv_sec
+            || (   time_now.tv_sec == uuid-&gt;time_last.tv_sec
+                &amp;&amp; time_now.tv_usec &lt; uuid-&gt;time_last.tv_usec))) {
+        if (prng_data(uuid-&gt;prng, (void *)&amp;clck, sizeof(clck)) != PRNG_RC_OK)
+            return UUID_RC_INT;
+    }
+    else
+        clck++;
+    clck %= BM_POW2(14);
+
+    /* store back new clock sequence */
+    uuid-&gt;obj.clock_seq_hi_and_reserved =
+        (uuid-&gt;obj.clock_seq_hi_and_reserved &amp; BM_MASK(7,6))
+        | (uuid_uint8_t)((clck &gt;&gt; 8) &amp; 0xff);
+    uuid-&gt;obj.clock_seq_low =
+        (uuid_uint8_t)(clck &amp; 0xff);
+
+    /*
+     *  GENERATE NODE
+     */
+
+    if ((mode &amp; UUID_MAKE_MC) || (uuid-&gt;mac[0] &amp; BM_OCTET(1,0,0,0,0,0,0,0))) {
+        /* generate random IEEE 802 local multicast MAC address */
+        if (prng_data(uuid-&gt;prng, (void *)&amp;(uuid-&gt;obj.node), sizeof(uuid-&gt;obj.node)) != PRNG_RC_OK)
+            return UUID_RC_INT;
+        uuid-&gt;obj.node[0] |= IEEE_MAC_MCBIT;
+        uuid-&gt;obj.node[0] |= IEEE_MAC_LOBIT;
+    }
+    else {
+        /* use real regular MAC address */
+        memcpy(uuid-&gt;obj.node, uuid-&gt;mac, sizeof(uuid-&gt;mac));
+    }
+
+    /*
+     *  FINISH
+     */
+
+    /* remember current system time for next iteration */
+    uuid-&gt;time_last.tv_sec  = time_now.tv_sec;
+    uuid-&gt;time_last.tv_usec = time_now.tv_usec;
+
+    /* brand with version and variant */
+    uuid_brand(uuid, 1);
+
+    return UUID_RC_OK;
+}
+
+/* INTERNAL: pre-defined UUID values.
+   (defined as network byte ordered octet stream) */
+#define UUID_MAKE(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16) \
+    { (uuid_uint8_t)(a1),  (uuid_uint8_t)(a2),  (uuid_uint8_t)(a3),  (uuid_uint8_t)(a4),  \
+      (uuid_uint8_t)(a5),  (uuid_uint8_t)(a6),  (uuid_uint8_t)(a7),  (uuid_uint8_t)(a8),  \
+      (uuid_uint8_t)(a9),  (uuid_uint8_t)(a10), (uuid_uint8_t)(a11), (uuid_uint8_t)(a12), \
+      (uuid_uint8_t)(a13), (uuid_uint8_t)(a14), (uuid_uint8_t)(a15), (uuid_uint8_t)(a16) }
+static struct {
+    char *name;
+    uuid_uint8_t uuid[UUID_LEN_BIN];
+} uuid_value_table[] = {
+    { &quot;nil&quot;,     /* 00000000-0000-0000-0000-000000000000 (&quot;Nil UUID&quot;) */
+      UUID_MAKE(0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00) },
+    { &quot;ns:DNS&quot;,  /* 6ba7b810-9dad-11d1-80b4-00c04fd430c8 (see RFC 4122) */
+      UUID_MAKE(0x6b,0xa7,0xb8,0x10,0x9d,0xad,0x11,0xd1,0x80,0xb4,0x00,0xc0,0x4f,0xd4,0x30,0xc8) },
+    { &quot;ns:URL&quot;,  /* 6ba7b811-9dad-11d1-80b4-00c04fd430c8 (see RFC 4122) */
+      UUID_MAKE(0x6b,0xa7,0xb8,0x11,0x9d,0xad,0x11,0xd1,0x80,0xb4,0x00,0xc0,0x4f,0xd4,0x30,0xc8) },
+    { &quot;ns:OID&quot;,  /* 6ba7b812-9dad-11d1-80b4-00c04fd430c8 (see RFC 4122) */
+      UUID_MAKE(0x6b,0xa7,0xb8,0x12,0x9d,0xad,0x11,0xd1,0x80,0xb4,0x00,0xc0,0x4f,0xd4,0x30,0xc8) },
+    { &quot;ns:X500&quot;, /* 6ba7b814-9dad-11d1-80b4-00c04fd430c8 (see RFC 4122) */
+      UUID_MAKE(0x6b,0xa7,0xb8,0x14,0x9d,0xad,0x11,0xd1,0x80,0xb4,0x00,0xc0,0x4f,0xd4,0x30,0xc8) }
+};
+
+/* load UUID object with pre-defined value */
+uuid_rc_t uuid_load(uuid_t *uuid, const char *name)
+{
+    uuid_uint8_t *uuid_octets;
+    uuid_rc_t rc;
+    unsigned int i;
+
+    /* sanity check argument(s) */
+    if (uuid == NULL || name == NULL)
+        return UUID_RC_ARG;
+
+    /* search for UUID in table */
+    uuid_octets = NULL;
+    for (i = 0; i &lt; (unsigned int)sizeof(uuid_value_table)/sizeof(uuid_value_table[0]); i++) {
+         if (strcmp(uuid_value_table[i].name, name) == 0) {
+             uuid_octets = uuid_value_table[i].uuid;
+             break;
+         }
+    }
+    if (uuid_octets == NULL)
+        return UUID_RC_ARG;
+
+    /* import value into UUID object */
+    if ((rc = uuid_import(uuid, UUID_FMT_BIN, uuid_octets, UUID_LEN_BIN)) != UUID_RC_OK)
+        return rc;
+
+    return UUID_RC_OK;
+}
+
+/* INTERNAL: generate UUID version 3: name based with MD5 */
+static uuid_rc_t uuid_make_v3(uuid_t *uuid, unsigned int mode, va_list ap)
+{
+    char *str;
+    uuid_t *uuid_ns;
+    uuid_uint8_t uuid_buf[UUID_LEN_BIN];
+    void *uuid_ptr;
+    size_t uuid_len;
+    uuid_rc_t rc;
+
+    /* determine namespace UUID and name string arguments */
+    if ((uuid_ns = (uuid_t *)va_arg(ap, void *)) == NULL)
+        return UUID_RC_ARG;
+    if ((str = (char *)va_arg(ap, char *)) == NULL)
+        return UUID_RC_ARG;
+
+    /* initialize MD5 context */
+    if (md5_init(uuid-&gt;md5) != MD5_RC_OK)
+        return UUID_RC_MEM;
+
+    /* load the namespace UUID into MD5 context */
+    uuid_ptr = (void *)&amp;uuid_buf;
+    uuid_len = sizeof(uuid_buf);
+    if ((rc = uuid_export(uuid_ns, UUID_FMT_BIN, &amp;uuid_ptr, &amp;uuid_len)) != UUID_RC_OK)
+        return rc;
+    if (md5_update(uuid-&gt;md5, uuid_buf, uuid_len) != MD5_RC_OK)
+        return UUID_RC_INT;
+
+    /* load the argument name string into MD5 context */
+    if (md5_update(uuid-&gt;md5, str, strlen(str)) != MD5_RC_OK)
+        return UUID_RC_INT;
+
+    /* store MD5 result into UUID
+       (requires MD5_LEN_BIN space, UUID_LEN_BIN space is available,
+       and both are equal in size, so we are safe!) */
+    uuid_ptr = (void *)&amp;(uuid-&gt;obj);
+    if (md5_store(uuid-&gt;md5, &amp;uuid_ptr, NULL) != MD5_RC_OK)
+        return UUID_RC_INT;
+
+    /* fulfill requirement of standard and convert UUID data into
+       local/host byte order (this uses fact that uuid_import_bin() is
+       able to operate in-place!) */
+    if ((rc = uuid_import(uuid, UUID_FMT_BIN, (void *)&amp;(uuid-&gt;obj), UUID_LEN_BIN)) != UUID_RC_OK)
+        return rc;
+
+    /* brand UUID with version and variant */
+    uuid_brand(uuid, 3);
+
+    return UUID_RC_OK;
+}
+
+/* INTERNAL: generate UUID version 4: random number based */
+static uuid_rc_t uuid_make_v4(uuid_t *uuid, unsigned int mode, va_list ap)
+{
+    /* fill UUID with random data */
+    if (prng_data(uuid-&gt;prng, (void *)&amp;(uuid-&gt;obj), sizeof(uuid-&gt;obj)) != PRNG_RC_OK)
+        return UUID_RC_INT;
+
+    /* brand UUID with version and variant */
+    uuid_brand(uuid, 4);
+
+    return UUID_RC_OK;
+}
+
+/* INTERNAL: generate UUID version 5: name based with SHA-1 */
+static uuid_rc_t uuid_make_v5(uuid_t *uuid, unsigned int mode, va_list ap)
+{
+    char *str;
+    uuid_t *uuid_ns;
+    uuid_uint8_t uuid_buf[UUID_LEN_BIN];
+    void *uuid_ptr;
+    size_t uuid_len;
+    uuid_uint8_t sha1_buf[SHA1_LEN_BIN];
+    void *sha1_ptr;
+    uuid_rc_t rc;
+
+    /* determine namespace UUID and name string arguments */
+    if ((uuid_ns = (uuid_t *)va_arg(ap, void *)) == NULL)
+        return UUID_RC_ARG;
+    if ((str = (char *)va_arg(ap, char *)) == NULL)
+        return UUID_RC_ARG;
+
+    /* initialize SHA-1 context */
+    if (sha1_init(uuid-&gt;sha1) != SHA1_RC_OK)
+        return UUID_RC_INT;
+
+    /* load the namespace UUID into SHA-1 context */
+    uuid_ptr = (void *)&amp;uuid_buf;
+    uuid_len = sizeof(uuid_buf);
+    if ((rc = uuid_export(uuid_ns, UUID_FMT_BIN, &amp;uuid_ptr, &amp;uuid_len)) != UUID_RC_OK)
+        return rc;
+    if (sha1_update(uuid-&gt;sha1, uuid_buf, uuid_len) != SHA1_RC_OK)
+        return UUID_RC_INT;
+
+    /* load the argument name string into SHA-1 context */
+    if (sha1_update(uuid-&gt;sha1, str, strlen(str)) != SHA1_RC_OK)
+        return UUID_RC_INT;
+
+    /* store SHA-1 result into UUID
+       (requires SHA1_LEN_BIN space, but UUID_LEN_BIN space is available
+       only, so use a temporary buffer to store SHA-1 results and then
+       use lower part only according to standard */
+    sha1_ptr = (void *)sha1_buf;
+    if (sha1_store(uuid-&gt;sha1, &amp;sha1_ptr, NULL) != SHA1_RC_OK)
+        return UUID_RC_INT;
+    uuid_ptr = (void *)&amp;(uuid-&gt;obj);
+    memcpy(uuid_ptr, sha1_ptr, UUID_LEN_BIN);
+
+    /* fulfill requirement of standard and convert UUID data into
+       local/host byte order (this uses fact that uuid_import_bin() is
+       able to operate in-place!) */
+    if ((rc = uuid_import(uuid, UUID_FMT_BIN, (void *)&amp;(uuid-&gt;obj), UUID_LEN_BIN)) != UUID_RC_OK)
+        return rc;
+
+    /* brand UUID with version and variant */
+    uuid_brand(uuid, 5);
+
+    return UUID_RC_OK;
+}
+
+/* generate UUID */
+uuid_rc_t uuid_make(uuid_t *uuid, unsigned int mode, ...)
+{
+    va_list ap;
+    uuid_rc_t rc;
+
+    /* sanity check argument(s) */
+    if (uuid == NULL)
+        return UUID_RC_ARG;
+
+    /* dispatch into version dependent generation functions */
+    va_start(ap, mode);
+    if (mode &amp; UUID_MAKE_V1)
+        rc = uuid_make_v1(uuid, mode, ap);
+    else if (mode &amp; UUID_MAKE_V3)
+        rc = uuid_make_v3(uuid, mode, ap);
+    else if (mode &amp; UUID_MAKE_V4)
+        rc = uuid_make_v4(uuid, mode, ap);
+    else if (mode &amp; UUID_MAKE_V5)
+        rc = uuid_make_v5(uuid, mode, ap);
+    else
+        rc = UUID_RC_ARG;
+    va_end(ap);
+
+    return rc;
+}
+
+/* translate UUID API error code into corresponding error string */
+char *uuid_error(uuid_rc_t rc)
+{
+    char *str;
+
+    switch (rc) {
+        case UUID_RC_OK:  str = &quot;everything ok&quot;;    break;
+        case UUID_RC_ARG: str = &quot;invalid argument&quot;; break;
+        case UUID_RC_MEM: str = &quot;out of memory&quot;;    break;
+        case UUID_RC_SYS: str = &quot;system error&quot;;     break;
+        case UUID_RC_INT: str = &quot;internal error&quot;;   break;
+        case UUID_RC_IMP: str = &quot;not implemented&quot;;  break;
+        default:          str = NULL;               break;
+    }
+    return str;
+}
+
+/* OSSP uuid version (link-time information) */
+unsigned long uuid_version(void)
+{
+    return (unsigned long)(_UUID_VERSION);
+}
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuidhin"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid.h.in (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid.h.in                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid.h.in        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,120 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid.h: library API definition
+*/
+
+#ifndef __UUID_H__
+#define __UUID_H__
+
+/* workaround conflicts with system headers */
+#define uuid_t       __vendor_uuid_t
+#define uuid_create  __vendor_uuid_create
+#define uuid_compare __vendor_uuid_compare
+#include &lt;sys/types.h&gt;
+#include &lt;unistd.h&gt;
+#undef  uuid_t
+#undef  uuid_create
+#undef  uuid_compare
+
+/* required system headers */
+#include &lt;string.h&gt;
+
+/* minimum C++ support */
+#ifdef __cplusplus
+#define DECLARATION_BEGIN extern &quot;C&quot; {
+#define DECLARATION_END   }
+#else
+#define DECLARATION_BEGIN
+#define DECLARATION_END
+#endif
+
+DECLARATION_BEGIN
+
+/* OSSP uuid version (compile-time information) */
+#define UUID_VERSION  @UUID_VERSION_HEX@
+
+/* encoding octet stream lengths */
+#define UUID_LEN_BIN  (128 /*bit*/ / 8 /*bytes*/)
+#define UUID_LEN_STR  (128 /*bit*/ / 4 /*nibbles*/ + 4 /*hyphens*/)
+#define UUID_LEN_SIV  (39  /*int(log(10,exp(2,128)-1)+1) digits*/)
+
+/* API return codes */
+typedef enum {
+    UUID_RC_OK   = 0,        /* everything ok    */
+    UUID_RC_ARG  = 1,        /* invalid argument */
+    UUID_RC_MEM  = 2,        /* out of memory    */
+    UUID_RC_SYS  = 3,        /* system error     */
+    UUID_RC_INT  = 4,        /* internal error   */
+    UUID_RC_IMP  = 5         /* not implemented  */
+} uuid_rc_t;
+
+/* UUID make modes */
+enum {
+    UUID_MAKE_V1 = (1 &lt;&lt; 0), /* DCE 1.1 v1 UUID */
+    UUID_MAKE_V3 = (1 &lt;&lt; 1), /* DCE 1.1 v3 UUID */
+    UUID_MAKE_V4 = (1 &lt;&lt; 2), /* DCE 1.1 v4 UUID */
+    UUID_MAKE_V5 = (1 &lt;&lt; 3), /* DCE 1.1 v5 UUID */
+    UUID_MAKE_MC = (1 &lt;&lt; 4)  /* enforce multi-cast MAC address */
+};
+
+/* UUID import/export formats */
+typedef enum {
+    UUID_FMT_BIN = 0,        /* binary representation (import/export) */
+    UUID_FMT_STR = 1,        /* string representation (import/export) */
+    UUID_FMT_SIV = 2,        /* single integer value  (import/export) */
+    UUID_FMT_TXT = 3         /* textual description   (export only)   */
+} uuid_fmt_t;
+
+/* UUID abstract data type */
+struct uuid_st;
+typedef struct uuid_st uuid_t;
+
+/* UUID object handling */
+extern uuid_rc_t     uuid_create   (      uuid_t **_uuid);
+extern uuid_rc_t     uuid_destroy  (      uuid_t  *_uuid);
+extern uuid_rc_t     uuid_clone    (const uuid_t  *_uuid, uuid_t **_clone);
+
+/* UUID generation */
+extern uuid_rc_t     uuid_load     (      uuid_t  *_uuid, const char *_name);
+extern uuid_rc_t     uuid_make     (      uuid_t  *_uuid, unsigned int _mode, ...);
+
+/* UUID comparison */
+extern uuid_rc_t     uuid_isnil    (const uuid_t  *_uuid,                       int *_result);
+extern uuid_rc_t     uuid_compare  (const uuid_t  *_uuid, const uuid_t *_uuid2, int *_result);
+
+/* UUID import/export */
+extern uuid_rc_t     uuid_import   (      uuid_t  *_uuid, uuid_fmt_t _fmt, const void  *_data_ptr, size_t  _data_len);
+extern uuid_rc_t     uuid_export   (const uuid_t  *_uuid, uuid_fmt_t _fmt,       void  *_data_ptr, size_t *_data_len);
+
+/* library utilities */
+extern char         *uuid_error    (uuid_rc_t _rc);
+extern unsigned long uuid_version  (void);
+
+DECLARATION_END
+
+#endif /* __UUID_H__ */
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuidpcin"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid.pc.in (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid.pc.in                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid.pc.in        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+##
+##  OSSP uuid - Universally Unique Identifier
+##  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+##  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+##
+##  This file is part of OSSP uuid, a library for the generation
+##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+##  uuid.pc.in: pkg-config(1) specification
+##
+
+prefix=@prefix@
+exec_prefix=${prefix}
+includedir=${prefix}/include
+libdir=${exec_prefix}/lib
+
+Name: OSSP uuid
+Description: Universally Unique Identifier (UUID) Library
+Version: @UUID_VERSION_RAW@
+URL: http://www.ossp.org/pkg/lib/uuid/
+Cflags: -I${includedir}
+Libs: -L${libdir} -luuid
+Libs.private: @LIBS@
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuidpod"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid.pod (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid.pod                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid.pod        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,529 @@
</span><ins>+##
+##  OSSP uuid - Universally Unique Identifier
+##  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+##  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+##
+##  This file is part of OSSP uuid, a library for the generation
+##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+##  uuid.pod: manual page
+##
+
+=pod
+
+=head1 NAME
+
+B&lt;OSSP uuid&gt; - B&lt;Universally Unique Identifier&gt;
+
+=head1 VERSION
+
+OSSP uuid UUID_VERSION_STR
+
+=head1 DESCRIPTION
+
+B&lt;OSSP uuid&gt; is a ISO-C:1999 application programming interface (API) and
+corresponding command line interface (CLI) for the generation of DCE
+1.1, ISO/IEC 11578:1996 and IETF RFC-4122 compliant I&lt;Universally Unique
+Identifier&gt; (UUID). It supports DCE 1.1 variant UUIDs of version 1 (time
+and node based), version 3 (name based, MD5), version 4 (random number
+based) and version 5 (name based, SHA-1). Additional API bindings are
+provided for the languages ISO-C++:1998, Perl:5 and PHP:4/5. Optional
+backward compatibility exists for the ISO-C DCE-1.1 and Perl Data::UUID
+APIs.
+
+UUIDs are 128 bit numbers which are intended to have a high likelihood
+of uniqueness over space and time and are computationally difficult
+to guess. They are globally unique identifiers which can be locally
+generated without contacting a global registration authority. UUIDs
+are intended as unique identifiers for both mass tagging objects
+with an extremely short lifetime and to reliably identifying very
+persistent objects across a network.
+
+This is the ISO-C application programming interface (API) of B&lt;OSSP uuid&gt;.
+
+=head2 UUID Binary Representation
+
+According to the DCE 1.1, ISO/IEC 11578:1996 and IETF RFC-4122
+standards, a DCE 1.1 variant UUID is a 128 bit number defined out of 7
+fields, each field a multiple of an octet in size and stored in network
+byte order:
+
+                                                    [4]
+                                                   version
+                                                 --&gt;|  |&lt;--
+                                                    |  |
+                                                    |  |  [16]
+                [32]                      [16]      |  |time_hi
+              time_low                  time_mid    | _and_version
+    |&lt;----------------------------&gt;||&lt;------------&gt;||&lt;------------&gt;|
+    | MSB                          ||              ||  |           |
+    | /                            ||              ||  |           |
+    |/                             ||              ||  |           |
+
+    +------++------++------++------++------++------++------++------+~~
+    |  15  ||  14  ||  13  ||  12  ||  11  ||  10  |####9  ||   8  |
+    | MSO  ||      ||      ||      ||      ||      |####   ||      |
+    +------++------++------++------++------++------++------++------+~~
+    7654321076543210765432107654321076543210765432107654321076543210
+
+  ~~+------++------++------++------++------++------++------++------+
+    ##* 7  ||   6  ||   5  ||   4  ||   3  ||   2  ||   1  ||   0  |
+    ##*    ||      ||      ||      ||      ||      ||      ||  LSO |
+  ~~+------++------++------++------++------++------++------++------+
+    7654321076543210765432107654321076543210765432107654321076543210
+
+    | |    ||      ||                                             /|
+    | |    ||      ||                                            / |
+    | |    ||      ||                                          LSB |
+    |&lt;----&gt;||&lt;----&gt;||&lt;--------------------------------------------&gt;|
+    |clk_seq clk_seq                      node
+    |_hi_res _low                         [48]
+    |[5-6]    [8]
+    | |
+ --&gt;| |&lt;--
+  variant
+   [2-3]
+
+An example of a UUID binary representation is the octet stream C&lt;0xF8
+0x1D 0x4F 0xAE 0x7D 0xEC 0x11 0xD0 0xA7 0x65 0x00 0xA0 0xC9 0x1E 0x6B
+0xF6&gt;. The binary representation format is exactly what the B&lt;OSSP uuid&gt;
+API functions B&lt;uuid_import&gt;() and B&lt;uuid_export&gt;() deal with under
+C&lt;UUID_FMT_BIN&gt;.
+
+=head2 UUID ASCII String Representation
+
+According to the DCE 1.1, ISO/IEC 11578:1996 and IETF RFC-4122
+standards, a DCE 1.1 variant UUID is represented as an ASCII string
+consisting of 8 hexadecimal digits followed by a hyphen, then three
+groups of 4 hexadecimal digits each followed by a hyphen, then 12
+hexadecimal digits. Formally, the string representation is defined by
+the following grammar:
+
+ uuid                        = &lt;time_low&gt; &quot;-&quot;
+                               &lt;time_mid&gt; &quot;-&quot;
+                               &lt;time_high_and_version&gt; &quot;-&quot;
+                               &lt;clock_seq_high_and_reserved&gt;
+                               &lt;clock_seq_low&gt; &quot;-&quot;
+                               &lt;node&gt;
+ time_low                    = 4*&lt;hex_octet&gt;
+ time_mid                    = 2*&lt;hex_octet&gt;
+ time_high_and_version       = 2*&lt;hex_octet&gt;
+ clock_seq_high_and_reserved = &lt;hex_octet&gt;
+ clock_seq_low               = &lt;hex_octet&gt;
+ node                        = 6*&lt;hex_octet&gt;
+ hex_octet                   = &lt;hex_digit&gt; &lt;hex_digit&gt;
+ hex_digit                   = &quot;0&quot;|&quot;1&quot;|&quot;2&quot;|&quot;3&quot;|&quot;4&quot;|&quot;5&quot;|&quot;6&quot;|&quot;7&quot;|&quot;8&quot;|&quot;9&quot;
+                              |&quot;a&quot;|&quot;b&quot;|&quot;c&quot;|&quot;d&quot;|&quot;e&quot;|&quot;f&quot;
+                              |&quot;A&quot;|&quot;B&quot;|&quot;C&quot;|&quot;D&quot;|&quot;E&quot;|&quot;F&quot;
+
+An example of a UUID string representation is the ASCII string
+&quot;C&lt;f81d4fae-7dec-11d0-a765-00a0c91e6bf6&gt;&quot;. The string representation
+format is exactly what the B&lt;OSSP uuid&gt; API functions B&lt;uuid_import&gt;()
+and B&lt;uuid_export&gt;() deal with under C&lt;UUID_FMT_STR&gt;.
+
+Notice: a corresponding URL can be generated out of a ASCII string
+representation of an UUID by prefixing with &quot;C&lt;urn:uuid:&gt;&quot; as in
+&quot;C&lt;urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6&gt;&quot;.
+
+=head2 UUID Single Integer Value Representation
+
+According to the ISO/IEC 11578:1996 and ITU-T Rec. X.667 standards, a
+DCE 1.1 variant UUID can be also represented as a single integer value
+consisting of a decimal number with up to 39 digits.
+
+An example of a UUID single integer value representation is the decimal
+number &quot;C&lt;329800735698586629295641978511506172918&gt;&quot;. The string
+representation format is exactly what the B&lt;OSSP uuid&gt; API functions
+B&lt;uuid_import&gt;() and B&lt;uuid_export&gt;() deal with under C&lt;UUID_FMT_SIV&gt;.
+
+Notice: a corresponding ISO OID can be generated under the
+&quot;{joint-iso-itu-t(2) uuid(25)}&quot; arc out of a single integer value
+representation of a UUID by prefixing with &quot;C&lt;2.25.&gt;&quot;. An example OID
+is &quot;C&lt;2.25.329800735698586629295641978511506172918&gt;&quot;. Additionally,
+an URL can be generated by further prefixing with &quot;C&lt;urn:oid:&gt;&quot; as in
+&quot;C&lt;urn:oid:2.25.329800735698586629295641978511506172918&gt;&quot;.
+
+=head2 UUID Variants and Versions
+
+A UUID has a variant and version. The variant defines the layout of the
+UUID. The version defines the content of the UUID. The UUID variant
+supported in B&lt;OSSP uuid&gt; is the DCE 1.1 variant only. The DCE 1.1 UUID
+variant versions supported in B&lt;OSSP uuid&gt; are:
+
+=over 4
+
+=item B&lt;Version 1&gt; (time and node based)
+
+These are the classical UUIDs, created out of a 60-bit system time,
+a 14-bit local clock sequence and 48-bit system MAC address. The MAC
+address can be either the real one of a physical network interface card
+(NIC) or a random multi-cast MAC address. Version 1 UUIDs are usually
+used as one-time global unique identifiers.
+
+=item B&lt;Version 3&gt; (name based, MD5)
+
+These are UUIDs which are based on the 128-bit MD5 message digest of the
+concatenation of a 128-bit namespace UUID and a name string of arbitrary
+length. Version 3 UUIDs are usually used for non-unique but repeatable
+message digest identifiers.
+
+=item B&lt;Version 4&gt; (random data based)
+
+These are UUIDs which are based on just 128-bit of random data. Version
+4 UUIDs are usually used as one-time local unique identifiers.
+
+=item B&lt;Version 5&gt; (name based, SHA-1)
+
+These are UUIDs which are based on the 160-bit SHA-1 message digest of the
+concatenation of a 128-bit namespace UUID and a name string of arbitrary
+length. Version 5 UUIDs are usually used for non-unique but repeatable
+message digest identifiers.
+
+=back
+
+=head2 UUID Uniqueness
+
+Version 1 UUIDs are guaranteed to be unique through combinations of
+hardware addresses, time stamps and random seeds. There is a reference
+in the UUID to the hardware (MAC) address of the first network interface
+card (NIC) on the host which generated the UUID -- this reference
+is intended to ensure the UUID will be unique in space as the MAC
+address of every network card is assigned by a single global authority
+(IEEE) and is guaranteed to be unique. The next component in a UUID
+is a timestamp which, as clock always (should) move forward, will
+be unique in time. Just in case some part of the above goes wrong
+(the hardware address cannot be determined or the clock moved steps
+backward), there is a random clock sequence component placed into the
+UUID as a &quot;catch-all&quot; for uniqueness.
+
+Version 3 and version 5 UUIDs are guaranteed to be inherently globally
+unique if the combination of namespace and name used to generate them is
+unique.
+
+Version 4 UUIDs are not guaranteed to be globally unique, because they
+are generated out of locally gathered pseudo-random numbers only.
+Nevertheless there is still a high likelihood of uniqueness over space
+and time and that they are computationally difficult to guess.
+
+=head2 Nil UUID
+
+There is a special I&lt;Nil&gt; UUID consisting of all octets set to zero in
+the binary representation. It can be used as a special UUID value which does
+not conflict with real UUIDs.
+
+=head1 APPLICATION PROGRAMMING INTERFACE
+
+The ISO-C Application Programming Interface (API) of B&lt;OSSP uuid&gt;
+consists of the following components.
+
+=head2 CONSTANTS
+
+The following constants are provided:
+
+=over 4
+
+=item B&lt;UUID_VERSION&gt;
+
+The hexadecimal encoded B&lt;OSSP uuid&gt; version. This allows compile-time
+checking of the B&lt;OSSP uuid&gt; version. For run-time checking use
+B&lt;uuid_version&gt;() instead.
+
+The hexadecimal encoding for a version &quot;$I&lt;v&gt;.$I&lt;r&gt;$I&lt;t&gt;$I&lt;l&gt;&quot; is
+calculated with the B&lt;GNU shtool&gt; B&lt;version&gt; command and is (in
+Perl-style for concise description) &quot;sprintf('0x%x%02x%d%02x', $I&lt;v&gt;,
+$I&lt;r&gt;, {qw(s 9 . 2 b 1 a 0)}-&gt;{$I&lt;t&gt;}, ($I&lt;t&gt; eq 's' ? 99 : $I&lt;l&gt;))&quot;,
+i.e., the version 0.9.6 is encoded as &quot;0x009206&quot;.
+
+=item B&lt;UUID_LEN_BIN&gt;, B&lt;UUID_LEN_STR&gt;, B&lt;UUID_LEN_SIV&gt;
+
+The number of octets of the UUID binary and string representations.
+Notice that the lengths of the string representation (B&lt;UUID_LEN_STR&gt;)
+and the lengths of the single integer value representation
+(B&lt;UUID_LEN_SIV&gt;) does I&lt;not&gt; include the necessary C&lt;NUL&gt; termination
+character.
+
+=item B&lt;UUID_MAKE_V1&gt;, B&lt;UUID_MAKE_V3&gt;, B&lt;UUID_MAKE_V4&gt;, B&lt;UUID_MAKE_V5&gt;, B&lt;UUID_MAKE_MC&gt;
+
+The I&lt;mode&gt; bits for use with B&lt;uuid_make&gt;(). The B&lt;UUID_MAKE_V&gt;I&lt;N&gt;
+specify which UUID version to generate. The B&lt;UUID_MAKE_MC&gt; forces the
+use of a random multi-cast MAC address instead of the real physical MAC
+address in version 1 UUIDs.
+
+=item B&lt;UUID_RC_OK&gt;, B&lt;UUID_RC_ARG&gt;, B&lt;UUID_RC_MEM&gt;, B&lt;UUID_RC_SYS&gt;, B&lt;UUID_RC_INT&gt;, B&lt;UUID_RC_IMP&gt;
+
+The possible numerical return-codes of API functions.
+The C&lt;UUID_RC_OK&gt; indicates success, the others indicate errors.
+Use B&lt;uuid_error&gt;() to translate them into string versions.
+
+=item B&lt;UUID_FMT_BIN&gt;, B&lt;UUID_FMT_STR&gt;, B&lt;UUID_FMT_SIV&gt;, B&lt;UUID_FMT_TXT&gt;
+
+The I&lt;fmt&gt; formats for use with B&lt;uuid_import&gt;() and B&lt;uuid_export&gt;().
+The B&lt;UUID_FMT_BIN&gt; indicates the UUID binary representation (of
+length B&lt;UUID_LEN_BIN&gt;), the B&lt;UUID_FMT_STR&gt; indicates the UUID string
+representation (of length B&lt;UUID_LEN_STR&gt;), the B&lt;UUID_FMT_SIV&gt;
+indicates the UUID single integer value representation (of maximum
+length B&lt;UUID_LEN_SIV&gt;) and the B&lt;UUID_FMT_TXT&gt; indicates the textual
+description (of arbitrary length) of a UUID.
+
+=back
+
+=head2 FUNCTIONS
+
+The following functions are provided:
+
+=over 4
+
+=item uuid_rc_t B&lt;uuid_create&gt;(uuid_t **I&lt;uuid&gt;);
+
+Create a new UUID object and store a pointer to it in C&lt;*&gt;I&lt;uuid&gt;.
+A UUID object consists of an internal representation of a UUID, the
+internal PRNG and MD5 generator contexts, and cached MAC address and
+timestamp information. The initial UUID is the I&lt;Nil&gt; UUID.
+
+=item uuid_rc_t B&lt;uuid_destroy&gt;(uuid_t *I&lt;uuid&gt;);
+
+Destroy UUID object I&lt;uuid&gt;.
+
+=item uuid_rc_t B&lt;uuid_clone&gt;(const uuid_t *I&lt;uuid&gt;, uuid_t **I&lt;uuid_clone&gt;);
+
+Clone UUID object I&lt;uuid&gt; and store new UUID object in I&lt;uuid_clone&gt;.
+
+=item uuid_rc_t B&lt;uuid_isnil&gt;(const uuid_t *I&lt;uuid&gt;, int *I&lt;result&gt;);
+
+Checks whether the UUID in I&lt;uuid&gt; is the I&lt;Nil&gt; UUID.
+If this is the case, it returns I&lt;true&gt; in C&lt;*&gt;I&lt;result&gt;.
+Else it returns I&lt;false&gt; in C&lt;*&gt;I&lt;result&gt;.
+
+=item uuid_rc_t B&lt;uuid_compare&gt;(const uuid_t *I&lt;uuid&gt;, const uuid_t *I&lt;uuid2&gt;, int *I&lt;result&gt;);
+
+Compares the order of the two UUIDs in I&lt;uuid1&gt; and I&lt;uuid2&gt;
+and returns the result in C&lt;*&gt;I&lt;result&gt;: C&lt;-1&gt; if I&lt;uuid1&gt; is
+smaller than I&lt;uuid2&gt;, C&lt;0&gt; if I&lt;uuid1&gt; is equal to I&lt;uuid2&gt;
+and C&lt;+1&gt; if I&lt;uuid1&gt; is greater than I&lt;uuid2&gt;.
+
+=item uuid_rc_t B&lt;uuid_import&gt;(uuid_t *I&lt;uuid&gt;, uuid_fmt_t I&lt;fmt&gt;, const void *I&lt;data_ptr&gt;, size_t I&lt;data_len&gt;);
+
+Imports a UUID I&lt;uuid&gt; from an external representation of format I&lt;fmt&gt;.
+The data is read from the buffer at I&lt;data_ptr&gt; which contains at least
+I&lt;data_len&gt; bytes.
+
+The format of the external representation is specified by I&lt;fmt&gt; and the
+minimum expected length in I&lt;data_len&gt; depends on it. Valid values for
+I&lt;fmt&gt; are B&lt;UUID_FMT_BIN&gt;, B&lt;UUID_FMT_STR&gt; and B&lt;UUID_FMT_SIV&gt;.
+
+=item uuid_rc_t B&lt;uuid_export&gt;(const uuid_t *I&lt;uuid&gt;, uuid_fmt_t I&lt;fmt&gt;, void *I&lt;data_ptr&gt;, size_t *I&lt;data_len&gt;);
+
+Exports a UUID I&lt;uuid&gt; into an external representation of format
+I&lt;fmt&gt;. Valid values for I&lt;fmt&gt; are B&lt;UUID_FMT_BIN&gt;, B&lt;UUID_FMT_STR&gt;,
+B&lt;UUID_FMT_SIV&gt; and B&lt;UUID_FMT_TXT&gt;.
+
+The data is written to the buffer whose location is obtained
+by dereferencing I&lt;data_ptr&gt; after a &quot;cast&quot; to the appropriate
+pointer-to-pointer type. Hence the generic pointer argument I&lt;data_ptr&gt;
+is expected to be a pointer to a &quot;pointer of a particular type&quot;, i.e.,
+it has to be of type &quot;C&lt;unsigned char **&gt;&quot; for B&lt;UUID_FMT_BIN&gt; and
+&quot;C&lt;char **&gt;&quot; for B&lt;UUID_FMT_STR&gt;, B&lt;UUID_FMT_SIV&gt; and B&lt;UUID_FMT_TXT&gt;.
+
+The buffer has to be room for at least C&lt;*&gt;I&lt;data_len&gt; bytes. If the
+value of the pointer after &quot;casting&quot; and dereferencing I&lt;data_ptr&gt;
+is C&lt;NULL&gt;, I&lt;data_len&gt; is ignored as input and a new buffer is
+allocated and returned in the pointer after &quot;casting&quot; and dereferencing
+I&lt;data_ptr&gt; (the caller has to free(3) it later on).
+
+If I&lt;data_len&gt; is not C&lt;NULL&gt;, the number of available bytes in the
+buffer has to be provided in C&lt;*&gt;I&lt;data_len&gt; and the number of actually
+written bytes are returned in C&lt;*&gt;I&lt;data_len&gt; again. The minimum
+required buffer length depends on the external representation as
+specified by I&lt;fmt&gt; and is at least B&lt;UUID_LEN_BIN&gt; for B&lt;UUID_FMT_BIN&gt;,
+B&lt;UUID_LEN_STR&gt; for B&lt;UUID_FMT_STR&gt; and B&lt;UUID_LEN_SIV&gt; for
+B&lt;UUID_FMT_SIV&gt;. For B&lt;UUID_FMT_TXT&gt; a buffer of unspecified length is
+required and hence it is recommended to allow B&lt;OSSP uuid&gt; to allocate
+the buffer as necessary.
+
+=item uuid_rc_t B&lt;uuid_load&gt;(uuid_t *I&lt;uuid&gt;, const char *I&lt;name&gt;);
+
+Loads a pre-defined UUID value into the UUID object I&lt;uuid&gt;. The
+following I&lt;name&gt; arguments are currently known:
+
+=over 4
+
+=item I&lt;name&gt;      I&lt;UUID&gt;
+
+=item nil       00000000-0000-0000-0000-000000000000
+
+=item ns:DNS    6ba7b810-9dad-11d1-80b4-00c04fd430c8
+
+=item ns:URL    6ba7b811-9dad-11d1-80b4-00c04fd430c8
+
+=item ns:OID    6ba7b812-9dad-11d1-80b4-00c04fd430c8
+
+=item ns:X500   6ba7b814-9dad-11d1-80b4-00c04fd430c8
+
+=back
+
+The &quot;C&lt;ns:&gt;I&lt;XXX&gt;&quot; are names of pre-defined name-space UUIDs for use in
+the generation of DCE 1.1 version 3 and version 5 UUIDs.
+
+=item uuid_rc_t B&lt;uuid_make&gt;(uuid_t *I&lt;uuid&gt;, unsigned int I&lt;mode&gt;, ...);
+
+Generates a new UUID in I&lt;uuid&gt; according to I&lt;mode&gt; and optional
+arguments (dependent on I&lt;mode&gt;).
+
+If I&lt;mode&gt; contains the C&lt;UUID_MAKE_V1&gt; bit, a DCE 1.1 variant UUID of
+version 1 is generated. Then optionally the bit C&lt;UUID_MAKE_MC&gt; forces
+the use of random multi-cast MAC address instead of the real physical
+MAC address (the default). The UUID is generated out of the 60-bit current
+system time, a 12-bit clock sequence and the 48-bit MAC address.
+
+If I&lt;mode&gt; contains the C&lt;UUID_MAKE_V3&gt; or C&lt;UUID_MAKE_V5&gt; bit, a DCE
+1.1 variant UUID of version 3 or 5 is generated and two additional
+arguments are expected: first, a namespace UUID object (C&lt;uuid_t *&gt;).
+Second, a name string of arbitrary length (C&lt;const char *&gt;). The UUID is
+generated out of the 128-bit MD5 or 160-bit SHA-1 from the concatenated
+octet stream of namespace UUID and name string.
+
+If I&lt;mode&gt; contains the C&lt;UUID_MAKE_V4&gt; bit, a DCE 1.1 variant UUID
+of version 4 is generated. The UUID is generated out of 128-bit random
+data.
+
+=item char *B&lt;uuid_error&gt;(uuid_rc_t I&lt;rc&gt;);
+
+Returns a constant string representation corresponding to the
+return-code I&lt;rc&gt; for use in displaying B&lt;OSSP uuid&gt; errors.
+
+=item unsigned long B&lt;uuid_version&gt;(void);
+
+Returns the hexadecimal encoded B&lt;OSSP uuid&gt; version as compiled into
+the library object files. This allows run-time checking of the B&lt;OSSP
+uuid&gt; version. For compile-time checking use C&lt;UUID_VERSION&gt; instead.
+
+=back
+
+=head1 EXAMPLE
+
+The following shows an example usage of the API. Error handling is
+omitted for code simplification and has to be re-added for production
+code.
+
+ /* generate a DCE 1.1 v1 UUID from system environment */
+ char *uuid_v1(void)
+ {
+     uuid_t *uuid;
+     char *str;
+
+     uuid_create(&amp;uuid);
+     uuid_make(uuid, UUID_MAKE_V1);
+     str = NULL;
+     uuid_export(uuid, UUID_FMT_STR, &amp;str, NULL);
+     uuid_destroy(uuid);
+     return str;
+ }
+
+ /* generate a DCE 1.1 v3 UUID from an URL */
+ char *uuid_v3(const char *url)
+ {
+     uuid_t *uuid;
+     uuid_t *uuid_ns;
+     char *str;
+
+     uuid_create(&amp;uuid);
+     uuid_create(&amp;uuid_ns);
+     uuid_load(uuid_ns, &quot;ns:URL&quot;);
+     uuid_make(uuid, UUID_MAKE_V3, uuid_ns, url);
+     str = NULL;
+     uuid_export(uuid, UUID_FMT_STR, &amp;str, NULL);
+     uuid_destroy(uuid_ns);
+     uuid_destroy(uuid);
+     return str;
+ }
+
+=head1 SEE ALSO
+
+The following are references to B&lt;UUID&gt; documentation and specifications:
+
+=over 4
+
+=item
+
+B&lt;A Universally Unique IDentifier (UUID) URN Namespace&gt;,
+P. Leach, M. Mealling, R. Salz,
+IETF RFC-4122,
+July 2005, 32 pages,
+http://www.ietf.org/rfc/rfc4122.txt
+
+=item
+
+Information Technology -- Open Systems Interconnection (OSI),
+B&lt;Procedures for the operation of OSI Registration Authorities:
+Generation and Registration of Universally Unique Identifiers (UUIDs)
+and their Use as ASN.1 Object Identifier Components&gt;,
+ISO/IEC 9834-8:2004 / ITU-T Rec. X.667, 2004,
+December 2004, 25 pages,
+http://www.itu.int/ITU-T/studygroups/com17/oid/X.667-E.pdf
+
+=item
+
+B&lt;DCE 1.1: Remote Procedure Call&gt;,
+appendix B&lt;Universally Unique Identifier&gt;,
+Open Group Technical Standard
+Document Number C706, August 1997, 737 pages,
+(supersedes C309 DCE: Remote Procedure Call 8/1994,
+which was basis for ISO/IEC 11578:1996 specification),
+http://www.opengroup.org/publications/catalog/c706.htm
+
+=item
+
+Information technology -- Open Systems Interconnection (OSI),
+B&lt;Remote Procedure Call (RPC)&gt;,
+ISO/IEC 11578:1996,
+August 2001, 570 pages, (CHF 340,00),
+http://www.iso.ch/cate/d2229.html
+
+=item
+
+B&lt;HTTP Extensions for Distributed Authoring (WebDAV)&gt;,
+section B&lt;6.4.1 Node Field Generation Without the IEEE 802 Address&gt;,
+IETF RFC-2518,
+February 1999, 94 pages,
+http://www.ietf.org/rfc/rfc2518.txt
+
+=item
+
+B&lt;DCE 1.1 compliant UUID functions&gt;,
+FreeBSD manual pages uuid(3) and uuidgen(2),
+http://www.freebsd.org/cgi/man.cgi?query=uuid&amp;manpath=FreeBSD+6.0-RELEASE
+
+=back
+
+=head1 HISTORY
+
+B&lt;OSSP uuid&gt; was implemented in January 2004 by Ralf S. Engelschall
+E&lt;lt&gt;rse@engelschall.comE&lt;gt&gt;. It was prompted by the use of UUIDs
+in the B&lt;OSSP as&gt; and B&lt;OpenPKG&gt; projects. It is a clean room
+implementation intended to be strictly standards compliant and maximum
+portable.
+
+=head1 SEE ALSO
+
+uuid(1), uuid-config(1), OSSP::uuid(3).
+
+=cut
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_ach"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_ac.h (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_ac.h                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_ac.h        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,109 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid_ac.c: auto-configuration
+*/
+
+#ifndef __UUID_AC_H__
+#define __UUID_AC_H__
+
+/* include GNU autoconf results */
+#include &quot;config.h&quot;           /* HAVE_xxx */
+
+/* include standard system headers */
+#include &lt;stdio.h&gt;            /* NULL, etc. */
+#include &lt;stdlib.h&gt;           /* malloc, NULL, etc. */
+#include &lt;stdarg.h&gt;           /* va_list, etc. */
+#include &lt;string.h&gt;           /* size_t, strlen, etc. */
+#include &lt;unistd.h&gt;           /* dmalloc pre-loading */
+
+/* enable optional &quot;dmalloc&quot; support */
+#ifdef WITH_DMALLOC
+#include &lt;dmalloc.h&gt;          /* malloc override, etc */
+#endif
+
+/* define boolean values */
+#define UUID_FALSE 0
+#define UUID_TRUE  (/*lint -save -e506*/ !UUID_FALSE /*lint -restore*/)
+
+/* determine types of 8-bit size */
+#if SIZEOF_CHAR == 1
+typedef char uuid_int8_t;
+#else
+#error unexpected: sizeof(char) != 1 !?
+#endif
+#if SIZEOF_UNSIGNED_CHAR == 1
+typedef unsigned char uuid_uint8_t;
+#else
+#error unexpected: sizeof(unsigned char) != 1 !?
+#endif
+
+/* determine types of 16-bit size */
+#if SIZEOF_SHORT == 2
+typedef short uuid_int16_t;
+#elif SIZEOF_INT == 2
+typedef int uuid_int16_t;
+#elif SIZEOF_LONG == 2
+typedef long uuid_int16_t;
+#else
+#error unexpected: no type found for uuid_int16_t
+#endif
+#if SIZEOF_UNSIGNED_SHORT == 2
+typedef unsigned short uuid_uint16_t;
+#elif SIZEOF_UNSIGNED_INT == 2
+typedef unsigned int uuid_uint16_t;
+#elif SIZEOF_UNSIGNED_LONG == 2
+typedef unsigned long uuid_uint16_t;
+#else
+#error unexpected: no type found for uuid_uint16_t
+#endif
+
+/* determine types of 32-bit size */
+#if SIZEOF_SHORT == 4
+typedef short uuid_int32_t;
+#elif SIZEOF_INT == 4
+typedef int uuid_int32_t;
+#elif SIZEOF_LONG == 4
+typedef long uuid_int32_t;
+#elif SIZEOF_LONG_LONG == 4
+typedef long long uuid_int32_t;
+#else
+#error unexpected: no type found for uuid_int32_t
+#endif
+#if SIZEOF_UNSIGNED_SHORT == 4
+typedef unsigned short uuid_uint32_t;
+#elif SIZEOF_UNSIGNED_INT == 4
+typedef unsigned int uuid_uint32_t;
+#elif SIZEOF_UNSIGNED_LONG == 4
+typedef unsigned long uuid_uint32_t;
+#elif SIZEOF_UNSIGNED_LONG_LONG == 4
+typedef unsigned long long uuid_uint32_t;
+#else
+#error unexpected: no type found for uuid_uint32_t
+#endif
+
+#endif /* __UUID_AC_H__ */
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_bmh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_bm.h (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_bm.h                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_bm.h        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,80 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid_bm.c: bitmask API implementation
+*/
+
+#ifndef __UUID_BM_H__
+#define __UUID_BM_H__
+
+/*
+ *  Bitmask Calculation Macros (up to 32 bit only)
+ *  (Notice: bit positions are counted n...0, i.e. lowest bit is position 0)
+ */
+
+/* generate a bitmask consisting of 1 bits from (and including)
+   bit position `l' (left) to (and including) bit position `r' */
+#define BM_MASK(l,r) \
+    ((((unsigned int)1&lt;&lt;(((l)-(r))+1))-1)&lt;&lt;(r))
+
+/* extract a value v from a word w at position `l' to `r' and return value */
+#define BM_GET(w,l,r) \
+    (((w)&gt;&gt;(r))&amp;BM_MASK((l)-(r),0))
+
+/* insert a value v into a word w at position `l' to `r' and return word */
+#define BM_SET(w,l,r,v) \
+    ((w)|(((v)&amp;BM_MASK((l)-(r),0))&lt;&lt;(r)))
+
+/* generate a single bit `b' (0 or 1) at bit position `n' */
+#define BM_BIT(n,b) \
+    ((b)&lt;&lt;(n))
+
+/* generate a quad word octet of bits (a half byte, i.e. bit positions 3 to 0) */
+#define BM_QUAD(b3,b2,b1,b0) \
+    (BM_BIT(3,(b3))|BM_BIT(2,(b2))|BM_BIT(1,(b1))|BM_BIT(0,(b0)))
+
+/* generate an octet word of bits (a byte, i.e. bit positions 7 to 0) */
+#define BM_OCTET(b7,b6,b5,b4,b3,b2,b1,b0) \
+    ((BM_QUAD(b7,b6,b5,b4)&lt;&lt;4)|BM_QUAD(b3,b2,b1,b0))
+
+/* generate the value 2^n */
+#define BM_POW2(n) \
+    BM_BIT(n,1)
+
+/* shift word w k bits to the left or to the right */
+#define BM_SHL(w,k) \
+    ((w)&lt;&lt;(k))
+#define BM_SHR(w,k) \
+    ((w)&gt;&gt;(k))
+
+/* rotate word w (of bits n..0) k bits to the left or to the right */
+#define BM_ROL(w,n,k) \
+    ((BM_SHL((w),(k))&amp;BM_MASK(n,0))|BM_SHR(((w)&amp;BM_MASK(n,0)),(n)-(k)))
+#define BM_ROR(w,n,k) \
+    ((BM_SHR(((w)&amp;BM_MASK(n,0)),(k)))|BM_SHL(((w),(n)-(k))&amp;BM_MASK(n,0)))
+
+#endif /* __UUID_BM_H__ */
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_clic"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_cli.c (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_cli.c                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_cli.c        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,283 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid_cli.c: command line tool
+*/
+
+/* own headers */
+#include &quot;uuid.h&quot;
+#include &quot;uuid_ac.h&quot;
+
+/* system headers */
+#include &lt;stdio.h&gt;
+#include &lt;stdlib.h&gt;
+#include &lt;stdarg.h&gt;
+#include &lt;unistd.h&gt;
+#include &lt;string.h&gt;
+#include &lt;errno.h&gt;
+
+/* error handler */
+static void
+error(int ec, const char *str, ...)
+{
+    va_list ap;
+
+    va_start(ap, str);
+    fprintf(stderr, &quot;uuid:ERROR: &quot;);
+    vfprintf(stderr, str, ap);
+    fprintf(stderr, &quot;\n&quot;);
+    va_end(ap);
+    exit(ec);
+}
+
+/* usage handler */
+static void
+usage(const char *str, ...)
+{
+    va_list ap;
+
+    va_start(ap, str);
+    if (str != NULL) {
+        fprintf(stderr, &quot;uuid:ERROR: &quot;);
+        vfprintf(stderr, str, ap);
+        fprintf(stderr, &quot;\n&quot;);
+    }
+    fprintf(stderr, &quot;usage: uuid [-v version] [-m] [-n count] [-1] [-F format] [-o filename] [namespace name]\n&quot;);
+    fprintf(stderr, &quot;usage: uuid -d [-F format] [-o filename] [uuid]\n&quot;);
+    va_end(ap);
+    exit(1);
+}
+
+/* main procedure */
+int main(int argc, char *argv[])
+{
+    char uuid_buf_bin[UUID_LEN_BIN];
+    char uuid_buf_str[UUID_LEN_STR+1];
+    char uuid_buf_siv[UUID_LEN_SIV+1];
+    uuid_t *uuid;
+    uuid_t *uuid_ns;
+    uuid_rc_t rc;
+    FILE *fp;
+    char *p;
+    int ch;
+    int count;
+    int i;
+    int iterate;
+    uuid_fmt_t fmt;
+    int decode;
+    void *vp;
+    size_t n;
+    unsigned int version;
+
+    /* command line parsing */
+    count = -1;         /* no count yet */
+    fp = stdout;        /* default output file */
+    iterate = 0;        /* not one at a time */
+    fmt = UUID_FMT_STR; /* default is ASCII output */
+    decode = 0;         /* default is to encode */
+    version = UUID_MAKE_V1;
+    while ((ch = getopt(argc, argv, &quot;1n:rF:dmo:v:h&quot;)) != -1) {
+        switch (ch) {
+            case '1':
+                iterate = 1;
+                break;
+            case 'n':
+                if (count &gt; 0)
+                    usage(&quot;option 'n' specified multiple times&quot;);
+                count = strtol(optarg, &amp;p, 10);
+                if (*p != '\0' || count &lt; 1)
+                    usage(&quot;invalid argument to option 'n'&quot;);
+                break;
+            case 'r':
+                fmt = UUID_FMT_BIN;
+                break;
+            case 'F':
+                if (strcasecmp(optarg, &quot;bin&quot;) == 0)
+                    fmt = UUID_FMT_BIN;
+                else if (strcasecmp(optarg, &quot;str&quot;) == 0)
+                    fmt = UUID_FMT_STR;
+                else if (strcasecmp(optarg, &quot;siv&quot;) == 0)
+                    fmt = UUID_FMT_SIV;
+                else
+                    error(1, &quot;invalid format \&quot;%s\&quot; (has to be \&quot;bin\&quot;, \&quot;str\&quot; or \&quot;siv\&quot;)&quot;, optarg);
+                break;
+            case 'd':
+                decode = 1;
+                break;
+            case 'o':
+                if (fp != stdout)
+                    error(1, &quot;multiple output files are not allowed&quot;);
+                if ((fp = fopen(optarg, &quot;w&quot;)) == NULL)
+                    error(1, &quot;fopen: %s&quot;, strerror(errno));
+                break;
+            case 'm':
+                version |= UUID_MAKE_MC;
+                break;
+            case 'v':
+                i = strtol(optarg, &amp;p, 10);
+                if (*p != '\0')
+                    usage(&quot;invalid argument to option 'v'&quot;);
+                switch (i) {
+                    case 1: version = UUID_MAKE_V1; break;
+                    case 3: version = UUID_MAKE_V3; break;
+                    case 4: version = UUID_MAKE_V4; break;
+                    case 5: version = UUID_MAKE_V5; break;
+                    default:
+                        usage(&quot;invalid version on option 'v'&quot;);
+                        break;
+                }
+                break;
+            case 'h':
+                usage(NULL);
+                break;
+            default:
+                usage(&quot;invalid option '%c'&quot;, optopt);
+        }
+    }
+    argv += optind;
+    argc -= optind;
+    if (count == -1)
+        count = 1;
+
+    if (decode) {
+        /* decoding */
+        if ((rc = uuid_create(&amp;uuid)) != UUID_RC_OK)
+            error(1, &quot;uuid_create: %s&quot;, uuid_error(rc));
+        if (argc != 1)
+            usage(&quot;invalid number of arguments&quot;);
+        if (strcmp(argv[0], &quot;-&quot;) == 0) {
+            if (fmt == UUID_FMT_BIN) {
+                if (fread(uuid_buf_bin, UUID_LEN_BIN, 1, stdin) != 1)
+                    error(1, &quot;fread: failed to read %d (UUID_LEN_BIN) bytes from stdin&quot;, UUID_LEN_BIN);
+                if ((rc = uuid_import(uuid, UUID_FMT_BIN, uuid_buf_bin, UUID_LEN_BIN)) != UUID_RC_OK)
+                    error(1, &quot;uuid_import: %s&quot;, uuid_error(rc));
+            }
+            else if (fmt == UUID_FMT_STR) {
+                if (fread(uuid_buf_str, UUID_LEN_STR, 1, stdin) != 1)
+                    error(1, &quot;fread: failed to read %d (UUID_LEN_STR) bytes from stdin&quot;, UUID_LEN_STR);
+                uuid_buf_str[UUID_LEN_STR] = '\0';
+                if ((rc = uuid_import(uuid, UUID_FMT_STR, uuid_buf_str, UUID_LEN_STR)) != UUID_RC_OK)
+                    error(1, &quot;uuid_import: %s&quot;, uuid_error(rc));
+            }
+            else if (fmt == UUID_FMT_SIV) {
+                if (fread(uuid_buf_siv, UUID_LEN_SIV, 1, stdin) != 1)
+                    error(1, &quot;fread: failed to read %d (UUID_LEN_SIV) bytes from stdin&quot;, UUID_LEN_SIV);
+                uuid_buf_siv[UUID_LEN_SIV] = '\0';
+                if ((rc = uuid_import(uuid, UUID_FMT_SIV, uuid_buf_siv, UUID_LEN_SIV)) != UUID_RC_OK)
+                    error(1, &quot;uuid_import: %s&quot;, uuid_error(rc));
+            }
+        }
+        else {
+            if (fmt == UUID_FMT_BIN) {
+                error(1, &quot;binary input mode only possible if reading from stdin&quot;);
+            }
+            else if (fmt == UUID_FMT_STR) {
+                if ((rc = uuid_import(uuid, UUID_FMT_STR, argv[0], strlen(argv[0]))) != UUID_RC_OK)
+                    error(1, &quot;uuid_import: %s&quot;, uuid_error(rc));
+            }
+            else if (fmt == UUID_FMT_SIV) {
+                if ((rc = uuid_import(uuid, UUID_FMT_SIV, argv[0], strlen(argv[0]))) != UUID_RC_OK)
+                    error(1, &quot;uuid_import: %s&quot;, uuid_error(rc));
+            }
+        }
+        vp = NULL;
+        if ((rc = uuid_export(uuid, UUID_FMT_TXT, &amp;vp, NULL)) != UUID_RC_OK)
+            error(1, &quot;uuid_export: %s&quot;, uuid_error(rc));
+        fprintf(stdout, &quot;%s&quot;, (char *)vp);
+        free(vp);
+        if ((rc = uuid_destroy(uuid)) != UUID_RC_OK)
+            error(1, &quot;uuid_destroy: %s&quot;, uuid_error(rc));
+    }
+    else {
+        /* encoding */
+        if (   (version == UUID_MAKE_V1 &amp;&amp; argc != 0)
+            || (version == UUID_MAKE_V3 &amp;&amp; argc != 2)
+            || (version == UUID_MAKE_V4 &amp;&amp; argc != 0)
+            || (version == UUID_MAKE_V5 &amp;&amp; argc != 2))
+            usage(&quot;invalid number of arguments&quot;);
+        if ((rc = uuid_create(&amp;uuid)) != UUID_RC_OK)
+            error(1, &quot;uuid_create: %s&quot;, uuid_error(rc));
+        if (argc == 1) {
+            /* load initial UUID for setting old generator state */
+            if (strlen(argv[0]) != UUID_LEN_STR)
+                error(1, &quot;invalid length of UUID string representation&quot;);
+            if ((rc = uuid_import(uuid, UUID_FMT_STR, argv[0], strlen(argv[0]))) != UUID_RC_OK)
+                error(1, &quot;uuid_import: %s&quot;, uuid_error(rc));
+        }
+        for (i = 0; i &lt; count; i++) {
+            if (iterate) {
+                if ((rc = uuid_load(uuid, &quot;nil&quot;)) != UUID_RC_OK)
+                    error(1, &quot;uuid_load: %s&quot;, uuid_error(rc));
+            }
+            if (version == UUID_MAKE_V3 || version == UUID_MAKE_V5) {
+                if ((rc = uuid_create(&amp;uuid_ns)) != UUID_RC_OK)
+                    error(1, &quot;uuid_create: %s&quot;, uuid_error(rc));
+                if ((rc = uuid_load(uuid_ns, argv[0])) != UUID_RC_OK) {
+                    if ((rc = uuid_import(uuid_ns, UUID_FMT_STR, argv[0], strlen(argv[0]))) != UUID_RC_OK)
+                        error(1, &quot;uuid_import: %s&quot;, uuid_error(rc));
+                }
+                if ((rc = uuid_make(uuid, version, uuid_ns, argv[1])) != UUID_RC_OK)
+                    error(1, &quot;uuid_make: %s&quot;, uuid_error(rc));
+                if ((rc = uuid_destroy(uuid_ns)) != UUID_RC_OK)
+                    error(1, &quot;uuid_destroy: %s&quot;, uuid_error(rc));
+            }
+            else {
+                if ((rc = uuid_make(uuid, version)) != UUID_RC_OK)
+                    error(1, &quot;uuid_make: %s&quot;, uuid_error(rc));
+            }
+            if (fmt == UUID_FMT_BIN) {
+                vp = NULL;
+                if ((rc = uuid_export(uuid, UUID_FMT_BIN, &amp;vp, &amp;n)) != UUID_RC_OK)
+                    error(1, &quot;uuid_export: %s&quot;, uuid_error(rc));
+                fwrite(vp, n, 1, fp);
+                free(vp);
+            }
+            else if (fmt == UUID_FMT_STR) {
+                vp = NULL;
+                if ((rc = uuid_export(uuid, UUID_FMT_STR, &amp;vp, &amp;n)) != UUID_RC_OK)
+                    error(1, &quot;uuid_export: %s&quot;, uuid_error(rc));
+                fprintf(fp, &quot;%s\n&quot;, (char *)vp);
+                free(vp);
+            }
+            else if (fmt == UUID_FMT_SIV) {
+                vp = NULL;
+                if ((rc = uuid_export(uuid, UUID_FMT_SIV, &amp;vp, &amp;n)) != UUID_RC_OK)
+                    error(1, &quot;uuid_export: %s&quot;, uuid_error(rc));
+                fprintf(fp, &quot;%s\n&quot;, (char *)vp);
+                free(vp);
+            }
+        }
+        if ((rc = uuid_destroy(uuid)) != UUID_RC_OK)
+            error(1, &quot;uuid_destroy: %s&quot;, uuid_error(rc));
+    }
+
+    /* close output channel */
+    if (fp != stdout)
+        fclose(fp);
+
+    return 0;
+}
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_clipod"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_cli.pod (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_cli.pod                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_cli.pod        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,201 @@
</span><ins>+##
+##  OSSP uuid - Universally Unique Identifier
+##  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+##  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+##
+##  This file is part of OSSP uuid, a library for the generation
+##  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+##
+##  Permission to use, copy, modify, and distribute this software for
+##  any purpose with or without fee is hereby granted, provided that
+##  the above copyright notice and this permission notice appear in all
+##  copies.
+##
+##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+##  SUCH DAMAGE.
+##
+##  uuid_cli.pod: manual page
+##
+
+=pod
+
+=head1 NAME
+
+B&lt;OSSP uuid&gt; - B&lt;Universally Unique Identifier Command-Line Tool&gt;
+
+=head1 VERSION
+
+OSSP uuid UUID_VERSION_STR
+
+=head1 SYNOPSIS
+
+B&lt;uuid&gt;
+[B&lt;-v&gt; I&lt;version&gt;]
+[B&lt;-m&gt;]
+[B&lt;-n&gt; I&lt;count&gt;]
+[B&lt;-1&gt;]
+[B&lt;-F&gt; I&lt;format&gt;]
+[B&lt;-o&gt; I&lt;filename&gt;]
+[I&lt;namespace&gt; I&lt;name&gt;]
+
+B&lt;uuid&gt;
+B&lt;-d&gt;
+[B&lt;-r&gt;]
+[B&lt;-o&gt; I&lt;filename&gt;]
+I&lt;uuid&gt;
+
+=head1 DESCRIPTION
+
+B&lt;OSSP uuid&gt; is a ISO-C:1999 application programming interface (API) and
+corresponding command line interface (CLI) for the generation of DCE
+1.1, ISO/IEC 11578:1996 and IETF RFC-4122 compliant I&lt;Universally Unique
+Identifier&gt; (UUID). It supports DCE 1.1 variant UUIDs of version 1 (time
+and node based), version 3 (name based, MD5), version 4 (random number
+based) and version 5 (name based, SHA-1). Additional API bindings are
+provided for the languages ISO-C++:1998, Perl:5 and PHP:4/5. Optional
+backward compatibility exists for the ISO-C DCE-1.1 and Perl Data::UUID
+APIs.
+
+UUIDs are 128 bit numbers which are intended to have a high likelihood
+of uniqueness over space and time and are computationally difficult
+to guess. They are globally unique identifiers which can be locally
+generated without contacting a global registration authority. UUIDs
+are intended as unique identifiers for both mass tagging objects
+with an extremely short lifetime and to reliably identifying very
+persistent objects across a network.
+
+This is the command line interface (CLI) of B&lt;OSSP uuid&gt;. For a
+detailed description of UUIDs see the documentation of the application
+programming interface (API) in uuid(3).
+
+=head1 OPTIONS
+
+=over 3
+
+=item B&lt;-v&gt; I&lt;version&gt;
+
+Sets the version of the generated DCE 1.1 variant UUID. Supported
+are I&lt;version&gt; &quot;C&lt;1&gt;&quot;, &quot;C&lt;3&gt;&quot;, &quot;C&lt;4&gt;&quot; and &quot;C&lt;5&gt;&quot;. The default is &quot;C&lt;1&gt;&quot;.
+
+For version 3 and version 5 UUIDs the additional command line arguments
+I&lt;namespace&gt; and I&lt;name&gt; have to be given. The I&lt;namespace&gt; is either
+a UUID in string representation or an identifier for internally
+pre-defined namespace UUIDs (currently known are &quot;C&lt;ns:DNS&gt;&quot;,
+&quot;C&lt;ns:URL&gt;&quot;, &quot;C&lt;ns:OID&gt;&quot;, and &quot;C&lt;ns:X500&gt;&quot;). The I&lt;name&gt; is a string of
+arbitrary length.
+
+=item B&lt;-m&gt;
+
+Forces the use of a random multi-cast MAC address when generating
+version 1 UUIDs. By default the real physical MAC address of the system
+is used.
+
+=item B&lt;-n&gt; I&lt;count&gt;
+
+Generate I&lt;count&gt; UUIDs instead of just a single one (the default).
+
+=item B&lt;-1&gt;
+
+If option B&lt;-n&gt; is used with a I&lt;count&gt; greater than C&lt;1&gt;, then this
+option can enforce the reset the UUID context for each generated UUID.
+This makes no difference for I&lt;version&gt; C&lt;3&gt;, C&lt;4&gt; and C&lt;5&gt; UUIDs. But
+version C&lt;1&gt; UUIDs are based on the previously generated UUID which is
+remembered in the UUID context of the API. Option B&lt;-1&gt; deletes the
+remembered UUID on each iteration.
+
+=item B&lt;-F&gt; I&lt;format&gt;
+
+Representation format for importing or exporting an UUID. The
+following (case insensitive) format identifiers are currently recognized:
+
+=over 4
+
+=item C&lt;BIN&gt; (binary representation)
+
+This is the raw 128 bit network byte order binary representation of a
+UUID. Example is the octet stream C&lt;0xF8 0x1D 0x4F 0xAE 0x7D 0xEC 0x11
+0xD0 0xA7 0x65 0x00 0xA0 0xC9 0x1E 0x6B 0xF6&gt;.
+
+=item C&lt;STR&gt; (string representation)
+
+This is the 36 character hexadecimal ASCII string representation of a
+UUID. Example is the string &quot;C&lt;f81d4fae-7dec-11d0-a765-00a0c91e6bf6&gt;&quot;.
+
+=item C&lt;SIV&gt; (single integer value representation)
+
+This is the maximum 39 character long single integer
+value representation of a UUID. Example is the string
+&quot;C&lt;329800735698586629295641978511506172918&gt;&quot;.
+
+=back
+
+=item B&lt;-o&gt; I&lt;filename&gt;
+
+Write output to I&lt;filename&gt; instead of to F&lt;stdout&gt;.
+
+=item B&lt;-d&gt;
+
+Decode a given UUID (given as a command line argument or if the command
+line argument is &quot;C&lt;-&gt;&quot; the UUID is read from F&lt;stdin&gt;) and dump textual
+information about the UUID.
+
+=back
+
+=head1 EXAMPLES
+
+ # generate DCE 1.1 v1 UUID (time and node based)
+ $ uuid -v1
+ 01c47915-4777-11d8-bc70-0090272ff725
+
+ # decode and dump DCE 1.1 v1 UUID (time and node based)
+ $ uuid -d 01c47915-4777-11d8-bc70-0090272ff725
+ encode: STR:     01c47915-4777-11d8-bc70-0090272ff725
+         SIV:     2349374037528578887923094374772111141
+ decode: variant: DCE 1.1, ISO/IEC 11578:1996
+         version: 1 (time and node based)
+         content: time:  2004-01-15 16:22:26.376322.1 UTC
+                  clock: 15472 (usually random)
+                  node:  00:90:27:2f:f7:25 (global unicast)
+
+ # generate DCE 1.1 v3 UUID (name based)
+ $ uuid -v3 ns:URL http://www.ossp.org/
+ 02d9e6d5-9467-382e-8f9b-9300a64ac3cd
+
+ # decode and dump DCE 1.1 v3 UUID (name based)
+ $ uuid -d 02d9e6d5-9467-382e-8f9b-9300a64ac3cd
+ encode: STR:     02d9e6d5-9467-382e-8f9b-9300a64ac3cd
+         SIV:     3789866285607910888100818383505376205
+ decode: variant: DCE 1.1, ISO/IEC 11578:1996
+         version: 3 (name based, MD5)
+         content: 02:D9:E6:D5:94:67:08:2E:0F:9B:93:00:A6:4A:C3:CD
+                  (not decipherable: MD5 message digest only)
+
+ # generate DCE 1.1 v4 UUID 4 (random data based)
+ $ uuid -v4
+ eb424026-6f54-4ef8-a4d0-bb658a1fc6cf
+
+ # decode and dump DCE 1.1 v4 UUID 4 (random data based)
+ $ uuid -d eb424026-6f54-4ef8-a4d0-bb658a1fc6cf
+ encode: STR:     eb424026-6f54-4ef8-a4d0-bb658a1fc6cf
+         SIV:     312712571721458096795100956955942831823
+ decode: variant: DCE 1.1, ISO/IEC 11578:1996
+         version: 4 (random data based)
+         content: EB:42:40:26:6F:54:0E:F8:24:D0:BB:65:8A:1F:C6:CF
+                  (no semantics: random data only)
+
+=head1 SEE ALSO
+
+uuid(3), OSSP::uuid(3).
+
+=cut
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_dcec"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_dce.c (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_dce.c                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_dce.c        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,294 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid_dce.c: DCE 1.1 compatibility API implementation
+*/
+
+/* include DCE 1.1 API */
+#define uuid_t uuid_dce_t
+#include &quot;uuid_dce.h&quot;
+#undef uuid_t
+#undef uuid_create
+#undef uuid_create_nil
+#undef uuid_is_nil
+#undef uuid_compare
+#undef uuid_equal
+#undef uuid_from_string
+#undef uuid_to_string
+#undef uuid_hash
+
+/* include regular API */
+#include &quot;uuid.h&quot;
+
+/* helper macro */
+#define LEAVE /*lint -save -e801*/ goto leave /*lint -restore*/
+
+/* create a UUID (v1 only) */
+void uuid_dce_create(uuid_dce_t *uuid_dce, int *status)
+{
+    uuid_t *uuid;
+    size_t len;
+    void *vp;
+
+    /* initialize status */
+    if (status != NULL)
+        *status = uuid_s_error;
+
+    /* sanity check argument(s) */
+    if (uuid_dce == NULL)
+        return;
+
+    /* create UUID and export as binary representation */
+    if (uuid_create(&amp;uuid) != UUID_RC_OK)
+        return;
+    if (uuid_make(uuid, UUID_MAKE_V1) != UUID_RC_OK) {
+        uuid_destroy(uuid);
+        return;
+    }
+    vp  = uuid_dce;
+    len = UUID_LEN_BIN;
+    if (uuid_export(uuid, UUID_FMT_BIN, &amp;vp, &amp;len) != UUID_RC_OK) {
+        uuid_destroy(uuid);
+        return;
+    }
+    uuid_destroy(uuid);
+
+    /* return successfully */
+    if (status != NULL)
+        *status = uuid_s_ok;
+    return;
+}
+
+/* create a Nil UUID */
+void uuid_dce_create_nil(uuid_dce_t *uuid_dce, int *status)
+{
+    /* initialize status */
+    if (status != NULL)
+        *status = uuid_s_error;
+
+    /* sanity check argument(s) */
+    if (uuid_dce == NULL)
+        return;
+
+    /* short-circuit implementation, because Nil UUID is trivial to
+       create, so no need to use regular OSSP uuid API */
+    memset(uuid_dce, 0, UUID_LEN_BIN);
+
+    /* return successfully */
+    if (status != NULL)
+        *status = uuid_s_ok;
+    return;
+}
+
+/* check whether it is Nil UUID */
+int uuid_dce_is_nil(uuid_dce_t *uuid_dce, int *status)
+{
+    int i;
+    int result;
+    unsigned char *ucp;
+
+    /* initialize status */
+    if (status != NULL)
+        *status = uuid_s_error;
+
+    /* sanity check argument(s) */
+    if (uuid_dce == NULL)
+        return 0;
+
+    /* short-circuit implementation, because Nil UUID is trivial to
+       check, so no need to use regular OSSP uuid API */
+    result = 1;
+    ucp = (unsigned char *)uuid_dce;
+    for (i = 0; i &lt; UUID_LEN_BIN; i++) {
+        if (ucp[i] != '\0') {
+            result = 0;
+            break;
+        }
+    }
+
+    /* return successfully with result */
+    if (status != NULL)
+        *status = uuid_s_ok;
+    return result;
+}
+
+/* compare two UUIDs */
+int uuid_dce_compare(uuid_dce_t *uuid_dce1, uuid_dce_t *uuid_dce2, int *status)
+{
+    uuid_t *uuid1 = NULL;
+    uuid_t *uuid2 = NULL;
+    int result = 0;
+
+    /* initialize status */
+    if (status != NULL)
+        *status = uuid_s_error;
+
+    /* sanity check argument(s) */
+    if (uuid_dce1 == NULL || uuid_dce2 == NULL)
+        return 0;
+
+    /* import both UUID binary representations and compare them */
+    if (uuid_create(&amp;uuid1) != UUID_RC_OK)
+        LEAVE;
+    if (uuid_create(&amp;uuid2) != UUID_RC_OK)
+        LEAVE;
+    if (uuid_import(uuid1, UUID_FMT_BIN, uuid_dce1, UUID_LEN_BIN) != UUID_RC_OK)
+        LEAVE;
+    if (uuid_import(uuid2, UUID_FMT_BIN, uuid_dce2, UUID_LEN_BIN) != UUID_RC_OK)
+        LEAVE;
+    if (uuid_compare(uuid1, uuid2, &amp;result) != UUID_RC_OK)
+        LEAVE;
+
+    /* indicate successful operation */
+    if (status != NULL)
+        *status = uuid_s_ok;
+
+    /* cleanup and return */
+    leave:
+    if (uuid1 != NULL)
+        uuid_destroy(uuid1);
+    if (uuid2 != NULL)
+        uuid_destroy(uuid2);
+    return result;
+}
+
+/* compare two UUIDs (equality only) */
+int uuid_dce_equal(uuid_dce_t *uuid_dce1, uuid_dce_t *uuid_dce2, int *status)
+{
+    /* initialize status */
+    if (status != NULL)
+        *status = uuid_s_error;
+
+    /* sanity check argument(s) */
+    if (uuid_dce1 == NULL || uuid_dce2 == NULL)
+        return 0;
+
+    /* pass through to generic compare function */
+    return (uuid_dce_compare(uuid_dce1, uuid_dce2, status) == 0 ? 1 : 0);
+}
+
+/* import UUID from string representation */
+void uuid_dce_from_string(const char *str, uuid_dce_t *uuid_dce, int *status)
+{
+    uuid_t *uuid = NULL;
+    size_t len;
+    void *vp;
+
+    /* initialize status */
+    if (status != NULL)
+        *status = uuid_s_error;
+
+    /* sanity check argument(s) */
+    if (str == NULL || uuid_dce == NULL)
+        return;
+
+    /* import string representation and export binary representation */
+    if (uuid_create(&amp;uuid) != UUID_RC_OK)
+        LEAVE;
+    if (uuid_import(uuid, UUID_FMT_STR, str, UUID_LEN_STR) != UUID_RC_OK)
+        LEAVE;
+    vp  = uuid_dce;
+    len = UUID_LEN_BIN;
+    if (uuid_export(uuid, UUID_FMT_BIN, &amp;vp, &amp;len) != UUID_RC_OK)
+        LEAVE;
+
+    /* indicate successful operation */
+    if (status != NULL)
+        *status = uuid_s_ok;
+
+    /* cleanup and return */
+    leave:
+    if (uuid != NULL)
+        uuid_destroy(uuid);
+    return;
+}
+
+/* export UUID to string representation */
+void uuid_dce_to_string(uuid_dce_t *uuid_dce, char **str, int *status)
+{
+    uuid_t *uuid = NULL;
+    size_t len;
+    void *vp;
+
+    /* initialize status */
+    if (status != NULL)
+        *status = uuid_s_error;
+
+    /* sanity check argument(s) */
+    if (str == NULL || uuid_dce == NULL)
+        return;
+
+    /* import binary representation and export string representation */
+    if (uuid_create(&amp;uuid) != UUID_RC_OK)
+        LEAVE;
+    if (uuid_import(uuid, UUID_FMT_BIN, uuid_dce, UUID_LEN_BIN) != UUID_RC_OK)
+        LEAVE;
+    vp  = str;
+    len = UUID_LEN_STR;
+    if (uuid_export(uuid, UUID_FMT_STR, &amp;vp, &amp;len) != UUID_RC_OK)
+        LEAVE;
+
+    /* indicate successful operation */
+    if (status != NULL)
+        *status = uuid_s_ok;
+
+    /* cleanup and return */
+    leave:
+    if (uuid != NULL)
+        uuid_destroy(uuid);
+    return;
+}
+
+/* export UUID into hash value */
+unsigned int uuid_dce_hash(uuid_dce_t *uuid_dce, int *status)
+{
+    int i;
+    unsigned char *ucp;
+    unsigned int hash;
+
+    /* initialize status */
+    if (status != NULL)
+        *status = uuid_s_error;
+
+    /* sanity check argument(s) */
+    if (uuid_dce == NULL)
+        return 0;
+
+    /* generate a hash value
+       (DCE 1.1 actually requires 16-bit only) */
+    hash = 0;
+    ucp = (unsigned char *)uuid_dce;
+    for (i = UUID_LEN_BIN-1; i &gt;= 0; i--) {
+        hash &lt;&lt;= 8;
+        hash |= ucp[i];
+    }
+
+    /* return successfully */
+    if (status != NULL)
+        *status = uuid_s_ok;
+    return hash;
+}
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_dceh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_dce.h (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_dce.h                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_dce.h        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,88 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid_dce.h: DCE 1.1 compatibility API definition
+*/
+
+#ifndef __UUID_DCE_H___
+#define __UUID_DCE_H___
+
+/* sanity check usage */
+#ifdef __UUID_H__
+#error the regular OSSP uuid API and the DCE 1.1 backward compatibility API are mutually exclusive -- you cannot use them at the same time.
+#endif
+
+/* resolve namespace conflicts (at linking level) with regular OSSP uuid API */
+#define uuid_create      uuid_dce_create
+#define uuid_create_nil  uuid_dce_create_nil
+#define uuid_is_nil      uuid_dce_is_nil
+#define uuid_compare     uuid_dce_compare
+#define uuid_equal       uuid_dce_equal
+#define uuid_from_string uuid_dce_from_string
+#define uuid_to_string   uuid_dce_to_string
+#define uuid_hash        uuid_dce_hash
+
+/* DCE 1.1 uuid_t type */
+typedef struct {
+#if 0
+    /* stricter but unportable version */
+    uuid_uint32_t   time_low;
+    uuid_uint16_t   time_mid;
+    uuid_uint16_t   time_hi_and_version;
+    uuid_uint8_t    clock_seq_hi_and_reserved;
+    uuid_uint8_t    clock_seq_low;
+    uuid_uint8_t    node[6];
+#else
+    /* sufficient and portable version */
+    unsigned char   data[16];
+#endif
+} uuid_t;
+typedef uuid_t *uuid_p_t;
+
+/* DCE 1.1 uuid_vector_t type */
+typedef struct {
+    unsigned int    count;
+    uuid_t         *uuid[1];
+} uuid_vector_t;
+
+/* DCE 1.1 UUID API status codes */
+enum {
+    uuid_s_ok = 0,     /* standardized */
+    uuid_s_error = 1   /* implementation specific */
+};
+
+/* DCE 1.1 UUID API functions */
+extern void          uuid_create      (uuid_t *,               int *);
+extern void          uuid_create_nil  (uuid_t *,               int *);
+extern int           uuid_is_nil      (uuid_t *,               int *);
+extern int           uuid_compare     (uuid_t *, uuid_t *,     int *);
+extern int           uuid_equal       (uuid_t *, uuid_t *,     int *);
+extern void          uuid_from_string (const char *, uuid_t *, int *);
+extern void          uuid_to_string   (uuid_t *,     char **,  int *);
+extern unsigned int  uuid_hash        (uuid_t *,               int *);
+
+#endif /* __UUID_DCE_H___ */
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_macc"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_mac.c (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_mac.c                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_mac.c        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,183 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid_mac.c: Media Access Control (MAC) resolver implementation
+*/
+
+/* own headers (part (1/2) */
+#include &quot;uuid_ac.h&quot;
+
+/* system headers */
+#include &lt;stdio.h&gt;
+#include &lt;stdlib.h&gt;
+#include &lt;string.h&gt;
+#include &lt;unistd.h&gt;
+#include &lt;fcntl.h&gt;
+#include &lt;time.h&gt;
+#ifdef HAVE_SYS_TIME_H
+#include &lt;sys/time.h&gt;
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include &lt;sys/types.h&gt;
+#endif
+#ifdef HAVE_SYS_PARAM_H
+#include &lt;sys/param.h&gt;
+#endif
+#ifdef HAVE_SYS_IOCTL_H
+#include &lt;sys/ioctl.h&gt;
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#include &lt;sys/socket.h&gt;
+#endif
+#ifdef HAVE_SYS_SOCKIO_H
+#include &lt;sys/sockio.h&gt;
+#endif
+#ifdef HAVE_NETDB_H
+#include &lt;netdb.h&gt;
+#endif
+#ifdef HAVE_NET_IF_H
+#include &lt;net/if.h&gt;
+#endif
+#ifdef HAVE_NET_IF_DL_H
+#include &lt;net/if_dl.h&gt;
+#endif
+#ifdef HAVE_NET_IF_ARP_H
+#include &lt;net/if_arp.h&gt;
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include &lt;netinet/in.h&gt;
+#endif
+#ifdef HAVE_ARPA_INET_H
+#include &lt;arpa/inet.h&gt;
+#endif
+#ifdef HAVE_IFADDRS_H
+#include &lt;ifaddrs.h&gt;
+#endif
+
+/* own headers (part (1/2) */
+#include &quot;uuid_mac.h&quot;
+
+#ifndef FALSE
+#define FALSE 0
+#endif
+#ifndef TRUE
+#define TRUE (/*lint -save -e506*/ !FALSE /*lint -restore*/)
+#endif
+
+/* return the Media Access Control (MAC) address of
+   the FIRST network interface card (NIC) */
+int mac_address(unsigned char *data_ptr, size_t data_len)
+{
+    /* sanity check arguments */
+    if (data_ptr == NULL || data_len &lt; MAC_LEN)
+        return FALSE;
+
+#if defined(HAVE_IFADDRS_H) &amp;&amp; defined(HAVE_NET_IF_DL_H) &amp;&amp; defined(HAVE_GETIFADDRS)
+    /* use getifaddrs(3) on BSD class platforms (xxxBSD, MacOS X, etc) */
+    {
+        struct ifaddrs *ifap;
+        struct ifaddrs *ifap_head;
+        const struct sockaddr_dl *sdl;
+        unsigned char *ucp;
+        int i;
+
+        if (getifaddrs(&amp;ifap_head) &lt; 0)
+            return FALSE;
+        for (ifap = ifap_head; ifap != NULL; ifap = ifap-&gt;ifa_next) {
+            if (ifap-&gt;ifa_addr != NULL &amp;&amp; ifap-&gt;ifa_addr-&gt;sa_family == AF_LINK) {
+                sdl = (const struct sockaddr_dl *)(void *)ifap-&gt;ifa_addr;
+                ucp = (unsigned char *)(sdl-&gt;sdl_data + sdl-&gt;sdl_nlen);
+                if (sdl-&gt;sdl_alen &gt; 0) {
+                    for (i = 0; i &lt; MAC_LEN &amp;&amp; i &lt; sdl-&gt;sdl_alen; i++, ucp++)
+                        data_ptr[i] = (unsigned char)(*ucp &amp; 0xff);
+                    freeifaddrs(ifap_head);
+                    return TRUE;
+                }
+            }
+        }
+        freeifaddrs(ifap_head);
+    }
+#endif
+
+#if defined(HAVE_NET_IF_H) &amp;&amp; defined(SIOCGIFHWADDR)
+    /* use SIOCGIFHWADDR ioctl(2) on Linux class platforms */
+    {
+        struct ifreq ifr;
+        struct sockaddr *sa;
+        int s;
+        int i;
+
+        if ((s = socket(PF_INET, SOCK_DGRAM, 0)) &lt; 0)
+            return FALSE;
+        sprintf(ifr.ifr_name, &quot;eth0&quot;);
+        if (ioctl(s, SIOCGIFHWADDR, &amp;ifr) &lt; 0) {
+            close(s);
+            return FALSE;
+        }
+        sa = (struct sockaddr *)&amp;ifr.ifr_addr;
+        for (i = 0; i &lt; MAC_LEN; i++)
+            data_ptr[i] = (unsigned char)(sa-&gt;sa_data[i] &amp; 0xff);
+        close(s);
+        return TRUE;
+    }
+#endif
+
+#if defined(SIOCGARP)
+    /* use SIOCGARP ioctl(2) on SVR4 class platforms (Solaris, etc) */
+    {
+        char hostname[MAXHOSTNAMELEN];
+        struct hostent *he;
+        struct arpreq ar;
+        struct sockaddr_in *sa;
+        int s;
+        int i;
+
+        if (gethostname(hostname, sizeof(hostname)) &lt; 0)
+            return FALSE;
+        if ((he = gethostbyname(hostname)) == NULL)
+            return FALSE;
+        if ((s = socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP)) &lt; 0)
+            return FALSE;
+        memset(&amp;ar, 0, sizeof(ar));
+        sa = (struct sockaddr_in *)((void *)&amp;(ar.arp_pa));
+        sa-&gt;sin_family = AF_INET;
+        memcpy(&amp;(sa-&gt;sin_addr), *(he-&gt;h_addr_list), sizeof(struct in_addr));
+        if (ioctl(s, SIOCGARP, &amp;ar) &lt; 0) {
+            close(s);
+            return FALSE;
+        }
+        close(s);
+        if (!(ar.arp_flags &amp; ATF_COM))
+            return FALSE;
+        for (i = 0; i &lt; MAC_LEN; i++)
+            data_ptr[i] = (unsigned char)(ar.arp_ha.sa_data[i] &amp; 0xff);
+        return TRUE;
+    }
+#endif
+
+    return FALSE;
+}
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_mach"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_mac.h (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_mac.h                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_mac.h        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,54 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid_mac.h: Media Access Control (MAC) resolver API definition
+*/
+
+#ifndef __UUID_MAC_H__
+#define __UUID_MAC_H__
+
+#include &lt;string.h&gt; /* size_t */
+
+#define MAC_PREFIX uuid_
+
+/* embedding support */
+#ifdef MAC_PREFIX
+#if defined(__STDC__) || defined(__cplusplus)
+#define __MAC_CONCAT(x,y) x ## y
+#define MAC_CONCAT(x,y) __MAC_CONCAT(x,y)
+#else
+#define __MAC_CONCAT(x) x
+#define MAC_CONCAT(x,y) __MAC_CONCAT(x)y
+#endif
+#define mac_address MAC_CONCAT(MAC_PREFIX,mac_address)
+#endif
+
+#define MAC_LEN 6
+
+extern int mac_address(unsigned char *_data_ptr, size_t _data_len);
+
+#endif /* __UUID_MAC_H__ */
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_md5c"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_md5.c (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_md5.c                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_md5.c        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,471 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid_md5.c: MD5 API implementation
+*/
+
+/* own headers (part 1/2) */
+#include &quot;uuid_ac.h&quot;
+
+/* system headers */
+#include &lt;stdlib.h&gt;
+#include &lt;string.h&gt;
+
+/* own headers (part 2/2) */
+#include &quot;uuid_md5.h&quot;
+
+/*
+ * This is a RFC 1321 compliant Message Digest 5 (MD5) algorithm
+ * implementation. It is directly derived from the RSA code published in
+ * RFC 1321 with just the following functionality preserving changes:
+ * - converted function definitions from K&amp;R to ANSI C
+ * - included contents of the &quot;global.h&quot; and &quot;md5.h&quot; headers
+ * - moved the SXX defines into the MD5Transform function
+ * - replaced MD5_memcpy() with memcpy(3) and MD5_memset() with memset(3)
+ * - renamed &quot;index&quot; variables to &quot;idx&quot; to avoid namespace conflicts
+ * - reformatted C style to conform with OSSP C style
+ * - added own OSSP style frontend API
+ */
+
+/*
+** ==== BEGIN RFC 1321 CODE ====
+*/
+
+/*
+ * RSA Data Security, Inc., MD5 message-digest algorithm
+ * Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991.
+ * All rights reserved.
+ *
+ * License to copy and use this software is granted provided that it
+ * is identified as the &quot;RSA Data Security, Inc. MD5 Message-Digest
+ * Algorithm&quot; in all material mentioning or referencing this software
+ * or this function.
+ *
+ * License is also granted to make and use derivative works provided
+ * that such works are identified as &quot;derived from the RSA Data
+ * Security, Inc. MD5 Message-Digest Algorithm&quot; in all material
+ * mentioning or referencing the derived work.
+ *
+ * RSA Data Security, Inc. makes no representations concerning either
+ * the merchantability of this software or the suitability of this
+ * software for any particular purpose. It is provided &quot;as is&quot;
+ * without express or implied warranty of any kind.
+ *
+ * These notices must be retained in any copies of any part of this
+ * documentation and/or software.
+ */
+
+/* POINTER defines a generic pointer type */
+typedef unsigned char *POINTER;
+
+/* UINT4 defines a four byte word */
+#if SIZEOF_UNSIGNED_SHORT       == 4
+typedef unsigned short int     UINT4;
+#elif SIZEOF_UNSIGNED_INT       == 4
+typedef unsigned int           UINT4;
+#elif SIZEOF_UNSIGNED_LONG      == 4
+typedef unsigned long int      UINT4;
+#elif SIZEOF_UNSIGNED_LONG_LONG == 4
+typedef unsigned long long int UINT4;
+#else
+#error ERROR: unable to determine UINT4 type (four byte word)
+#endif
+
+/* MD5 context. */
+typedef struct {
+  UINT4 state[4];                                   /* state (ABCD) */
+  UINT4 count[2];        /* number of bits, modulo 2^64 (lsb first) */
+  unsigned char buffer[64];                         /* input buffer */
+} MD5_CTX;
+
+/* prototypes for internal functions */
+static void MD5Init      (MD5_CTX *_ctx);
+static void MD5Update    (MD5_CTX *_ctx, unsigned char *, unsigned int);
+static void MD5Final     (unsigned char [], MD5_CTX *);
+static void MD5Transform (UINT4 [], unsigned char []);
+static void Encode       (unsigned char *, UINT4 *, unsigned int);
+static void Decode       (UINT4 *, unsigned char *, unsigned int);
+
+/* finalization padding */
+static unsigned char PADDING[64] = {
+  0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+};
+
+/* F, G, H and I are basic MD5 functions. */
+#define F(x, y, z) (((x) &amp; (y)) | ((~x) &amp; (z)))
+#define G(x, y, z) (((x) &amp; (z)) | ((y) &amp; (~z)))
+#define H(x, y, z) ((x) ^ (y) ^ (z))
+#define I(x, y, z) ((y) ^ ((x) | (~z)))
+
+/* ROTATE_LEFT rotates x left n bits. */
+#define ROTATE_LEFT(x, n) (((x) &lt;&lt; (n)) | ((x) &gt;&gt; (32-(n))))
+
+/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
+   Rotation is separate from addition to prevent recomputation. */
+#define FF(a, b, c, d, x, s, ac) { \
+ (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \
+ (a) = ROTATE_LEFT ((a), (s)); \
+ (a) += (b); \
+}
+#define GG(a, b, c, d, x, s, ac) { \
+ (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \
+ (a) = ROTATE_LEFT ((a), (s)); \
+ (a) += (b); \
+}
+#define HH(a, b, c, d, x, s, ac) { \
+ (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \
+ (a) = ROTATE_LEFT ((a), (s)); \
+ (a) += (b); \
+}
+#define II(a, b, c, d, x, s, ac) { \
+ (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \
+ (a) = ROTATE_LEFT ((a), (s)); \
+ (a) += (b); \
+}
+
+/* MD5 initialization. Begins an MD5 operation, writing a new context. */
+static void MD5Init(
+    MD5_CTX *context)
+{
+    context-&gt;count[0] = context-&gt;count[1] = 0;
+
+    /* Load magic initialization constants. */
+    context-&gt;state[0] = 0x67452301;
+    context-&gt;state[1] = 0xefcdab89;
+    context-&gt;state[2] = 0x98badcfe;
+    context-&gt;state[3] = 0x10325476;
+    return;
+}
+
+/* MD5 block update operation. Continues an MD5 message-digest
+   operation, processing another message block, and updating the
+   context. */
+static void MD5Update(
+    MD5_CTX *context,                                        /* context */
+    unsigned char *input,                                /* input block */
+    unsigned int inputLen)                     /* length of input block */
+{
+    unsigned int i, idx, partLen;
+
+    /* Compute number of bytes mod 64 */
+    idx = (unsigned int)((context-&gt;count[0] &gt;&gt; 3) &amp; 0x3F);
+
+    /* Update number of bits */
+    if ((context-&gt;count[0] += ((UINT4)inputLen &lt;&lt; 3)) &lt; ((UINT4)inputLen &lt;&lt; 3))
+        context-&gt;count[1]++;
+    context-&gt;count[1] += ((UINT4)inputLen &gt;&gt; 29);
+
+    partLen = (unsigned int)64 - idx;
+
+    /* Transform as many times as possible.  */
+    if (inputLen &gt;= partLen) {
+        memcpy((POINTER)&amp;context-&gt;buffer[idx], (POINTER)input, (size_t)partLen);
+        MD5Transform(context-&gt;state, context-&gt;buffer);
+        for (i = partLen; i + 63 &lt; inputLen; i += 64)
+            MD5Transform(context-&gt;state, &amp;input[i]);
+        idx = 0;
+    }
+    else
+        i = 0;
+
+    /* Buffer remaining input */
+    memcpy((POINTER)&amp;context-&gt;buffer[idx], (POINTER)&amp;input[i], (size_t)(inputLen - i));
+}
+
+/* MD5 finalization. Ends an MD5 message-digest operation, writing the
+   the message digest and zeroizing the context. */
+static void MD5Final(
+    unsigned char digest[],                                 /* message digest */
+    MD5_CTX *context)                                       /* context */
+{
+    unsigned char bits[8];
+    unsigned int idx, padLen;
+
+    /* Save number of bits */
+    Encode(bits, context-&gt;count, 8);
+
+    /* Pad out to 56 mod 64. */
+    idx = (unsigned int)((context-&gt;count[0] &gt;&gt; 3) &amp; 0x3f);
+    padLen = (idx &lt; 56) ? ((unsigned int)56 - idx) : ((unsigned int)120 - idx);
+    MD5Update(context, PADDING, padLen);
+
+    /* Append length (before padding) */
+    MD5Update(context, bits, 8);
+
+    /* Store state in digest */
+    Encode(digest, context-&gt;state, 16);
+
+    /* Zeroize sensitive information. */
+    memset((POINTER)context, 0, sizeof(*context));
+}
+
+/* MD5 basic transformation. Transforms state based on block. */
+static void MD5Transform(
+    UINT4 state[],
+    unsigned char block[])
+{
+    UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16];
+
+    Decode(x, block, 64);
+
+    /* Round 1 */
+#define S11 7
+#define S12 12
+#define S13 17
+#define S14 22
+    FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
+    FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
+    FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
+    FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
+    FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
+    FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
+    FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
+    FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
+    FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
+    FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
+    FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
+    FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
+    FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
+    FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
+    FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
+    FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
+
+   /* Round 2 */
+#define S21 5
+#define S22 9
+#define S23 14
+#define S24 20
+    GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
+    GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
+    GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
+    GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
+    GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
+    GG (d, a, b, c, x[10], S22,  0x2441453); /* 22 */
+    GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
+    GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
+    GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
+    GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
+    GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
+    GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
+    GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
+    GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
+    GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
+    GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
+
+    /* Round 3 */
+#define S31 4
+#define S32 11
+#define S33 16
+#define S34 23
+    HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
+    HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
+    HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
+    HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
+    HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
+    HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
+    HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
+    HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
+    HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
+    HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
+    HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
+    HH (b, c, d, a, x[ 6], S34,  0x4881d05); /* 44 */
+    HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
+    HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
+    HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
+    HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
+
+    /* Round 4 */
+#define S41 6
+#define S42 10
+#define S43 15
+#define S44 21
+    II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
+    II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
+    II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
+    II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
+    II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
+    II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
+    II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
+    II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
+    II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
+    II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
+    II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
+    II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
+    II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
+    II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
+    II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
+    II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
+
+    state[0] += a;
+    state[1] += b;
+    state[2] += c;
+    state[3] += d;
+
+    /* Zeroize sensitive information. */
+    memset((POINTER)x, 0, sizeof(x));
+}
+
+/* Encodes input (UINT4) into output (unsigned char).
+   Assumes len is a multiple of 4. */
+static void Encode(
+    unsigned char *output,
+    UINT4 *input,
+    unsigned int len)
+{
+    unsigned int i, j;
+
+    for (i = 0, j = 0; j &lt; len; i++, j += 4) {
+        output[j]   = (unsigned char)( input[i]        &amp; 0xff);
+        output[j+1] = (unsigned char)((input[i] &gt;&gt; 8)  &amp; 0xff);
+        output[j+2] = (unsigned char)((input[i] &gt;&gt; 16) &amp; 0xff);
+        output[j+3] = (unsigned char)((input[i] &gt;&gt; 24) &amp; 0xff);
+    }
+    return;
+}
+
+/* Decodes input (unsigned char) into output (UINT4).
+   Assumes len is a multiple of 4. */
+static void Decode(
+    UINT4 *output,
+    unsigned char *input,
+    unsigned int len)
+{
+    unsigned int i, j;
+
+    for (i = 0, j = 0; j &lt; len; i++, j += 4)
+        output[i] =   ( (UINT4)input[j])
+                    | (((UINT4)input[j+1]) &lt;&lt; 8 )
+                    | (((UINT4)input[j+2]) &lt;&lt; 16)
+                    | (((UINT4)input[j+3]) &lt;&lt; 24);
+    return;
+}
+
+/*
+** ==== END RFC 1321 CODE ====
+*/
+
+struct md5_st {
+    MD5_CTX ctx;
+};
+
+md5_rc_t md5_create(md5_t **md5)
+{
+    if (md5 == NULL)
+        return MD5_RC_ARG;
+    if ((*md5 = (md5_t *)malloc(sizeof(md5_t))) == NULL)
+        return MD5_RC_MEM;
+    MD5Init(&amp;((*md5)-&gt;ctx));
+    return MD5_RC_OK;
+}
+
+md5_rc_t md5_init(md5_t *md5)
+{
+    if (md5 == NULL)
+        return MD5_RC_ARG;
+    MD5Init(&amp;(md5-&gt;ctx));
+    return MD5_RC_OK;
+}
+
+md5_rc_t md5_update(md5_t *md5, const void *data_ptr, size_t data_len)
+{
+    if (md5 == NULL)
+        return MD5_RC_ARG;
+    MD5Update(&amp;(md5-&gt;ctx), (unsigned char *)data_ptr, (unsigned int)data_len);
+    return MD5_RC_OK;
+}
+
+md5_rc_t md5_store(md5_t *md5, void **data_ptr, size_t *data_len)
+{
+    MD5_CTX ctx;
+
+    if (md5 == NULL || data_ptr == NULL)
+        return MD5_RC_ARG;
+    if (*data_ptr == NULL) {
+        if ((*data_ptr = malloc(MD5_LEN_BIN)) == NULL)
+            return MD5_RC_MEM;
+        if (data_len != NULL)
+            *data_len = MD5_LEN_BIN;
+    }
+    else {
+        if (data_len != NULL) {
+            if (*data_len &lt; MD5_LEN_BIN)
+                return MD5_RC_MEM;
+            *data_len = MD5_LEN_BIN;
+        }
+    }
+    memcpy((void *)(&amp;ctx), (void *)(&amp;(md5-&gt;ctx)), sizeof(MD5_CTX));
+    MD5Final((unsigned char *)(*data_ptr), &amp;(ctx));
+    return MD5_RC_OK;
+}
+
+md5_rc_t md5_format(md5_t *md5, char **data_ptr, size_t *data_len)
+{
+    static const char hex[] = &quot;0123456789abcdef&quot;;
+    unsigned char buf[MD5_LEN_BIN];
+    unsigned char *bufptr;
+    size_t buflen;
+    md5_rc_t rc;
+    int i;
+
+    if (md5 == NULL || data_ptr == NULL)
+        return MD5_RC_ARG;
+    if (*data_ptr == NULL) {
+        if ((*data_ptr = (char *)malloc(MD5_LEN_STR+1)) == NULL)
+            return MD5_RC_MEM;
+        if (data_len != NULL)
+            *data_len = MD5_LEN_STR+1;
+    }
+    else {
+        if (data_len != NULL) {
+            if (*data_len &lt; MD5_LEN_STR+1)
+                return MD5_RC_MEM;
+            *data_len = MD5_LEN_STR+1;
+        }
+    }
+
+    bufptr = buf;
+    buflen = sizeof(buf);
+    if ((rc = md5_store(md5, (void **)((void *)&amp;bufptr), &amp;buflen)) != MD5_RC_OK)
+        return rc;
+
+    for (i = 0; i &lt; (int)buflen; i++) {
+            (*data_ptr)[(i*2)+0] = hex[(int)(bufptr[i] &gt;&gt; 4)];
+            (*data_ptr)[(i*2)+1] = hex[(int)(bufptr[i] &amp; 0x0f)];
+    }
+    (*data_ptr)[(i*2)] = '\0';
+    return MD5_RC_OK;
+}
+
+md5_rc_t md5_destroy(md5_t *md5)
+{
+    if (md5 == NULL)
+        return MD5_RC_ARG;
+    free(md5);
+    return MD5_RC_OK;
+}
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_md5h"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_md5.h (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_md5.h                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_md5.h        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid_md5.h: MD5 API definition
+*/
+
+#ifndef __MD5_H___
+#define __MD5_H___
+
+#include &lt;string.h&gt; /* size_t */
+
+#define MD5_PREFIX uuid_
+
+/* embedding support */
+#ifdef MD5_PREFIX
+#if defined(__STDC__) || defined(__cplusplus)
+#define __MD5_CONCAT(x,y) x ## y
+#define MD5_CONCAT(x,y) __MD5_CONCAT(x,y)
+#else
+#define __MD5_CONCAT(x) x
+#define MD5_CONCAT(x,y) __MD5_CONCAT(x)y
+#endif
+#define md5_st      MD5_CONCAT(MD5_PREFIX,md5_st)
+#define md5_t       MD5_CONCAT(MD5_PREFIX,md5_t)
+#define md5_create  MD5_CONCAT(MD5_PREFIX,md5_create)
+#define md5_init    MD5_CONCAT(MD5_PREFIX,md5_init)
+#define md5_update  MD5_CONCAT(MD5_PREFIX,md5_update)
+#define md5_store   MD5_CONCAT(MD5_PREFIX,md5_store)
+#define md5_format  MD5_CONCAT(MD5_PREFIX,md5_format)
+#define md5_destroy MD5_CONCAT(MD5_PREFIX,md5_destroy)
+#endif
+
+struct md5_st;
+typedef struct md5_st md5_t;
+
+#define MD5_LEN_BIN 16
+#define MD5_LEN_STR 32
+
+typedef enum {
+    MD5_RC_OK  = 0,
+    MD5_RC_ARG = 1,
+    MD5_RC_MEM = 2
+} md5_rc_t;
+
+extern md5_rc_t md5_create  (md5_t **md5);
+extern md5_rc_t md5_init    (md5_t  *md5);
+extern md5_rc_t md5_update  (md5_t  *md5, const void  *data_ptr, size_t  data_len);
+extern md5_rc_t md5_store   (md5_t  *md5,       void **data_ptr, size_t *data_len);
+extern md5_rc_t md5_format  (md5_t  *md5,       char **data_ptr, size_t *data_len);
+extern md5_rc_t md5_destroy (md5_t  *md5);
+
+#endif /* __MD5_H___ */
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_prngc"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_prng.c (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_prng.c                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_prng.c        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,198 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid_prng.c: PRNG API implementation
+*/
+
+/* own headers (part 1/2) */
+#include &quot;uuid_ac.h&quot;
+
+/* system headers */
+#include &lt;stdlib.h&gt;
+#include &lt;string.h&gt;
+#include &lt;unistd.h&gt;
+#include &lt;time.h&gt;
+#include &lt;sys/time.h&gt;
+#include &lt;fcntl.h&gt;
+#if defined(WIN32)
+#define WINVER 0x0500
+#include &lt;windows.h&gt;
+#include &lt;wincrypt.h&gt;
+#endif
+
+/* own headers (part 2/2) */
+#include &quot;uuid_time.h&quot;
+#include &quot;uuid_prng.h&quot;
+#include &quot;uuid_md5.h&quot;
+
+struct prng_st {
+    int    dev; /* system PRNG device */
+    md5_t *md5; /* local MD5 PRNG engine */
+    long   cnt; /* time resolution compensation counter */
+};
+
+prng_rc_t prng_create(prng_t **prng)
+{
+#if !defined(WIN32)
+    int fd = -1;
+#endif
+    struct timeval tv;
+    pid_t pid;
+    unsigned int i;
+
+    /* sanity check argument(s) */
+    if (prng == NULL)
+        return PRNG_RC_ARG;
+
+    /* allocate object */
+    if ((*prng = (prng_t *)malloc(sizeof(prng_t))) == NULL)
+        return PRNG_RC_MEM;
+
+    /* try to open the system PRNG device */
+    (*prng)-&gt;dev = -1;
+#if !defined(WIN32)
+    if ((fd = open(&quot;/dev/urandom&quot;, O_RDONLY)) == -1)
+        fd = open(&quot;/dev/random&quot;, O_RDONLY|O_NONBLOCK);
+    if (fd != -1) {
+        (void)fcntl(fd, F_SETFD, FD_CLOEXEC);
+        (*prng)-&gt;dev = fd;
+    }
+#endif
+
+    /* initialize MD5 engine */
+    if (md5_create(&amp;((*prng)-&gt;md5)) != MD5_RC_OK) {
+        free(*prng);
+        return PRNG_RC_INT;
+    }
+
+    /* initialize time resolution compensation counter */
+    (*prng)-&gt;cnt = 0;
+
+    /* seed the C library PRNG once */
+    (void)time_gettimeofday(&amp;tv);
+    pid = getpid();
+    srand((unsigned int)(
+        ((unsigned int)pid &lt;&lt; 16)
+        ^ (unsigned int)pid
+        ^ (unsigned int)tv.tv_sec
+        ^ (unsigned int)tv.tv_usec));
+    for (i = (unsigned int)((tv.tv_sec ^ tv.tv_usec) &amp; 0x1F); i &gt; 0; i--)
+        (void)rand();
+
+    return PRNG_RC_OK;
+}
+
+prng_rc_t prng_data(prng_t *prng, void *data_ptr, size_t data_len)
+{
+    size_t n;
+    unsigned char *p;
+    struct {
+        struct timeval tv;
+        long cnt;
+        int rnd;
+    } entropy;
+    unsigned char md5_buf[MD5_LEN_BIN];
+    unsigned char *md5_ptr;
+    size_t md5_len;
+    int retries;
+    int i;
+#if defined(WIN32)
+    HCRYPTPROV hProv;
+#endif
+
+    /* sanity check argument(s) */
+    if (prng == NULL || data_len == 0)
+        return PRNG_RC_ARG;
+
+    /* prepare for generation */
+    p = (unsigned char *)data_ptr;
+    n = data_len;
+
+    /* approach 1: try to gather data via stronger system PRNG device */
+    if (prng-&gt;dev != -1) {
+        retries = 0;
+        while (n &gt; 0) {
+            i = (int)read(prng-&gt;dev, (void *)p, n);
+            if (i &lt;= 0) {
+                if (retries++ &gt; 16)
+                    break;
+                continue;
+            }
+            retries = 0;
+            n -= (unsigned int)i;
+            p += (unsigned int)i;
+        }
+    }
+#if defined(WIN32)
+    else {
+        if (CryptAcquireContext(&amp;hProv, NULL, NULL, PROV_RSA_FULL, 0))
+            CryptGenRandom(hProv, n, p);
+    }
+#endif
+
+    /* approach 2: try to gather data via weaker libc PRNG API. */
+    while (n &gt; 0) {
+        /* gather new entropy */
+        (void)time_gettimeofday(&amp;(entropy.tv));  /* source: libc time */
+        entropy.rnd = rand();                    /* source: libc PRNG */
+        entropy.cnt = prng-&gt;cnt++;               /* source: local counter */
+
+        /* pass entropy into MD5 engine */
+        if (md5_update(prng-&gt;md5, (void *)&amp;entropy, sizeof(entropy)) != MD5_RC_OK)
+            return PRNG_RC_INT;
+
+        /* store MD5 engine state as PRN output */
+        md5_ptr = md5_buf;
+        md5_len = sizeof(md5_buf);
+        if (md5_store(prng-&gt;md5, (void **)(void *)&amp;md5_ptr, &amp;md5_len) != MD5_RC_OK)
+            return PRNG_RC_INT;
+        for (i = 0; i &lt; MD5_LEN_BIN &amp;&amp; n &gt; 0; i++, n--)
+            *p++ ^= md5_buf[i]; /* intentionally no assignment because arbitrary
+                                   caller buffer content is leveraged, too */
+    }
+
+    return PRNG_RC_OK;
+}
+
+prng_rc_t prng_destroy(prng_t *prng)
+{
+    /* sanity check argument(s) */
+    if (prng == NULL)
+        return PRNG_RC_ARG;
+
+    /* close PRNG device */
+    if (prng-&gt;dev != -1)
+        (void)close(prng-&gt;dev);
+
+    /* destroy MD5 engine */
+    (void)md5_destroy(prng-&gt;md5);
+
+    /* free object */
+    free(prng);
+
+    return PRNG_RC_OK;
+}
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_prngh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_prng.h (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_prng.h                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_prng.h        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,68 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid_prng.h: PRNG API definition
+*/
+
+#ifndef __PRNG_H___
+#define __PRNG_H___
+
+#include &lt;string.h&gt; /* size_t */
+
+#define PRNG_PREFIX uuid_
+
+/* embedding support */
+#ifdef PRNG_PREFIX
+#if defined(__STDC__) || defined(__cplusplus)
+#define __PRNG_CONCAT(x,y) x ## y
+#define PRNG_CONCAT(x,y) __PRNG_CONCAT(x,y)
+#else
+#define __PRNG_CONCAT(x) x
+#define PRNG_CONCAT(x,y) __PRNG_CONCAT(x)y
+#endif
+#define prng_st      PRNG_CONCAT(PRNG_PREFIX,prng_st)
+#define prng_t       PRNG_CONCAT(PRNG_PREFIX,prng_t)
+#define prng_create  PRNG_CONCAT(PRNG_PREFIX,prng_create)
+#define prng_data    PRNG_CONCAT(PRNG_PREFIX,prng_data)
+#define prng_destroy PRNG_CONCAT(PRNG_PREFIX,prng_destroy)
+#endif
+
+struct prng_st;
+typedef struct prng_st prng_t;
+
+typedef enum {
+    PRNG_RC_OK  = 0,
+    PRNG_RC_ARG = 1,
+    PRNG_RC_MEM = 2,
+    PRNG_RC_INT = 3
+} prng_rc_t;
+
+extern prng_rc_t prng_create  (prng_t **prng);
+extern prng_rc_t prng_data    (prng_t  *prng, void *data_ptr, size_t data_len);
+extern prng_rc_t prng_destroy (prng_t  *prng);
+
+#endif /* __PRNG_H___ */
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_sha1c"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_sha1.c (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_sha1.c                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_sha1.c        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,450 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid_sha1.c: SHA-1 API implementation
+*/
+
+/* own headers (part 1/2) */
+#include &quot;uuid_ac.h&quot;
+
+/* system headers */
+#include &lt;stdlib.h&gt;
+#include &lt;string.h&gt;
+
+/* own headers (part 2/2) */
+#include &quot;uuid_sha1.h&quot;
+
+/*
+ *  This is a RFC 3174 compliant Secure Hash Function (SHA-1) algorithm
+ *  implementation. It is directly derived from the SHA-1 reference
+ *  code published in RFC 3174 with just the following functionality
+ *  preserving changes:
+ *  - reformatted C style to conform with OSSP C style
+ *  - added own OSSP style frontend API
+ *  - added Autoconf based determination of sha1_uintX_t types
+ */
+
+/*
+** ==== BEGIN RFC 3174 CODE ====
+*/
+
+/*
+ *  This implements the Secure Hashing Algorithm 1 as defined in
+ *  FIPS PUB 180-1 published April 17, 1995.
+ *
+ *  The SHA-1, produces a 160-bit message digest for a given data
+ *  stream. It should take about 2**n steps to find a message with the
+ *  same digest as a given message and 2**(n/2) to find any two messages
+ *  with the same digest, when n is the digest size in bits. Therefore,
+ *  this algorithm can serve as a means of providing a &quot;fingerprint&quot; for
+ *  a message.
+ *
+ *  Caveats: SHA-1 is designed to work with messages less than 2^64 bits
+ *  long. Although SHA-1 allows a message digest to be generated for
+ *  messages of any number of bits less than 2^64, this implementation
+ *  only works with messages with a length that is a multiple of the
+ *  size of an 8-bit character.
+ */
+
+typedef unsigned char sha1_uint8_t;
+
+#if SIZEOF_SHORT  &gt; 2
+typedef short int sha1_int16plus_t;
+#elif SIZEOF_INT  &gt; 2
+typedef int       sha1_int16plus_t;
+#elif SIZEOF_LONG &gt; 2
+typedef long int  sha1_int16plus_t;
+#else
+#error ERROR: unable to determine sha1_int16plus_t type (at least two byte word)
+#endif
+
+#if SIZEOF_UNSIGNED_SHORT       == 4
+typedef unsigned short int     sha1_uint32_t;
+#elif SIZEOF_UNSIGNED_INT       == 4
+typedef unsigned int           sha1_uint32_t;
+#elif SIZEOF_UNSIGNED_LONG      == 4
+typedef unsigned long int      sha1_uint32_t;
+#elif SIZEOF_UNSIGNED_LONG_LONG == 4
+typedef unsigned long long int sha1_uint32_t;
+#else
+#error ERROR: unable to determine sha1_uint32_t type (four byte word)
+#endif
+
+enum {
+    shaSuccess = 0,
+    shaNull,            /* null pointer parameter */
+    shaStateError       /* called Input after Result */
+};
+
+#define SHA1HashSize 20
+
+/* This structure will hold context information for the SHA-1 hashing operation */
+typedef struct SHA1Context {
+    sha1_uint32_t Intermediate_Hash[SHA1HashSize/4]; /* Message Digest */
+    sha1_uint32_t Length_Low;                        /* Message length in bits */
+    sha1_uint32_t Length_High;                       /* Message length in bits */
+    sha1_int16plus_t Message_Block_Index;            /* Index into message block array */
+    sha1_uint8_t Message_Block[64];                  /* 512-bit message blocks */
+    int Computed;                                    /* Is the digest computed? */
+    int Corrupted;                                   /* Is the message digest corrupted? */
+} SHA1Context;
+
+/* Function Prototypes */
+static int SHA1Reset  (SHA1Context *);
+static int SHA1Input  (SHA1Context *, const sha1_uint8_t *, unsigned int);
+static int SHA1Result (SHA1Context *, sha1_uint8_t Message_Digest[]);
+
+/* Local Function Prototyptes */
+static void SHA1PadMessage         (SHA1Context *);
+static void SHA1ProcessMessageBlock(SHA1Context *);
+
+/* Define the SHA1 circular left shift macro */
+#define SHA1CircularShift(bits,word) \
+    (((word) &lt;&lt; (bits)) | ((word) &gt;&gt; (32-(bits))))
+
+/*
+ *  This function will initialize the SHA1Context in preparation for
+ *  computing a new SHA1 message digest.
+ */
+static int SHA1Reset(SHA1Context *context)
+{
+    if (context == NULL)
+        return shaNull;
+
+    context-&gt;Length_Low             = 0;
+    context-&gt;Length_High            = 0;
+    context-&gt;Message_Block_Index    = 0;
+
+    context-&gt;Intermediate_Hash[0]   = 0x67452301;
+    context-&gt;Intermediate_Hash[1]   = 0xEFCDAB89;
+    context-&gt;Intermediate_Hash[2]   = 0x98BADCFE;
+    context-&gt;Intermediate_Hash[3]   = 0x10325476;
+    context-&gt;Intermediate_Hash[4]   = 0xC3D2E1F0;
+
+    context-&gt;Computed   = 0;
+    context-&gt;Corrupted  = 0;
+
+    return shaSuccess;
+}
+
+/*
+ *  This function will return the 160-bit message digest into the
+ *  Message_Digest array provided by the caller. NOTE: The first octet
+ *  of hash is stored in the 0th element, the last octet of hash in the
+ *  19th element.
+ */
+static int SHA1Result(SHA1Context *context, sha1_uint8_t Message_Digest[])
+{
+    int i;
+
+    if (context == NULL || Message_Digest == NULL)
+        return shaNull;
+    if (context-&gt;Corrupted)
+        return context-&gt;Corrupted;
+
+    if (!context-&gt;Computed) {
+        SHA1PadMessage(context);
+        for (i = 0; i &lt; 64; i++) {
+            /* message may be sensitive, clear it out */
+            context-&gt;Message_Block[i] = (sha1_uint8_t)0;
+        }
+        context-&gt;Length_Low  = 0; /* and clear length */
+        context-&gt;Length_High = 0;
+        context-&gt;Computed    = 1;
+    }
+    for (i = 0; i &lt; SHA1HashSize; i++)
+        Message_Digest[i] = (sha1_uint8_t)(context-&gt;Intermediate_Hash[i&gt;&gt;2] &gt;&gt; (8 * (3 - (i &amp; 0x03))));
+
+    return shaSuccess;
+}
+
+/*
+ *  This function accepts an array of octets as the next portion of the
+ *  message.
+ */
+static int SHA1Input(SHA1Context *context, const sha1_uint8_t *message_array, unsigned int length)
+{
+    if (length == 0)
+        return shaSuccess;
+    if (context == NULL || message_array == NULL)
+        return shaNull;
+
+    if (context-&gt;Computed) {
+        context-&gt;Corrupted = shaStateError;
+        return shaStateError;
+    }
+    if (context-&gt;Corrupted)
+        return context-&gt;Corrupted;
+    while (length-- &amp;&amp; !context-&gt;Corrupted) {
+        context-&gt;Message_Block[context-&gt;Message_Block_Index++] = (*message_array &amp; 0xFF);
+        context-&gt;Length_Low += 8;
+        if (context-&gt;Length_Low == 0) {
+            context-&gt;Length_High++;
+            if (context-&gt;Length_High == 0)
+                context-&gt;Corrupted = 1; /* Message is too long */
+        }
+        if (context-&gt;Message_Block_Index == 64)
+            SHA1ProcessMessageBlock(context);
+        message_array++;
+    }
+
+    return shaSuccess;
+}
+
+/*
+ *  This function will process the next 512 bits of the message stored
+ *  in the Message_Block array. NOTICE: Many of the variable names in
+ *  this code, especially the single character names, were used because
+ *  those were the names used in the publication.
+ */
+static void SHA1ProcessMessageBlock(SHA1Context *context)
+{
+    const sha1_uint32_t K[] = {   /* Constants defined in SHA-1   */
+        0x5A827999,
+        0x6ED9EBA1,
+        0x8F1BBCDC,
+        0xCA62C1D6
+    };
+    int            t;             /* Loop counter                */
+    sha1_uint32_t  temp;          /* Temporary word value        */
+    sha1_uint32_t  W[80];         /* Word sequence               */
+    sha1_uint32_t  A, B, C, D, E; /* Word buffers                */
+
+    /* Initialize the first 16 words in the array W */
+    for (t = 0; t &lt; 16; t++) {
+        W[t]  = (sha1_uint32_t)(context-&gt;Message_Block[t * 4    ] &lt;&lt; 24);
+        W[t] |= (sha1_uint32_t)(context-&gt;Message_Block[t * 4 + 1] &lt;&lt; 16);
+        W[t] |= (sha1_uint32_t)(context-&gt;Message_Block[t * 4 + 2] &lt;&lt;  8);
+        W[t] |= (sha1_uint32_t)(context-&gt;Message_Block[t * 4 + 3]      );
+    }
+
+    for (t = 16; t &lt; 80; t++)
+       W[t] = SHA1CircularShift(1, W[t-3] ^ W[t-8] ^ W[t-14] ^ W[t-16]);
+
+    A = context-&gt;Intermediate_Hash[0];
+    B = context-&gt;Intermediate_Hash[1];
+    C = context-&gt;Intermediate_Hash[2];
+    D = context-&gt;Intermediate_Hash[3];
+    E = context-&gt;Intermediate_Hash[4];
+
+    for (t = 0; t &lt; 20; t++) {
+        temp =  SHA1CircularShift(5, A) + ((B &amp; C) | ((~B) &amp; D)) + E + W[t] + K[0];
+        E = D;
+        D = C;
+        C = SHA1CircularShift(30, B);
+        B = A;
+        A = temp;
+    }
+
+    for (t = 20; t &lt; 40; t++) {
+        temp = SHA1CircularShift(5, A) + (B ^ C ^ D) + E + W[t] + K[1];
+        E = D;
+        D = C;
+        C = SHA1CircularShift(30, B);
+        B = A;
+        A = temp;
+    }
+
+    for (t = 40; t &lt; 60; t++) {
+        temp = SHA1CircularShift(5, A) + ((B &amp; C) | (B &amp; D) | (C &amp; D)) + E + W[t] + K[2];
+        E = D;
+        D = C;
+        C = SHA1CircularShift(30, B);
+        B = A;
+        A = temp;
+    }
+
+    for (t = 60; t &lt; 80; t++) {
+        temp = SHA1CircularShift(5, A) + (B ^ C ^ D) + E + W[t] + K[3];
+        E = D;
+        D = C;
+        C = SHA1CircularShift(30, B);
+        B = A;
+        A = temp;
+    }
+
+    context-&gt;Intermediate_Hash[0] += A;
+    context-&gt;Intermediate_Hash[1] += B;
+    context-&gt;Intermediate_Hash[2] += C;
+    context-&gt;Intermediate_Hash[3] += D;
+    context-&gt;Intermediate_Hash[4] += E;
+
+    context-&gt;Message_Block_Index = 0;
+
+    return;
+}
+
+/*
+ *  According to the standard, the message must be padded to an even
+ *  512 bits. The first padding bit must be a '1'. The last 64 bits
+ *  represent the length of the original message. All bits in between
+ *  should be 0. This function will pad the message according to those
+ *  rules by filling the Message_Block array accordingly. It will also
+ *  call the ProcessMessageBlock function provided appropriately. When
+ *  it returns, it can be assumed that the message digest has been
+ *  computed.
+ */
+static void SHA1PadMessage(SHA1Context *context)
+{
+    /* Check to see if the current message block is too small to hold
+       the initial padding bits and length. If so, we will pad the block,
+       process it, and then continue padding into a second block. */
+    if (context-&gt;Message_Block_Index &gt; 55) {
+        context-&gt;Message_Block[context-&gt;Message_Block_Index++] = (sha1_uint8_t)0x80;
+        while (context-&gt;Message_Block_Index &lt; 64)
+            context-&gt;Message_Block[context-&gt;Message_Block_Index++] = (sha1_uint8_t)0;
+        SHA1ProcessMessageBlock(context);
+        while(context-&gt;Message_Block_Index &lt; 56)
+            context-&gt;Message_Block[context-&gt;Message_Block_Index++] = (sha1_uint8_t)0;
+    }
+    else {
+        context-&gt;Message_Block[context-&gt;Message_Block_Index++] = (sha1_uint8_t)0x80;
+        while(context-&gt;Message_Block_Index &lt; 56)
+            context-&gt;Message_Block[context-&gt;Message_Block_Index++] = (sha1_uint8_t)0;
+    }
+
+    /* Store the message length as the last 8 octets */
+    context-&gt;Message_Block[56] = (sha1_uint8_t)(context-&gt;Length_High &gt;&gt; 24);
+    context-&gt;Message_Block[57] = (sha1_uint8_t)(context-&gt;Length_High &gt;&gt; 16);
+    context-&gt;Message_Block[58] = (sha1_uint8_t)(context-&gt;Length_High &gt;&gt;  8);
+    context-&gt;Message_Block[59] = (sha1_uint8_t)(context-&gt;Length_High      );
+    context-&gt;Message_Block[60] = (sha1_uint8_t)(context-&gt;Length_Low  &gt;&gt; 24);
+    context-&gt;Message_Block[61] = (sha1_uint8_t)(context-&gt;Length_Low  &gt;&gt; 16);
+    context-&gt;Message_Block[62] = (sha1_uint8_t)(context-&gt;Length_Low  &gt;&gt;  8);
+    context-&gt;Message_Block[63] = (sha1_uint8_t)(context-&gt;Length_Low       );
+
+    SHA1ProcessMessageBlock(context);
+    return;
+}
+
+/*
+** ==== END RFC 3174 CODE ====
+*/
+
+struct sha1_st {
+    SHA1Context ctx;
+};
+
+sha1_rc_t sha1_create(sha1_t **sha1)
+{
+    if (sha1 == NULL)
+        return SHA1_RC_ARG;
+    if ((*sha1 = (sha1_t *)malloc(sizeof(sha1_t))) == NULL)
+        return SHA1_RC_MEM;
+    if (SHA1Reset(&amp;((*sha1)-&gt;ctx)) != shaSuccess)
+        return SHA1_RC_INT;
+    return SHA1_RC_OK;
+}
+
+sha1_rc_t sha1_init(sha1_t *sha1)
+{
+    if (sha1 == NULL)
+        return SHA1_RC_ARG;
+    if (SHA1Reset(&amp;(sha1-&gt;ctx)) != shaSuccess)
+        return SHA1_RC_INT;
+    return SHA1_RC_OK;
+}
+
+sha1_rc_t sha1_update(sha1_t *sha1, const void *data_ptr, size_t data_len)
+{
+    if (sha1 == NULL)
+        return SHA1_RC_ARG;
+    if (SHA1Input(&amp;(sha1-&gt;ctx), (unsigned char *)data_ptr, (unsigned int)data_len) != shaSuccess)
+        return SHA1_RC_INT;
+    return SHA1_RC_OK;
+}
+
+sha1_rc_t sha1_store(sha1_t *sha1, void **data_ptr, size_t *data_len)
+{
+    SHA1Context ctx;
+
+    if (sha1 == NULL || data_ptr == NULL)
+        return SHA1_RC_ARG;
+    if (*data_ptr == NULL) {
+        if ((*data_ptr = malloc(SHA1_LEN_BIN)) == NULL)
+            return SHA1_RC_MEM;
+        if (data_len != NULL)
+            *data_len = SHA1_LEN_BIN;
+    }
+    else {
+        if (data_len != NULL) {
+            if (*data_len &lt; SHA1_LEN_BIN)
+                return SHA1_RC_MEM;
+            *data_len = SHA1_LEN_BIN;
+        }
+    }
+    memcpy((void *)(&amp;ctx), (void *)(&amp;(sha1-&gt;ctx)), sizeof(SHA1Context));
+    if (SHA1Result(&amp;(ctx), (unsigned char *)(*data_ptr)) != shaSuccess)
+        return SHA1_RC_INT;
+    return SHA1_RC_OK;
+}
+
+sha1_rc_t sha1_format(sha1_t *sha1, char **data_ptr, size_t *data_len)
+{
+    static const char hex[] = &quot;0123456789abcdef&quot;;
+    unsigned char buf[SHA1_LEN_BIN];
+    unsigned char *bufptr;
+    size_t buflen;
+    sha1_rc_t rc;
+    int i;
+
+    if (sha1 == NULL || data_ptr == NULL)
+        return SHA1_RC_ARG;
+    if (*data_ptr == NULL) {
+        if ((*data_ptr = (char *)malloc(SHA1_LEN_STR+1)) == NULL)
+            return SHA1_RC_MEM;
+        if (data_len != NULL)
+            *data_len = SHA1_LEN_STR+1;
+    }
+    else {
+        if (data_len != NULL) {
+            if (*data_len &lt; SHA1_LEN_STR+1)
+                return SHA1_RC_MEM;
+            *data_len = SHA1_LEN_STR+1;
+        }
+    }
+
+    bufptr = buf;
+    buflen = sizeof(buf);
+    if ((rc = sha1_store(sha1, (void **)((void *)&amp;bufptr), &amp;buflen)) != SHA1_RC_OK)
+        return rc;
+
+    for (i = 0; i &lt; (int)buflen; i++) {
+            (*data_ptr)[(i*2)+0] = hex[(int)(bufptr[i] &gt;&gt; 4)];
+            (*data_ptr)[(i*2)+1] = hex[(int)(bufptr[i] &amp; 0x0f)];
+    }
+    (*data_ptr)[(i*2)] = '\0';
+    return SHA1_RC_OK;
+}
+
+sha1_rc_t sha1_destroy(sha1_t *sha1)
+{
+    if (sha1 == NULL)
+        return SHA1_RC_ARG;
+    free(sha1);
+    return SHA1_RC_OK;
+}
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_sha1h"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_sha1.h (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_sha1.h                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_sha1.h        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid_sha1.h: SHA-1 API definition
+*/
+
+#ifndef __SHA1_H___
+#define __SHA1_H___
+
+#include &lt;string.h&gt; /* size_t */
+
+#define SHA1_PREFIX uuid_
+
+/* embedding support */
+#ifdef SHA1_PREFIX
+#if defined(__STDC__) || defined(__cplusplus)
+#define __SHA1_CONCAT(x,y) x ## y
+#define SHA1_CONCAT(x,y) __SHA1_CONCAT(x,y)
+#else
+#define __SHA1_CONCAT(x) x
+#define SHA1_CONCAT(x,y) __SHA1_CONCAT(x)y
+#endif
+#define sha1_st      SHA1_CONCAT(SHA1_PREFIX,sha1_st)
+#define sha1_t       SHA1_CONCAT(SHA1_PREFIX,sha1_t)
+#define sha1_create  SHA1_CONCAT(SHA1_PREFIX,sha1_create)
+#define sha1_init    SHA1_CONCAT(SHA1_PREFIX,sha1_init)
+#define sha1_update  SHA1_CONCAT(SHA1_PREFIX,sha1_update)
+#define sha1_store   SHA1_CONCAT(SHA1_PREFIX,sha1_store)
+#define sha1_format  SHA1_CONCAT(SHA1_PREFIX,sha1_format)
+#define sha1_destroy SHA1_CONCAT(SHA1_PREFIX,sha1_destroy)
+#endif
+
+struct sha1_st;
+typedef struct sha1_st sha1_t;
+
+#define SHA1_LEN_BIN 20
+#define SHA1_LEN_STR 40
+
+typedef enum {
+    SHA1_RC_OK  = 0,
+    SHA1_RC_ARG = 1,
+    SHA1_RC_MEM = 2,
+    SHA1_RC_INT = 3
+} sha1_rc_t;
+
+extern sha1_rc_t sha1_create  (sha1_t **sha1);
+extern sha1_rc_t sha1_init    (sha1_t  *sha1);
+extern sha1_rc_t sha1_update  (sha1_t  *sha1, const void  *data_ptr, size_t  data_len);
+extern sha1_rc_t sha1_store   (sha1_t  *sha1,       void **data_ptr, size_t *data_len);
+extern sha1_rc_t sha1_format  (sha1_t  *sha1,       char **data_ptr, size_t *data_len);
+extern sha1_rc_t sha1_destroy (sha1_t  *sha1);
+
+#endif /* __SHA1_H___ */
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_strc"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_str.c (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_str.c                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_str.c        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,762 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid_str.c: string formatting functions
+*/
+
+/*
+ * Copyright Patrick Powell 1995
+ * This code is based on code written by Patrick Powell &lt;papowell@astart.com&gt;
+ * It may be used for any purpose as long as this notice remains intact
+ * on all source code distributions.
+ */
+
+/*
+ * This code contains numerious changes and enhancements which were
+ * made by lots of contributors over the last years to Patrick Powell's
+ * original code:
+ *
+ * o Patrick Powell &lt;papowell@astart.com&gt;      (1995)
+ * o Brandon Long &lt;blong@fiction.net&gt;          (1996, for Mutt)
+ * o Thomas Roessler &lt;roessler@guug.de&gt;        (1998, for Mutt)
+ * o Michael Elkins &lt;me@cs.hmc.edu&gt;            (1998, for Mutt)
+ * o Andrew Tridgell &lt;tridge@samba.org&gt;        (1998, for Samba)
+ * o Luke Mewburn &lt;lukem@netbsd.org&gt;           (1999, for LukemFTP)
+ * o Ralf S. Engelschall &lt;rse@engelschall.com&gt; (1999, for OSSP)
+ */
+
+/* own headers (part 1/2) */
+#include &quot;uuid_ac.h&quot;
+
+/* system headers */
+#include &lt;stdlib.h&gt;
+#include &lt;stdarg.h&gt;
+#include &lt;string.h&gt;
+#include &lt;ctype.h&gt;
+
+/* own headers (part 2/2) */
+#include &quot;uuid_str.h&quot;
+
+#if HAVE_LONG_LONG
+#define LLONG long long
+#else
+#define LLONG long
+#endif
+
+#if HAVE_LONG_DOUBLE
+#define LDOUBLE long double
+#else
+#define LDOUBLE double
+#endif
+
+static void fmtstr     (char *, size_t *, size_t, char *, int, int, int);
+static void fmtint     (char *, size_t *, size_t, LLONG, int, int, int, int);
+static void fmtfp      (char *, size_t *, size_t, LDOUBLE, int, int, int);
+static void dopr_outch (char *, size_t *, size_t, int);
+
+/* format read states */
+#define DP_S_DEFAULT    0
+#define DP_S_FLAGS      1
+#define DP_S_MIN        2
+#define DP_S_DOT        3
+#define DP_S_MAX        4
+#define DP_S_MOD        5
+#define DP_S_CONV       6
+#define DP_S_DONE       7
+
+/* format flags - Bits */
+#define DP_F_MINUS      (1 &lt;&lt; 0)
+#define DP_F_PLUS       (1 &lt;&lt; 1)
+#define DP_F_SPACE      (1 &lt;&lt; 2)
+#define DP_F_NUM        (1 &lt;&lt; 3)
+#define DP_F_ZERO       (1 &lt;&lt; 4)
+#define DP_F_UP         (1 &lt;&lt; 5)
+#define DP_F_UNSIGNED   (1 &lt;&lt; 6)
+
+/* conversion flags */
+#define DP_C_SHORT      1
+#define DP_C_LONG       2
+#define DP_C_LDOUBLE    3
+#define DP_C_LLONG      4
+
+/* some handy macros */
+#define char_to_int(p) (p - '0')
+#define STR_MAX(p,q) ((p &gt;= q) ? p : q)
+#define NUL '\0'
+
+static void
+dopr(
+    char *buffer,
+    size_t maxlen,
+    size_t *retlen,
+    const char *format,
+    va_list args)
+{
+    char ch;
+    LLONG value;
+    LDOUBLE fvalue;
+    char *strvalue;
+    int min;
+    int max;
+    int state;
+    int flags;
+    int cflags;
+    size_t currlen;
+
+    state = DP_S_DEFAULT;
+    flags = currlen = cflags = min = 0;
+    max = -1;
+    ch = *format++;
+
+    if (buffer == NULL)
+        maxlen = 999999;
+
+    while (state != DP_S_DONE) {
+        if ((ch == NUL) || (currlen &gt;= maxlen))
+            state = DP_S_DONE;
+
+        switch (state) {
+        case DP_S_DEFAULT:
+            if (ch == '%')
+                state = DP_S_FLAGS;
+            else
+                dopr_outch(buffer, &amp;currlen, maxlen, ch);
+            ch = *format++;
+            break;
+        case DP_S_FLAGS:
+            switch (ch) {
+                case '-':
+                    flags |= DP_F_MINUS;
+                    ch = *format++;
+                    break;
+                case '+':
+                    flags |= DP_F_PLUS;
+                    ch = *format++;
+                    break;
+                case ' ':
+                    flags |= DP_F_SPACE;
+                    ch = *format++;
+                    break;
+                case '#':
+                    flags |= DP_F_NUM;
+                    ch = *format++;
+                    break;
+                case '0':
+                    flags |= DP_F_ZERO;
+                    ch = *format++;
+                    break;
+                default:
+                    state = DP_S_MIN;
+                    break;
+            }
+            break;
+        case DP_S_MIN:
+            if (isdigit((unsigned char)ch)) {
+                min = 10 * min + char_to_int(ch);
+                ch = *format++;
+            } else if (ch == '*') {
+                min = va_arg(args, int);
+                ch = *format++;
+                state = DP_S_DOT;
+            } else
+                state = DP_S_DOT;
+            break;
+        case DP_S_DOT:
+            if (ch == '.') {
+                state = DP_S_MAX;
+                ch = *format++;
+            } else
+                state = DP_S_MOD;
+            break;
+        case DP_S_MAX:
+            if (isdigit((unsigned char)ch)) {
+                if (max &lt; 0)
+                    max = 0;
+                max = 10 * max + char_to_int(ch);
+                ch = *format++;
+            } else if (ch == '*') {
+                max = va_arg(args, int);
+                ch = *format++;
+                state = DP_S_MOD;
+            } else
+                state = DP_S_MOD;
+            break;
+        case DP_S_MOD:
+            switch (ch) {
+                case 'h':
+                    cflags = DP_C_SHORT;
+                    ch = *format++;
+                    break;
+                case 'l':
+                    if (*format == 'l') {
+                        cflags = DP_C_LLONG;
+                        format++;
+                    } else
+                        cflags = DP_C_LONG;
+                    ch = *format++;
+                    break;
+                case 'q':
+                    cflags = DP_C_LLONG;
+                    ch = *format++;
+                    break;
+                case 'L':
+                    cflags = DP_C_LDOUBLE;
+                    ch = *format++;
+                    break;
+                default:
+                    break;
+            }
+            state = DP_S_CONV;
+            break;
+        case DP_S_CONV:
+            switch (ch) {
+            case 'd':
+            case 'i':
+                switch (cflags) {
+                case DP_C_SHORT:
+                    value = (short int)va_arg(args, int);
+                    break;
+                case DP_C_LONG:
+                    value = va_arg(args, long int);
+                    break;
+                case DP_C_LLONG:
+                    value = va_arg(args, LLONG);
+                    break;
+                default:
+                    value = va_arg(args, int);
+                    break;
+                }
+                fmtint(buffer, &amp;currlen, maxlen, value, 10, min, max, flags);
+                break;
+            case 'X':
+                flags |= DP_F_UP;
+                /* FALLTHROUGH */
+            case 'x':
+            case 'o':
+            case 'u':
+                flags |= DP_F_UNSIGNED;
+                switch (cflags) {
+                    case DP_C_SHORT:
+                        value = (unsigned short int)va_arg(args, unsigned int);
+                        break;
+                    case DP_C_LONG:
+                        value = (LLONG)va_arg(args, unsigned long int);
+                        break;
+                    case DP_C_LLONG:
+                        value = va_arg(args, unsigned LLONG);
+                        break;
+                    default:
+                        value = (LLONG)va_arg(args, unsigned int);
+                        break;
+                }
+                fmtint(buffer, &amp;currlen, maxlen, value,
+                       ch == 'o' ? 8 : (ch == 'u' ? 10 : 16),
+                       min, max, flags);
+                break;
+            case 'f':
+                if (cflags == DP_C_LDOUBLE)
+                    fvalue = va_arg(args, LDOUBLE);
+                else
+                    fvalue = va_arg(args, double);
+                fmtfp(buffer, &amp;currlen, maxlen, fvalue, min, max, flags);
+                break;
+            case 'E':
+                flags |= DP_F_UP;
+                /* FALLTHROUGH */
+            case 'e':
+                if (cflags == DP_C_LDOUBLE)
+                    fvalue = va_arg(args, LDOUBLE);
+                else
+                    fvalue = va_arg(args, double);
+                break;
+            case 'G':
+                flags |= DP_F_UP;
+                /* FALLTHROUGH */
+            case 'g':
+                if (cflags == DP_C_LDOUBLE)
+                    fvalue = va_arg(args, LDOUBLE);
+                else
+                    fvalue = va_arg(args, double);
+                break;
+            case 'c':
+                dopr_outch(buffer, &amp;currlen, maxlen, va_arg(args, int));
+                break;
+            case 's':
+                strvalue = va_arg(args, char *);
+                if (max &lt; 0)
+                    max = maxlen;
+                fmtstr(buffer, &amp;currlen, maxlen, strvalue, flags, min, max);
+                break;
+            case 'p':
+                value = (long)va_arg(args, void *);
+                fmtint(buffer, &amp;currlen, maxlen, value, 16, min, max, flags);
+                break;
+            case 'n': /* XXX */
+                if (cflags == DP_C_SHORT) {
+                    short int *num;
+                    num = va_arg(args, short int *);
+                    *num = currlen;
+                } else if (cflags == DP_C_LONG) { /* XXX */
+                    long int *num;
+                    num = va_arg(args, long int *);
+                    *num = (long int) currlen;
+                } else if (cflags == DP_C_LLONG) { /* XXX */
+                    LLONG *num;
+                    num = va_arg(args, LLONG *);
+                    *num = (LLONG) currlen;
+                } else {
+                    int *num;
+                    num = va_arg(args, int *);
+                    *num = currlen;
+                }
+                break;
+            case '%':
+                dopr_outch(buffer, &amp;currlen, maxlen, ch);
+                break;
+            case 'w':
+                /* not supported yet, treat as next char */
+                ch = *format++;
+                break;
+            default:
+                /* unknown, skip */
+                break;
+            }
+            ch = *format++;
+            state = DP_S_DEFAULT;
+            flags = cflags = min = 0;
+            max = -1;
+            break;
+        case DP_S_DONE:
+            break;
+        default:
+            break;
+        }
+    }
+    if (currlen &gt;= maxlen - 1)
+        currlen = maxlen - 1;
+    if (buffer != NULL)
+        buffer[currlen] = NUL;
+    *retlen = currlen;
+    return;
+}
+
+static void
+fmtstr(
+    char *buffer,
+    size_t *currlen,
+    size_t maxlen,
+    char *value,
+    int flags,
+    int min,
+    int max)
+{
+    int padlen, strln;
+    int cnt = 0;
+
+    if (value == NULL)
+        value = &quot;&lt;NULL&gt;&quot;;
+    for (strln = 0; value[strln] != '\0'; strln++)
+        ;
+    padlen = min - strln;
+    if (padlen &lt; 0)
+        padlen = 0;
+    if (flags &amp; DP_F_MINUS)
+        padlen = -padlen;
+
+    while ((padlen &gt; 0) &amp;&amp; (cnt &lt; max)) {
+        dopr_outch(buffer, currlen, maxlen, ' ');
+        --padlen;
+        ++cnt;
+    }
+    while (*value &amp;&amp; (cnt &lt; max)) {
+        dopr_outch(buffer, currlen, maxlen, *value++);
+        ++cnt;
+    }
+    while ((padlen &lt; 0) &amp;&amp; (cnt &lt; max)) {
+        dopr_outch(buffer, currlen, maxlen, ' ');
+        ++padlen;
+        ++cnt;
+    }
+}
+
+static void
+fmtint(
+    char *buffer,
+    size_t *currlen,
+    size_t maxlen,
+    LLONG value,
+    int base,
+    int min,
+    int max,
+    int flags)
+{
+    int signvalue = 0;
+    unsigned LLONG uvalue;
+    char convert[20];
+    int place = 0;
+    int spadlen = 0;
+    int zpadlen = 0;
+    int caps = 0;
+
+    if (max &lt; 0)
+        max = 0;
+    uvalue = value;
+    if (!(flags &amp; DP_F_UNSIGNED)) {
+        if (value &lt; 0) {
+            signvalue = '-';
+            uvalue = -value;
+        } else if (flags &amp; DP_F_PLUS)
+            signvalue = '+';
+        else if (flags &amp; DP_F_SPACE)
+            signvalue = ' ';
+    }
+    if (flags &amp; DP_F_UP)
+        caps = 1;
+    do {
+        convert[place++] =
+            (caps ? &quot;0123456789ABCDEF&quot; : &quot;0123456789abcdef&quot;)
+            [uvalue % (unsigned) base];
+        uvalue = (uvalue / (unsigned) base);
+    } while (uvalue &amp;&amp; (place &lt; 20));
+    if (place == 20)
+        place--;
+    convert[place] = 0;
+
+    zpadlen = max - place;
+    spadlen = min - STR_MAX(max, place) - (signvalue ? 1 : 0);
+    if (zpadlen &lt; 0)
+        zpadlen = 0;
+    if (spadlen &lt; 0)
+        spadlen = 0;
+    if (flags &amp; DP_F_ZERO) {
+        zpadlen = STR_MAX(zpadlen, spadlen);
+        spadlen = 0;
+    }
+    if (flags &amp; DP_F_MINUS)
+        spadlen = -spadlen;
+
+    /* spaces */
+    while (spadlen &gt; 0) {
+        dopr_outch(buffer, currlen, maxlen, ' ');
+        --spadlen;
+    }
+
+    /* sign */
+    if (signvalue)
+        dopr_outch(buffer, currlen, maxlen, signvalue);
+
+    /* zeros */
+    if (zpadlen &gt; 0) {
+        while (zpadlen &gt; 0) {
+            dopr_outch(buffer, currlen, maxlen, '0');
+            --zpadlen;
+        }
+    }
+    /* digits */
+    while (place &gt; 0)
+        dopr_outch(buffer, currlen, maxlen, convert[--place]);
+
+    /* left justified spaces */
+    while (spadlen &lt; 0) {
+        dopr_outch(buffer, currlen, maxlen, ' ');
+        ++spadlen;
+    }
+    return;
+}
+
+static LDOUBLE
+math_abs(LDOUBLE value)
+{
+    LDOUBLE result = value;
+    if (value &lt; 0)
+        result = -value;
+    return result;
+}
+
+static LDOUBLE
+math_pow10(int exponent)
+{
+    LDOUBLE result = 1;
+    while (exponent &gt; 0) {
+        result *= 10;
+        exponent--;
+    }
+    return result;
+}
+
+static long
+math_round(LDOUBLE value)
+{
+    long intpart;
+    intpart = (long) value;
+    value = value - intpart;
+    if (value &gt;= 0.5)
+        intpart++;
+    return intpart;
+}
+
+static void
+fmtfp(
+    char *buffer,
+    size_t *currlen,
+    size_t maxlen,
+    LDOUBLE fvalue,
+    int min,
+    int max,
+    int flags)
+{
+    int signvalue = 0;
+    LDOUBLE ufvalue;
+    char iconvert[20];
+    char fconvert[20];
+    int iplace = 0;
+    int fplace = 0;
+    int padlen = 0;
+    int zpadlen = 0;
+    int caps = 0;
+    long intpart;
+    long fracpart;
+
+    if (max &lt; 0)
+        max = 6;
+    ufvalue = math_abs(fvalue);
+    if (fvalue &lt; 0)
+        signvalue = '-';
+    else if (flags &amp; DP_F_PLUS)
+        signvalue = '+';
+    else if (flags &amp; DP_F_SPACE)
+        signvalue = ' ';
+
+    intpart = (long)ufvalue;
+
+    /* sorry, we only support 9 digits past the decimal because of our
+       conversion method */
+    if (max &gt; 9)
+        max = 9;
+
+    /* we &quot;cheat&quot; by converting the fractional part to integer by
+       multiplying by a factor of 10 */
+    fracpart = math_round((math_pow10(max)) * (ufvalue - intpart));
+
+    if (fracpart &gt;= math_pow10(max)) {
+        intpart++;
+        fracpart -= (long)math_pow10(max);
+    }
+
+    /* convert integer part */
+    do {
+        iconvert[iplace++] =
+            (caps ? &quot;0123456789ABCDEF&quot;
+              : &quot;0123456789abcdef&quot;)[intpart % 10];
+        intpart = (intpart / 10);
+    } while (intpart &amp;&amp; (iplace &lt; 20));
+    if (iplace == 20)
+        iplace--;
+    iconvert[iplace] = 0;
+
+    /* convert fractional part */
+    do {
+        fconvert[fplace++] =
+            (caps ? &quot;0123456789ABCDEF&quot;
+              : &quot;0123456789abcdef&quot;)[fracpart % 10];
+        fracpart = (fracpart / 10);
+    } while (fracpart &amp;&amp; (fplace &lt; 20));
+    if (fplace == 20)
+        fplace--;
+    fconvert[fplace] = 0;
+
+    /* -1 for decimal point, another -1 if we are printing a sign */
+    padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0);
+    zpadlen = max - fplace;
+    if (zpadlen &lt; 0)
+        zpadlen = 0;
+    if (padlen &lt; 0)
+        padlen = 0;
+    if (flags &amp; DP_F_MINUS)
+        padlen = -padlen;
+
+    if ((flags &amp; DP_F_ZERO) &amp;&amp; (padlen &gt; 0)) {
+        if (signvalue) {
+            dopr_outch(buffer, currlen, maxlen, signvalue);
+            --padlen;
+            signvalue = 0;
+        }
+        while (padlen &gt; 0) {
+            dopr_outch(buffer, currlen, maxlen, '0');
+            --padlen;
+        }
+    }
+    while (padlen &gt; 0) {
+        dopr_outch(buffer, currlen, maxlen, ' ');
+        --padlen;
+    }
+    if (signvalue)
+        dopr_outch(buffer, currlen, maxlen, signvalue);
+
+    while (iplace &gt; 0)
+        dopr_outch(buffer, currlen, maxlen, iconvert[--iplace]);
+
+    /*
+     * Decimal point. This should probably use locale to find the correct
+     * char to print out.
+     */
+    if (max &gt; 0) {
+        dopr_outch(buffer, currlen, maxlen, '.');
+
+        while (fplace &gt; 0)
+            dopr_outch(buffer, currlen, maxlen, fconvert[--fplace]);
+    }
+    while (zpadlen &gt; 0) {
+        dopr_outch(buffer, currlen, maxlen, '0');
+        --zpadlen;
+    }
+
+    while (padlen &lt; 0) {
+        dopr_outch(buffer, currlen, maxlen, ' ');
+        ++padlen;
+    }
+    return;
+}
+
+static void
+dopr_outch(
+    char *buffer,
+    size_t *currlen,
+    size_t maxlen,
+    int c)
+{
+    if (*currlen &lt; maxlen) {
+        if (buffer != NULL)
+            buffer[(*currlen)] = (char)c;
+        (*currlen)++;
+    }
+    return;
+}
+
+int
+str_vsnprintf(
+    char *str,
+    size_t count,
+    const char *fmt,
+    va_list args)
+{
+    size_t retlen;
+
+    if (str != NULL)
+        str[0] = NUL;
+    dopr(str, count, &amp;retlen, fmt, args);
+    return retlen;
+}
+
+int
+str_snprintf(
+    char *str,
+    size_t count,
+    const char *fmt,
+    ...)
+{
+    va_list ap;
+    int rv;
+
+    va_start(ap, fmt);
+    rv = str_vsnprintf(str, count, fmt, ap);
+    va_end(ap);
+    return rv;
+}
+
+char *
+str_vasprintf(
+    const char *fmt,
+    va_list ap)
+{
+    char *rv;
+    int n;
+    va_list ap_tmp;
+
+    va_copy(ap_tmp, ap);
+    n = str_vsnprintf(NULL, 0, fmt, ap_tmp);
+    if ((rv = (char *)malloc(n+1)) == NULL)
+        return NULL;
+    str_vsnprintf(rv, n+1, fmt, ap);
+    return rv;
+}
+
+char *
+str_asprintf(
+    const char *fmt,
+    ...)
+{
+    va_list ap;
+    char *rv;
+
+    va_start(ap, fmt);
+    rv = str_vasprintf(fmt, ap);
+    va_end(ap);
+    return rv;
+}
+
+int
+str_vrsprintf(
+    char **str,
+    const char *fmt,
+    va_list ap)
+{
+    int rv;
+    size_t n;
+    va_list ap_tmp;
+
+    if (str == NULL)
+        return -1;
+    if (*str == NULL) {
+        *str = str_vasprintf(fmt, ap);
+        rv = strlen(*str);
+    }
+    else {
+        va_copy(ap_tmp, ap);
+        n = strlen(*str);
+        rv = str_vsnprintf(NULL, 0, fmt, ap_tmp);
+        if ((*str = (char *)realloc(*str, n+rv+1)) == NULL)
+            return -1;
+        str_vsnprintf((*str)+n, rv+1, fmt, ap);
+    }
+    return rv;
+}
+
+int
+str_rsprintf(
+    char **str,
+    const char *fmt,
+    ...)
+{
+    va_list ap;
+    int rv;
+
+    va_start(ap, fmt);
+    rv = str_vrsprintf(str, fmt, ap);
+    va_end(ap);
+    return rv;
+}
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_strh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_str.h (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_str.h                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_str.h        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid_str.h: string formatting functions
+*/
+
+#ifndef __UUID_STR_H__
+#define __UUID_STR_H__
+
+#include &lt;stdarg.h&gt;
+#include &lt;string.h&gt;
+
+#define STR_PREFIX uuid_
+
+/* embedding support */
+#ifdef STR_PREFIX
+#if defined(__STDC__) || defined(__cplusplus)
+#define __STR_CONCAT(x,y) x ## y
+#define STR_CONCAT(x,y) __STR_CONCAT(x,y)
+#else
+#define __STR_CONCAT(x) x
+#define STR_CONCAT(x,y) __STR_CONCAT(x)y
+#endif
+#define str_vsnprintf  STR_CONCAT(STR_PREFIX,str_vsnprintf)
+#define str_snprintf   STR_CONCAT(STR_PREFIX,str_snprintf)
+#define str_vrsprintf  STR_CONCAT(STR_PREFIX,str_vrsprintf)
+#define str_rsprintf   STR_CONCAT(STR_PREFIX,str_rsprintf)
+#define str_vasprintf  STR_CONCAT(STR_PREFIX,str_vasprintf)
+#define str_asprintf   STR_CONCAT(STR_PREFIX,str_asprintf)
+#endif
+
+extern int   str_vsnprintf (char  *, size_t, const char *, va_list);
+extern int   str_snprintf  (char  *, size_t, const char *, ...);
+extern int   str_vrsprintf (char **,         const char *, va_list);
+extern int   str_rsprintf  (char **,         const char *, ...);
+extern char *str_vasprintf (                 const char *, va_list);
+extern char *str_asprintf  (                 const char *, ...);
+
+#endif /* __UUID_STR_H__ */
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_timec"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_time.c (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_time.c                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_time.c        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,117 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid_time.c: Time Management
+*/
+
+/* own headers (part (1/2) */
+#include &quot;uuid_ac.h&quot;
+
+/* system headers */
+#include &lt;stdlib.h&gt;
+#include &lt;unistd.h&gt;
+#include &lt;time.h&gt;
+#ifdef HAVE_SYS_TIME_H
+#include &lt;sys/time.h&gt;
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include &lt;sys/types.h&gt;
+#endif
+#ifdef HAVE_SYS_SELECT_H
+#include &lt;sys/select.h&gt;
+#endif
+
+/* own headers (part (1/2) */
+#include &quot;uuid_time.h&quot;
+
+/* POSIX gettimeofday(2) abstraction (without timezone) */
+int time_gettimeofday(struct timeval *tv)
+{
+#if defined(HAVE_GETTIMEOFDAY)
+    /* Unix/POSIX pass-through */
+    return gettimeofday(tv, NULL);
+#elif defined(HAVE_CLOCK_GETTIME)
+    /* POSIX emulation */
+    struct timespec ts;
+    if (clock_gettime(CLOCK_MONOTONIC, &amp;ts) == -1)
+        return -1;
+    if (tv != NULL) {
+        tv-&gt;tv_sec = (long)ts.tv_sec;
+        tv-&gt;tv_usec = (long)ts.tv_nsec / 1000;
+    }
+    return 0;
+#elif defined(WIN32)
+    /* Windows emulation */
+    FILETIME ft;
+    LARGE_INTEGER li;
+    __int64 t;
+    static int tzflag;
+#if !defined(__GNUC__)
+#define EPOCHFILETIME 116444736000000000i64
+#else
+#define EPOCHFILETIME 116444736000000000LL
+#endif
+    if (tv != NULL) {
+        GetSystemTimeAsFileTime(&amp;ft);
+        li.LowPart  = ft.dwLowDateTime;
+        li.HighPart = ft.dwHighDateTime;
+        t  = li.QuadPart;
+        t -= EPOCHFILETIME;
+        t /= 10;
+        tv-&gt;tv_sec  = (long)(t / 1000000);
+        tv-&gt;tv_usec = (long)(t % 1000000);
+    }
+    return 0;
+#else
+#error neither Win32 GetSystemTimeAsFileTime() nor Unix gettimeofday() nor POSIX clock_gettime() available!
+#endif
+}
+
+/* BSD usleep(3) abstraction */
+int time_usleep(long usec)
+{
+#if defined(WIN32) &amp;&amp; defined(HAVE_SLEEP)
+    /* Win32 newer Sleep(3) variant */
+    Sleep(usec / 1000);
+#elif defined(WIN32)
+    /* Win32 older _sleep(3) variant */
+    _sleep(usec / 1000);
+#elif defined(HAVE_NANOSLEEP)
+    /* POSIX newer nanosleep(3) variant */
+    struct timespec ts;
+    ts.tv_sec  = 0;
+    ts.tv_nsec = 1000 * usec;
+    nanosleep(&amp;ts, NULL);
+#else
+    /* POSIX older select(2) variant */
+    struct timeval tv;
+    tv.tv_sec  = 0;
+    tv.tv_usec = usec;
+    select(0, NULL, NULL, NULL, &amp;tv);
+#endif
+    return 0;
+}
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_timeh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_time.h (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_time.h                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_time.h        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,83 @@
</span><ins>+/*
+**  OSSP uuid - Universally Unique Identifier
+**  Copyright (c) 2004-2008 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2004-2008 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP uuid, a library for the generation
+**  of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  uuid_time.h: Time Management API
+*/
+
+#ifndef __UUID_TIME_H__
+#define __UUID_TIME_H__
+
+#include &quot;uuid_ac.h&quot;
+
+#if defined(WIN32)
+#define WIN32_LEAN_AND_MEAN
+#include &lt;windows.h&gt;
+#endif
+#include &lt;time.h&gt;
+#ifdef HAVE_SYS_TIME_H
+#include &lt;sys/time.h&gt;
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include &lt;sys/types.h&gt;
+#endif
+
+#define TIME_PREFIX uuid_
+
+/* embedding support */
+#ifdef TIME_PREFIX
+#if defined(__STDC__) || defined(__cplusplus)
+#define __TIME_CONCAT(x,y) x ## y
+#define TIME_CONCAT(x,y) __TIME_CONCAT(x,y)
+#else
+#define __TIME_CONCAT(x) x
+#define TIME_CONCAT(x,y) __TIME_CONCAT(x)y
+#endif
+#define time_gettimeofday TIME_CONCAT(TIME_PREFIX,time_gettimeofday)
+#define time_usleep       TIME_CONCAT(TIME_PREFIX,time_usleep)
+#endif
+
+/* minimum C++ support */
+#ifdef __cplusplus
+#define DECLARATION_BEGIN extern &quot;C&quot; {
+#define DECLARATION_END   }
+#else
+#define DECLARATION_BEGIN
+#define DECLARATION_END
+#endif
+
+DECLARATION_BEGIN
+
+#ifndef HAVE_STRUCT_TIMEVAL
+struct timeval { long tv_sec; long tv_usec; };
+#endif
+
+extern int time_gettimeofday(struct timeval *);
+extern int time_usleep(long usec);
+
+DECLARATION_END
+
+#endif /* __UUID_TIME_H__ */
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_ui128c"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_ui128.c (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_ui128.c                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_ui128.c        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,591 @@
</span><ins>+/*
+**  OSSP ui128 - 128-Bit Arithmetic
+**  Copyright (c) 2002-2005 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2002-2005 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP ui128, a 128-bit arithmetic library
+**  which can be found at http://www.ossp.org/pkg/lib/ui128/.
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  ui128.c: implementation of 128-bit unsigned integer arithmetic
+*/
+
+/* own headers (part 1/2) */
+#include &quot;uuid_ac.h&quot;
+
+/* system headers */
+#include &lt;string.h&gt;
+#include &lt;ctype.h&gt;
+
+/* own headers (part 2/2) */
+#include &quot;uuid_ui128.h&quot;
+
+#define UI128_BASE   256 /* 2^8 */
+#define UI128_DIGITS 16  /* 8*16 = 128 bit */
+#define UIXX_T(n) struct { unsigned char x[n]; }
+
+/* fill an ui128_t with a sequence of a particular digit */
+#define ui128_fill(__x, __n) \
+    /*lint -save -e717*/ \
+    do { int __i; \
+      for (__i = 0; __i &lt; UI128_DIGITS; __i++) \
+          (__x).x[__i] = (__n); \
+    } while (0) \
+    /*lint -restore*/
+
+/* the value zero */
+ui128_t ui128_zero(void)
+{
+    ui128_t z;
+
+    ui128_fill(z, 0);
+    return z;
+}
+
+/* the maximum value */
+ui128_t ui128_max(void)
+{
+    ui128_t z;
+
+    ui128_fill(z, UI128_BASE-1);
+    return z;
+}
+
+/* convert ISO-C &quot;unsigned long&quot; into internal format */
+ui128_t ui128_n2i(unsigned long n)
+{
+    ui128_t z;
+    int i;
+
+    i = 0;
+    do {
+        z.x[i++] = (n % UI128_BASE);
+    } while ((n /= UI128_BASE) &gt; 0 &amp;&amp; i &lt; UI128_DIGITS);
+    for ( ; i &lt; UI128_DIGITS; i++)
+        z.x[i] = 0;
+    return z;
+}
+
+/* convert internal format into ISO-C &quot;unsigned long&quot;;
+   truncates if sizeof(unsigned long) is less than UI128_DIGITS! */
+unsigned long ui128_i2n(ui128_t x)
+{
+    unsigned long n;
+    int i;
+
+    n = 0;
+    i = (int)sizeof(n);
+    /*lint -save -e774*/
+    if (i &gt; UI128_DIGITS)
+        i = UI128_DIGITS;
+    /*lint -restore*/
+    while (--i &gt;= 0) {
+        n = (n * UI128_BASE) + x.x[i];
+    }
+    return n;
+}
+
+/* convert string representation of arbitrary base into internal format */
+ui128_t ui128_s2i(const char *str, char **end, int base)
+{
+    ui128_t z;
+    const char *cp;
+    int carry;
+    static char map[] = {
+         0,  1,  2,  3,  4,  5,  6,  7,  8,  9,             /* 0...9 */
+        36, 36, 36, 36, 36, 36, 36,                         /* illegal chars */
+        10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, /* A...M */
+        23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, /* N...Z */
+        36, 36, 36, 36, 36, 36,                             /* illegal chars */
+        10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, /* a...m */
+        23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35  /* m...z */
+    };
+
+    ui128_fill(z, 0);
+    if (str == NULL || (base &lt; 2 || base &gt; 36))
+        return z;
+    cp = str;
+    while (*cp != '\0' &amp;&amp; isspace((int)(*cp)))
+        cp++;
+    while (   *cp != '\0'
+           &amp;&amp; isalnum((int)(*cp))
+           &amp;&amp; map[(int)(*cp)-'0'] &lt; base) {
+        z = ui128_muln(z, base, &amp;carry);
+        if (carry)
+            break;
+        z = ui128_addn(z, map[(int)(*cp)-'0'], &amp;carry);
+        if (carry)
+            break;
+        cp++;
+    }
+    if (end != NULL)
+        *end = (char *)cp;
+    return z;
+}
+
+/* convert internal format into string representation of arbitrary base */
+char *ui128_i2s(ui128_t x, char *str, size_t len, int base)
+{
+    static char map[] = &quot;0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;;
+    char c;
+    int r;
+    int n;
+    int i, j;
+
+    if (str == NULL || len &lt; 2 || (base &lt; 2 || base &gt; 36))
+        return NULL;
+    n = ui128_len(x);
+    i = 0;
+    do {
+        x = ui128_divn(x, base, &amp;r);
+        str[i++] = map[r];
+        while (n &gt; 1 &amp;&amp; x.x[n-1] == 0)
+            n--;
+    } while (i &lt; ((int)len-1) &amp;&amp; (n &gt; 1 || x.x[0] != 0));
+    str[i] = '\0';
+    for (j = 0; j &lt; --i; j++) {
+        c = str[j];
+        str[j] = str[i];
+        str[i] = c;
+    }
+    return str;
+}
+
+/* addition of two ui128_t */
+ui128_t ui128_add(ui128_t x, ui128_t y, ui128_t *ov)
+{
+    ui128_t z;
+    int carry;
+    int i;
+
+    carry = 0;
+    for (i = 0; i &lt; UI128_DIGITS; i++) {
+        carry += (x.x[i] + y.x[i]);
+        z.x[i] = (carry % UI128_BASE);
+        carry /= UI128_BASE;
+    }
+    if (ov != NULL)
+        *ov = ui128_n2i((unsigned long)carry);
+    return z;
+}
+
+/* addition of an ui128_t and a single digit */
+ui128_t ui128_addn(ui128_t x, int y, int *ov)
+{
+    ui128_t z;
+    int i;
+
+    for (i = 0; i &lt; UI128_DIGITS; i++) {
+        y += x.x[i];
+        z.x[i] = (y % UI128_BASE);
+        y /= UI128_BASE;
+    }
+    if (ov != NULL)
+        *ov = y;
+    return z;
+}
+
+/* subtraction of two ui128_t */
+ui128_t ui128_sub(ui128_t x, ui128_t y, ui128_t *ov)
+{
+    ui128_t z;
+    int borrow;
+    int i;
+    int d;
+
+    borrow = 0;
+    for (i = 0; i &lt; UI128_DIGITS; i++) {
+        d = ((x.x[i] + UI128_BASE) - borrow - y.x[i]);
+        z.x[i] = (d % UI128_BASE);
+        borrow = (1 - (d/UI128_BASE));
+    }
+    if (ov != NULL)
+        *ov = ui128_n2i((unsigned long)borrow);
+    return z;
+}
+
+/* subtraction of an ui128_t and a single digit */
+ui128_t ui128_subn(ui128_t x, int y, int *ov)
+{
+    ui128_t z;
+    int i;
+    int d;
+
+    for (i = 0; i &lt; UI128_DIGITS; i++) {
+        d = (x.x[i] + UI128_BASE) - y;
+        z.x[i] = (d % UI128_BASE);
+        y = (1 - (d/UI128_BASE));
+    }
+    if (ov != NULL)
+        *ov = y;
+    return z;
+}
+
+/*
+             7 3 2
+         * 9 4 2 8
+         ---------
+           5 8 5 6
+   +     1 4 6 4
+   +   2 9 2 8
+   + 6 5 8 8
+   ---------------
+   = 6 9 0 1 2 9 6
+*/
+
+ui128_t ui128_mul(ui128_t x, ui128_t y, ui128_t *ov)
+{
+    UIXX_T(UI128_DIGITS+UI128_DIGITS) zx;
+    ui128_t z;
+    int carry;
+    int i, j;
+
+    /* clear temporary result buffer */
+    for (i = 0; i &lt; (UI128_DIGITS+UI128_DIGITS); i++)
+        zx.x[i] = 0;
+
+    /* perform multiplication operation */
+    for (i = 0; i &lt; UI128_DIGITS; i++) {
+        /* calculate partial product and immediately add to z */
+        carry = 0;
+        for (j = 0; j &lt; UI128_DIGITS; j++) {
+            carry += (x.x[i] * y.x[j]) + zx.x[i+j];
+            zx.x[i+j] = (carry % UI128_BASE);
+            carry /= UI128_BASE;
+        }
+        /* add carry to remaining digits in z */
+        for ( ; j &lt; UI128_DIGITS + UI128_DIGITS - i; j++) {
+            carry += zx.x[i+j];
+            zx.x[i+j] = (carry % UI128_BASE);
+            carry /= UI128_BASE;
+        }
+    }
+
+    /* provide result by splitting zx into z and ov */
+    memcpy(z.x, zx.x, UI128_DIGITS);
+    if (ov != NULL)
+        memcpy((*ov).x, &amp;zx.x[UI128_DIGITS], UI128_DIGITS);
+
+    return z;
+}
+
+ui128_t ui128_muln(ui128_t x, int y, int *ov)
+{
+    ui128_t z;
+    int carry;
+    int i;
+
+    carry = 0;
+    for (i = 0; i &lt; UI128_DIGITS; i++) {
+        carry += (x.x[i] * y);
+        z.x[i] = (carry % UI128_BASE);
+        carry /= UI128_BASE;
+    }
+    if (ov != NULL)
+        *ov = carry;
+    return z;
+}
+
+/*
+  =   2078 [q]
+   0615367 [x] : 296 [y]
+  -0592    [dq]
+  -----
+  = 0233
+   -0000   [dq]
+   -----
+   = 2336
+    -2072  [dq]
+    -----
+    = 2647
+     -2308 [dq]
+     -----
+     = 279 [r]
+ */
+ui128_t ui128_div(ui128_t x, ui128_t y, ui128_t *ov)
+{
+    ui128_t q;
+    ui128_t r;
+    int i;
+    int n, m;
+    int ovn;
+
+    /* determine actual number of involved digits */
+    n = ui128_len(x);
+    m = ui128_len(y);
+
+    if (m == 1) {
+        /* simple case #1: reduceable to ui128_divn() */
+        if (y.x[0] == 0) {
+            /* error case: division by zero! */
+            ui128_fill(q, 0);
+            ui128_fill(r, 0);
+        }
+        else {
+            q = ui128_divn(x, y.x[0], &amp;ovn);
+            ui128_fill(r, 0);
+            r.x[0] = (unsigned char)ovn;
+        }
+
+    } else if (n &lt; m) {
+        /* simple case #2: everything is in the remainder */
+        ui128_fill(q, 0);
+        r = x;
+
+    } else { /* n &gt;= m, m &gt; 1 */
+        /* standard case: x[0..n] / y[0..m] */
+        UIXX_T(UI128_DIGITS+1) rx;
+        UIXX_T(UI128_DIGITS+1) dq;
+        ui128_t t;
+        int km;
+        int k;
+        int qk;
+        unsigned long y2;
+        unsigned long r3;
+        int borrow;
+        int d;
+
+        /* rx is x with a leading zero in order to make
+           sure that n &gt; m and not just n &gt;= m */
+        memcpy(rx.x, x.x, UI128_DIGITS);
+        rx.x[UI128_DIGITS] = 0;
+
+        for (k = n - m; k &gt;= 0; k--) {
+            /* efficiently compute qk by guessing
+               qk := rx[k+m-2...k+m]/y[m-2...m-1] */
+            km = k + m;
+            y2 = (y.x[m-1]*UI128_BASE) + y.x[m-2];
+            r3 = (rx.x[km]*(UI128_BASE*UI128_BASE)) +
+                 (rx.x[km-1]*UI128_BASE) + rx.x[km-2];
+            qk = r3 / y2;
+            if (qk &gt;= UI128_BASE)
+                qk = UI128_BASE - 1;
+
+            /* dq := y*qk (post-adjust qk if guessed incorrectly) */
+            t = ui128_muln(y, qk, &amp;ovn);
+            memcpy(dq.x, t.x, UI128_DIGITS);
+            dq.x[m] = (unsigned char)ovn;
+            for (i = m; i &gt; 0; i--)
+                if (rx.x[i+k] != dq.x[i])
+                    break;
+            if (rx.x[i+k] &lt; dq.x[i]) {
+                t = ui128_muln(y, --qk, &amp;ovn);
+                memcpy(dq.x, t.x, UI128_DIGITS);
+                dq.x[m] = (unsigned char)ovn;
+            }
+
+            /* store qk */
+            q.x[k] = (unsigned char)qk;
+
+            /* rx := rx - dq*(b^k) */
+            borrow = 0;
+            for (i = 0; i &lt; m+1; i++) {
+                d = ((rx.x[k+i] + UI128_BASE) - borrow - dq.x[i]);
+                rx.x[k+i] = (d % UI128_BASE);
+                borrow = (1 - (d/UI128_BASE));
+            }
+        }
+        memcpy(r.x, rx.x, m);
+
+        /* fill out results with leading zeros */
+        for (i = n-m+1; i &lt; UI128_DIGITS; i++)
+            q.x[i] = 0;
+        for (i = m; i &lt; UI128_DIGITS; i++)
+            r.x[i] = 0;
+    }
+
+    /* provide results */
+    if (ov != NULL)
+        *ov = r;
+    return q;
+}
+
+ui128_t ui128_divn(ui128_t x, int y, int *ov)
+{
+    ui128_t z;
+    unsigned int carry;
+    int i;
+
+    carry = 0;
+    for (i = (UI128_DIGITS - 1); i &gt;= 0; i--) {
+        carry = (carry * UI128_BASE) + x.x[i];
+        z.x[i] = (carry / y);
+        carry %= y;
+    }
+    if (ov != NULL)
+        *ov = carry;
+    return z;
+}
+
+ui128_t ui128_and(ui128_t x, ui128_t y)
+{
+    ui128_t z;
+    int i;
+
+    for (i = 0; i &lt; UI128_DIGITS; i++)
+        z.x[i] = (x.x[i] &amp; y.x[i]);
+    return z;
+}
+
+ui128_t ui128_or(ui128_t x, ui128_t y)
+{
+    ui128_t z;
+    int i;
+
+    for (i = 0; i &lt; UI128_DIGITS; i++)
+        z.x[i] = (x.x[i] | y.x[i]);
+    return z;
+}
+
+ui128_t ui128_xor(ui128_t x, ui128_t y)
+{
+    ui128_t z;
+    int i;
+
+    for (i = 0; i &lt; UI128_DIGITS; i++)
+        z.x[i] = ((x.x[i] &amp; ~(y.x[i])) | (~(x.x[i]) &amp; (y.x[i])));
+    return z;
+}
+
+ui128_t ui128_not(ui128_t x)
+{
+    ui128_t z;
+    int i;
+
+    for (i = 0; i &lt; UI128_DIGITS; i++)
+        z.x[i] = ~(x.x[i]);
+    return z;
+}
+
+ui128_t ui128_rol(ui128_t x, int s, ui128_t *ov)
+{
+    UIXX_T(UI128_DIGITS+UI128_DIGITS) zx;
+    ui128_t z;
+    int i;
+    int carry;
+
+    if (s &lt;= 0) {
+        /* no shift at all */
+        if (ov != NULL)
+            *ov = ui128_zero();
+        return x;
+    }
+    else if (s &gt; 128) {
+        /* too large shift */
+        if (ov != NULL)
+            *ov = ui128_zero();
+        return ui128_zero();
+    }
+    else if (s == 128) {
+        /* maximum shift */
+        if (ov != NULL)
+            *ov = x;
+        return ui128_zero();
+    }
+    else { /* regular shift */
+        /* shift (logically) left by s/8 bytes */
+        for (i = 0; i &lt; UI128_DIGITS+UI128_DIGITS; i++)
+            zx.x[i] = 0;
+        for (i = 0; i &lt; UI128_DIGITS; i++)
+            zx.x[i+(s/8)] = x.x[i];
+        /* shift (logically) left by remaining s%8 bits */
+        s %= 8;
+        if (s &gt; 0) {
+            carry = 0;
+            for (i = 0; i &lt; UI128_DIGITS+UI128_DIGITS; i++) {
+                carry += (zx.x[i] * (1 &lt;&lt; s));
+                zx.x[i] = (carry % UI128_BASE);
+                carry /= UI128_BASE;
+            }
+        }
+        memcpy(z.x, zx.x, UI128_DIGITS);
+        if (ov != NULL)
+            memcpy((*ov).x, &amp;zx.x[UI128_DIGITS], UI128_DIGITS);
+    }
+    return z;
+}
+
+ui128_t ui128_ror(ui128_t x, int s, ui128_t *ov)
+{
+    UIXX_T(UI128_DIGITS+UI128_DIGITS) zx;
+    ui128_t z;
+    int i;
+    int carry;
+
+    if (s &lt;= 0) {
+        /* no shift at all */
+        if (ov != NULL)
+            *ov = ui128_zero();
+        return x;
+    }
+    else if (s &gt; 128) {
+        /* too large shift */
+        if (ov != NULL)
+            *ov = ui128_zero();
+        return ui128_zero();
+    }
+    else if (s == 128) {
+        /* maximum shift */
+        if (ov != NULL)
+            *ov = x;
+        return ui128_zero();
+    }
+    else { /* regular shift */
+        /* shift (logically) right by s/8 bytes */
+        for (i = 0; i &lt; UI128_DIGITS+UI128_DIGITS; i++)
+            zx.x[i] = 0;
+        for (i = 0; i &lt; UI128_DIGITS; i++)
+            zx.x[UI128_DIGITS+i-(s/8)] = x.x[i];
+        /* shift (logically) right by remaining s%8 bits */
+        s %= 8;
+        if (s &gt; 0) {
+            carry = 0;
+            for (i = (UI128_DIGITS+UI128_DIGITS - 1); i &gt;= 0; i--) {
+                carry = (carry * UI128_BASE) + zx.x[i];
+                zx.x[i] = (carry / (1 &lt;&lt; s));
+                carry %= (1 &lt;&lt; s);
+            }
+        }
+        memcpy(z.x, &amp;zx.x[UI128_DIGITS], UI128_DIGITS);
+        if (ov != NULL)
+            memcpy((*ov).x, zx.x, UI128_DIGITS);
+    }
+    return z;
+}
+
+int ui128_cmp(ui128_t x, ui128_t y)
+{
+    int i;
+
+    i = UI128_DIGITS - 1;
+    while (i &gt; 0 &amp;&amp; x.x[i] == y.x[i])
+        i--;
+    return (x.x[i] - y.x[i]);
+}
+
+int ui128_len(ui128_t x)
+{
+    int i;
+
+    for (i = UI128_DIGITS; i &gt; 1 &amp;&amp; x.x[i-1] == 0; i--)
+        ;
+    return i;
+}
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_ui128h"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_ui128.h (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_ui128.h                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_ui128.h        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,114 @@
</span><ins>+/*
+**  OSSP ui128 - 128-Bit Arithmetic
+**  Copyright (c) 2002-2005 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2002-2005 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP ui128, a 128-bit arithmetic library
+**  which can be found at http://www.ossp.org/pkg/lib/ui128/.
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  ui128.h: API declaration
+*/
+
+#ifndef __UI128_H__
+#define __UI128_H__
+
+#include &lt;string.h&gt;
+
+#define UI128_PREFIX uuid_
+
+/* embedding support */
+#ifdef UI128_PREFIX
+#if defined(__STDC__) || defined(__cplusplus)
+#define __UI128_CONCAT(x,y) x ## y
+#define UI128_CONCAT(x,y) __UI128_CONCAT(x,y)
+#else
+#define __UI128_CONCAT(x) x
+#define UI128_CONCAT(x,y) __UI128_CONCAT(x)y
+#endif
+#define ui128_t     UI128_CONCAT(UI128_PREFIX,ui128_t)
+#define ui128_zero  UI128_CONCAT(UI128_PREFIX,ui128_zero)
+#define ui128_max   UI128_CONCAT(UI128_PREFIX,ui128_max)
+#define ui128_n2i   UI128_CONCAT(UI128_PREFIX,ui128_n2i)
+#define ui128_i2n   UI128_CONCAT(UI128_PREFIX,ui128_i2n)
+#define ui128_s2i   UI128_CONCAT(UI128_PREFIX,ui128_s2i)
+#define ui128_i2s   UI128_CONCAT(UI128_PREFIX,ui128_i2s)
+#define ui128_add   UI128_CONCAT(UI128_PREFIX,ui128_add)
+#define ui128_addn  UI128_CONCAT(UI128_PREFIX,ui128_addn)
+#define ui128_sub   UI128_CONCAT(UI128_PREFIX,ui128_sub)
+#define ui128_subn  UI128_CONCAT(UI128_PREFIX,ui128_subn)
+#define ui128_mul   UI128_CONCAT(UI128_PREFIX,ui128_mul)
+#define ui128_muln  UI128_CONCAT(UI128_PREFIX,ui128_muln)
+#define ui128_div   UI128_CONCAT(UI128_PREFIX,ui128_div)
+#define ui128_divn  UI128_CONCAT(UI128_PREFIX,ui128_divn)
+#define ui128_and   UI128_CONCAT(UI128_PREFIX,ui128_and)
+#define ui128_or    UI128_CONCAT(UI128_PREFIX,ui128_or)
+#define ui128_xor   UI128_CONCAT(UI128_PREFIX,ui128_xor)
+#define ui128_not   UI128_CONCAT(UI128_PREFIX,ui128_not)
+#define ui128_rol   UI128_CONCAT(UI128_PREFIX,ui128_rol)
+#define ui128_ror   UI128_CONCAT(UI128_PREFIX,ui128_ror)
+#define ui128_len   UI128_CONCAT(UI128_PREFIX,ui128_len)
+#define ui128_cmp   UI128_CONCAT(UI128_PREFIX,ui128_cmp)
+#endif
+
+typedef struct {
+    unsigned char x[16]; /* x_0, ..., x_15 */
+} ui128_t;
+
+#define ui128_cons(x15,x14,x13,x12,x11,x10,x9,x8,x7,x6,x5,x4,x3,x2,x1,x0) \
+    { { 0x##x0, 0x##x1, 0x##x2,  0x##x3,  0x##x4,  0x##x5,  0x##x6,  0x##x7, \
+    { { 0x##x8, 0x##x9, 0x##x10, 0x##x11, 0x##x12, 0x##x13, 0x##x14, 0x##x15 } }
+
+/* particular values */
+extern ui128_t        ui128_zero (void);
+extern ui128_t        ui128_max  (void);
+
+/* import and export via ISO-C &quot;unsigned long&quot; */
+extern ui128_t        ui128_n2i  (unsigned long n);
+extern unsigned long  ui128_i2n  (ui128_t x);
+
+/* import and export via ISO-C string of arbitrary base */
+extern ui128_t        ui128_s2i  (const char *str, char **end, int base);
+extern char *         ui128_i2s  (ui128_t x, char *str, size_t len, int base);
+
+/* arithmetical operations */
+extern ui128_t        ui128_add  (ui128_t x, ui128_t y, ui128_t *ov);
+extern ui128_t        ui128_addn (ui128_t x, int     y, int     *ov);
+extern ui128_t        ui128_sub  (ui128_t x, ui128_t y, ui128_t *ov);
+extern ui128_t        ui128_subn (ui128_t x, int     y, int     *ov);
+extern ui128_t        ui128_mul  (ui128_t x, ui128_t y, ui128_t *ov);
+extern ui128_t        ui128_muln (ui128_t x, int     y, int     *ov);
+extern ui128_t        ui128_div  (ui128_t x, ui128_t y, ui128_t *ov);
+extern ui128_t        ui128_divn (ui128_t x, int     y, int     *ov);
+
+/* bit operations */
+extern ui128_t        ui128_and  (ui128_t x, ui128_t y);
+extern ui128_t        ui128_or   (ui128_t x, ui128_t y);
+extern ui128_t        ui128_xor  (ui128_t x, ui128_t y);
+extern ui128_t        ui128_not  (ui128_t x);
+extern ui128_t        ui128_rol  (ui128_t x, int s, ui128_t *ov);
+extern ui128_t        ui128_ror  (ui128_t x, int s, ui128_t *ov);
+
+/* other operations */
+extern int            ui128_len  (ui128_t x);
+extern int            ui128_cmp  (ui128_t x, ui128_t y);
+
+#endif /* __UI128_H__ */
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_ui64c"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_ui64.c (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_ui64.c                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_ui64.c        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,591 @@
</span><ins>+/*
+**  OSSP ui64 - 64-Bit Arithmetic
+**  Copyright (c) 2002-2005 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2002-2005 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP ui64, a 64-bit arithmetic library
+**  which can be found at http://www.ossp.org/pkg/lib/ui64/.
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  ui64.c: implementation of 64-bit unsigned integer arithmetic
+*/
+
+/* own headers (part 1/2) */
+#include &quot;uuid_ac.h&quot;
+
+/* system headers */
+#include &lt;string.h&gt;
+#include &lt;ctype.h&gt;
+
+/* own headers (part 2/2) */
+#include &quot;uuid_ui64.h&quot;
+
+#define UI64_BASE   256 /* 2^8 */
+#define UI64_DIGITS 8   /* 8*8 = 64 bit */
+#define UIXX_T(n) struct { unsigned char x[n]; }
+
+/* fill an ui64_t with a sequence of a particular digit */
+#define ui64_fill(__x, __n) \
+    /*lint -save -e717*/ \
+    do { int __i; \
+      for (__i = 0; __i &lt; UI64_DIGITS; __i++) \
+          (__x).x[__i] = (__n); \
+    } while (0) \
+    /*lint -restore*/
+
+/* the value zero */
+ui64_t ui64_zero(void)
+{
+    ui64_t z;
+
+    ui64_fill(z, 0);
+    return z;
+}
+
+/* the maximum value */
+ui64_t ui64_max(void)
+{
+    ui64_t z;
+
+    ui64_fill(z, UI64_BASE-1);
+    return z;
+}
+
+/* convert ISO-C &quot;unsigned long&quot; into internal format */
+ui64_t ui64_n2i(unsigned long n)
+{
+    ui64_t z;
+    int i;
+
+    i = 0;
+    do {
+        z.x[i++] = (n % UI64_BASE);
+    } while ((n /= UI64_BASE) &gt; 0 &amp;&amp; i &lt; UI64_DIGITS);
+    for ( ; i &lt; UI64_DIGITS; i++)
+        z.x[i] = 0;
+    return z;
+}
+
+/* convert internal format into ISO-C &quot;unsigned long&quot;;
+   truncates if sizeof(unsigned long) is less than UI64_DIGITS! */
+unsigned long ui64_i2n(ui64_t x)
+{
+    unsigned long n;
+    int i;
+
+    n = 0;
+    i = (int)sizeof(n);
+    /*lint -save -e774*/
+    if (i &gt; UI64_DIGITS)
+        i = UI64_DIGITS;
+    /*lint -restore*/
+    while (--i &gt;= 0) {
+        n = (n * UI64_BASE) + x.x[i];
+    }
+    return n;
+}
+
+/* convert string representation of arbitrary base into internal format */
+ui64_t ui64_s2i(const char *str, char **end, int base)
+{
+    ui64_t z;
+    const char *cp;
+    int carry;
+    static char map[] = {
+         0,  1,  2,  3,  4,  5,  6,  7,  8,  9,             /* 0...9 */
+        36, 36, 36, 36, 36, 36, 36,                         /* illegal chars */
+        10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, /* A...M */
+        23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, /* N...Z */
+        36, 36, 36, 36, 36, 36,                             /* illegal chars */
+        10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, /* a...m */
+        23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35  /* m...z */
+    };
+
+    ui64_fill(z, 0);
+    if (str == NULL || (base &lt; 2 || base &gt; 36))
+        return z;
+    cp = str;
+    while (*cp != '\0' &amp;&amp; isspace((int)(*cp)))
+        cp++;
+    while (   *cp != '\0'
+           &amp;&amp; isalnum((int)(*cp))
+           &amp;&amp; map[(int)(*cp)-'0'] &lt; base) {
+        z = ui64_muln(z, base, &amp;carry);
+        if (carry)
+            break;
+        z = ui64_addn(z, map[(int)(*cp)-'0'], &amp;carry);
+        if (carry)
+            break;
+        cp++;
+    }
+    if (end != NULL)
+        *end = (char *)cp;
+    return z;
+}
+
+/* convert internal format into string representation of arbitrary base */
+char *ui64_i2s(ui64_t x, char *str, size_t len, int base)
+{
+    static char map[] = &quot;0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;;
+    char c;
+    int r;
+    int n;
+    int i, j;
+
+    if (str == NULL || len &lt; 2 || (base &lt; 2 || base &gt; 36))
+        return NULL;
+    n = ui64_len(x);
+    i = 0;
+    do {
+        x = ui64_divn(x, base, &amp;r);
+        str[i++] = map[r];
+        while (n &gt; 1 &amp;&amp; x.x[n-1] == 0)
+            n--;
+    } while (i &lt; ((int)len-1) &amp;&amp; (n &gt; 1 || x.x[0] != 0));
+    str[i] = '\0';
+    for (j = 0; j &lt; --i; j++) {
+        c = str[j];
+        str[j] = str[i];
+        str[i] = c;
+    }
+    return str;
+}
+
+/* addition of two ui64_t */
+ui64_t ui64_add(ui64_t x, ui64_t y, ui64_t *ov)
+{
+    ui64_t z;
+    int carry;
+    int i;
+
+    carry = 0;
+    for (i = 0; i &lt; UI64_DIGITS; i++) {
+        carry += (x.x[i] + y.x[i]);
+        z.x[i] = (carry % UI64_BASE);
+        carry /= UI64_BASE;
+    }
+    if (ov != NULL)
+        *ov = ui64_n2i((unsigned long)carry);
+    return z;
+}
+
+/* addition of an ui64_t and a single digit */
+ui64_t ui64_addn(ui64_t x, int y, int *ov)
+{
+    ui64_t z;
+    int i;
+
+    for (i = 0; i &lt; UI64_DIGITS; i++) {
+        y += x.x[i];
+        z.x[i] = (y % UI64_BASE);
+        y /= UI64_BASE;
+    }
+    if (ov != NULL)
+        *ov = y;
+    return z;
+}
+
+/* subtraction of two ui64_t */
+ui64_t ui64_sub(ui64_t x, ui64_t y, ui64_t *ov)
+{
+    ui64_t z;
+    int borrow;
+    int i;
+    int d;
+
+    borrow = 0;
+    for (i = 0; i &lt; UI64_DIGITS; i++) {
+        d = ((x.x[i] + UI64_BASE) - borrow - y.x[i]);
+        z.x[i] = (d % UI64_BASE);
+        borrow = (1 - (d/UI64_BASE));
+    }
+    if (ov != NULL)
+        *ov = ui64_n2i((unsigned long)borrow);
+    return z;
+}
+
+/* subtraction of an ui64_t and a single digit */
+ui64_t ui64_subn(ui64_t x, int y, int *ov)
+{
+    ui64_t z;
+    int i;
+    int d;
+
+    for (i = 0; i &lt; UI64_DIGITS; i++) {
+        d = (x.x[i] + UI64_BASE) - y;
+        z.x[i] = (d % UI64_BASE);
+        y = (1 - (d/UI64_BASE));
+    }
+    if (ov != NULL)
+        *ov = y;
+    return z;
+}
+
+/*
+             7 3 2
+         * 9 4 2 8
+         ---------
+           5 8 5 6
+   +     1 4 6 4
+   +   2 9 2 8
+   + 6 5 8 8
+   ---------------
+   = 6 9 0 1 2 9 6
+*/
+
+ui64_t ui64_mul(ui64_t x, ui64_t y, ui64_t *ov)
+{
+    UIXX_T(UI64_DIGITS+UI64_DIGITS) zx;
+    ui64_t z;
+    int carry;
+    int i, j;
+
+    /* clear temporary result buffer */
+    for (i = 0; i &lt; (UI64_DIGITS+UI64_DIGITS); i++)
+        zx.x[i] = 0;
+
+    /* perform multiplication operation */
+    for (i = 0; i &lt; UI64_DIGITS; i++) {
+        /* calculate partial product and immediately add to z */
+        carry = 0;
+        for (j = 0; j &lt; UI64_DIGITS; j++) {
+            carry += (x.x[i] * y.x[j]) + zx.x[i+j];
+            zx.x[i+j] = (carry % UI64_BASE);
+            carry /= UI64_BASE;
+        }
+        /* add carry to remaining digits in z */
+        for ( ; j &lt; UI64_DIGITS + UI64_DIGITS - i; j++) {
+            carry += zx.x[i+j];
+            zx.x[i+j] = (carry % UI64_BASE);
+            carry /= UI64_BASE;
+        }
+    }
+
+    /* provide result by splitting zx into z and ov */
+    memcpy(z.x, zx.x, UI64_DIGITS);
+    if (ov != NULL)
+        memcpy((*ov).x, &amp;zx.x[UI64_DIGITS], UI64_DIGITS);
+
+    return z;
+}
+
+ui64_t ui64_muln(ui64_t x, int y, int *ov)
+{
+    ui64_t z;
+    int carry;
+    int i;
+
+    carry = 0;
+    for (i = 0; i &lt; UI64_DIGITS; i++) {
+        carry += (x.x[i] * y);
+        z.x[i] = (carry % UI64_BASE);
+        carry /= UI64_BASE;
+    }
+    if (ov != NULL)
+        *ov = carry;
+    return z;
+}
+
+/*
+  =   2078 [q]
+   0615367 [x] : 296 [y]
+  -0592    [dq]
+  -----
+  = 0233
+   -0000   [dq]
+   -----
+   = 2336
+    -2072  [dq]
+    -----
+    = 2647
+     -2308 [dq]
+     -----
+     = 279 [r]
+ */
+ui64_t ui64_div(ui64_t x, ui64_t y, ui64_t *ov)
+{
+    ui64_t q;
+    ui64_t r;
+    int i;
+    int n, m;
+    int ovn;
+
+    /* determine actual number of involved digits */
+    n = ui64_len(x);
+    m = ui64_len(y);
+
+    if (m == 1) {
+        /* simple case #1: reduceable to ui64_divn() */
+        if (y.x[0] == 0) {
+            /* error case: division by zero! */
+            ui64_fill(q, 0);
+            ui64_fill(r, 0);
+        }
+        else {
+            q = ui64_divn(x, y.x[0], &amp;ovn);
+            ui64_fill(r, 0);
+            r.x[0] = (unsigned char)ovn;
+        }
+
+    } else if (n &lt; m) {
+        /* simple case #2: everything is in the remainder */
+        ui64_fill(q, 0);
+        r = x;
+
+    } else { /* n &gt;= m, m &gt; 1 */
+        /* standard case: x[0..n] / y[0..m] */
+        UIXX_T(UI64_DIGITS+1) rx;
+        UIXX_T(UI64_DIGITS+1) dq;
+        ui64_t t;
+        int km;
+        int k;
+        int qk;
+        unsigned long y2;
+        unsigned long r3;
+        int borrow;
+        int d;
+
+        /* rx is x with a leading zero in order to make
+           sure that n &gt; m and not just n &gt;= m */
+        memcpy(rx.x, x.x, UI64_DIGITS);
+        rx.x[UI64_DIGITS] = 0;
+
+        for (k = n - m; k &gt;= 0; k--) {
+            /* efficiently compute qk by guessing
+               qk := rx[k+m-2...k+m]/y[m-2...m-1] */
+            km = k + m;
+            y2 = (y.x[m-1]*UI64_BASE) + y.x[m-2];
+            r3 = (rx.x[km]*(UI64_BASE*UI64_BASE)) +
+                 (rx.x[km-1]*UI64_BASE) + rx.x[km-2];
+            qk = r3 / y2;
+            if (qk &gt;= UI64_BASE)
+                qk = UI64_BASE - 1;
+
+            /* dq := y*qk (post-adjust qk if guessed incorrectly) */
+            t = ui64_muln(y, qk, &amp;ovn);
+            memcpy(dq.x, t.x, UI64_DIGITS);
+            dq.x[m] = (unsigned char)ovn;
+            for (i = m; i &gt; 0; i--)
+                if (rx.x[i+k] != dq.x[i])
+                    break;
+            if (rx.x[i+k] &lt; dq.x[i]) {
+                t = ui64_muln(y, --qk, &amp;ovn);
+                memcpy(dq.x, t.x, UI64_DIGITS);
+                dq.x[m] = (unsigned char)ovn;
+            }
+
+            /* store qk */
+            q.x[k] = (unsigned char)qk;
+
+            /* rx := rx - dq*(b^k) */
+            borrow = 0;
+            for (i = 0; i &lt; m+1; i++) {
+                d = ((rx.x[k+i] + UI64_BASE) - borrow - dq.x[i]);
+                rx.x[k+i] = (d % UI64_BASE);
+                borrow = (1 - (d/UI64_BASE));
+            }
+        }
+        memcpy(r.x, rx.x, m);
+
+        /* fill out results with leading zeros */
+        for (i = n-m+1; i &lt; UI64_DIGITS; i++)
+            q.x[i] = 0;
+        for (i = m; i &lt; UI64_DIGITS; i++)
+            r.x[i] = 0;
+    }
+
+    /* provide results */
+    if (ov != NULL)
+        *ov = r;
+    return q;
+}
+
+ui64_t ui64_divn(ui64_t x, int y, int *ov)
+{
+    ui64_t z;
+    unsigned int carry;
+    int i;
+
+    carry = 0;
+    for (i = (UI64_DIGITS - 1); i &gt;= 0; i--) {
+        carry = (carry * UI64_BASE) + x.x[i];
+        z.x[i] = (carry / y);
+        carry %= y;
+    }
+    if (ov != NULL)
+        *ov = carry;
+    return z;
+}
+
+ui64_t ui64_and(ui64_t x, ui64_t y)
+{
+    ui64_t z;
+    int i;
+
+    for (i = 0; i &lt; UI64_DIGITS; i++)
+        z.x[i] = (x.x[i] &amp; y.x[i]);
+    return z;
+}
+
+ui64_t ui64_or(ui64_t x, ui64_t y)
+{
+    ui64_t z;
+    int i;
+
+    for (i = 0; i &lt; UI64_DIGITS; i++)
+        z.x[i] = (x.x[i] | y.x[i]);
+    return z;
+}
+
+ui64_t ui64_xor(ui64_t x, ui64_t y)
+{
+    ui64_t z;
+    int i;
+
+    for (i = 0; i &lt; UI64_DIGITS; i++)
+        z.x[i] = ((x.x[i] &amp; ~(y.x[i])) | (~(x.x[i]) &amp; (y.x[i])));
+    return z;
+}
+
+ui64_t ui64_not(ui64_t x)
+{
+    ui64_t z;
+    int i;
+
+    for (i = 0; i &lt; UI64_DIGITS; i++)
+        z.x[i] = ~(x.x[i]);
+    return z;
+}
+
+ui64_t ui64_rol(ui64_t x, int s, ui64_t *ov)
+{
+    UIXX_T(UI64_DIGITS+UI64_DIGITS) zx;
+    ui64_t z;
+    int i;
+    int carry;
+
+    if (s &lt;= 0) {
+        /* no shift at all */
+        if (ov != NULL)
+            *ov = ui64_zero();
+        return x;
+    }
+    else if (s &gt; 64) {
+        /* too large shift */
+        if (ov != NULL)
+            *ov = ui64_zero();
+        return ui64_zero();
+    }
+    else if (s == 64) {
+        /* maximum shift */
+        if (ov != NULL)
+            *ov = x;
+        return ui64_zero();
+    }
+    else { /* regular shift */
+        /* shift (logically) left by s/8 bytes */
+        for (i = 0; i &lt; UI64_DIGITS+UI64_DIGITS; i++)
+            zx.x[i] = 0;
+        for (i = 0; i &lt; UI64_DIGITS; i++)
+            zx.x[i+(s/8)] = x.x[i];
+        /* shift (logically) left by remaining s%8 bits */
+        s %= 8;
+        if (s &gt; 0) {
+            carry = 0;
+            for (i = 0; i &lt; UI64_DIGITS+UI64_DIGITS; i++) {
+                carry += (zx.x[i] * (1 &lt;&lt; s));
+                zx.x[i] = (carry % UI64_BASE);
+                carry /= UI64_BASE;
+            }
+        }
+        memcpy(z.x, zx.x, UI64_DIGITS);
+        if (ov != NULL)
+            memcpy((*ov).x, &amp;zx.x[UI64_DIGITS], UI64_DIGITS);
+    }
+    return z;
+}
+
+ui64_t ui64_ror(ui64_t x, int s, ui64_t *ov)
+{
+    UIXX_T(UI64_DIGITS+UI64_DIGITS) zx;
+    ui64_t z;
+    int i;
+    int carry;
+
+    if (s &lt;= 0) {
+        /* no shift at all */
+        if (ov != NULL)
+            *ov = ui64_zero();
+        return x;
+    }
+    else if (s &gt; 64) {
+        /* too large shift */
+        if (ov != NULL)
+            *ov = ui64_zero();
+        return ui64_zero();
+    }
+    else if (s == 64) {
+        /* maximum shift */
+        if (ov != NULL)
+            *ov = x;
+        return ui64_zero();
+    }
+    else { /* regular shift */
+        /* shift (logically) right by s/8 bytes */
+        for (i = 0; i &lt; UI64_DIGITS+UI64_DIGITS; i++)
+            zx.x[i] = 0;
+        for (i = 0; i &lt; UI64_DIGITS; i++)
+            zx.x[UI64_DIGITS+i-(s/8)] = x.x[i];
+        /* shift (logically) right by remaining s%8 bits */
+        s %= 8;
+        if (s &gt; 0) {
+            carry = 0;
+            for (i = (UI64_DIGITS+UI64_DIGITS - 1); i &gt;= 0; i--) {
+                carry = (carry * UI64_BASE) + zx.x[i];
+                zx.x[i] = (carry / (1 &lt;&lt; s));
+                carry %= (1 &lt;&lt; s);
+            }
+        }
+        memcpy(z.x, &amp;zx.x[UI64_DIGITS], UI64_DIGITS);
+        if (ov != NULL)
+            memcpy((*ov).x, zx.x, UI64_DIGITS);
+    }
+    return z;
+}
+
+int ui64_cmp(ui64_t x, ui64_t y)
+{
+    int i;
+
+    i = UI64_DIGITS - 1;
+    while (i &gt; 0 &amp;&amp; x.x[i] == y.x[i])
+        i--;
+    return (x.x[i] - y.x[i]);
+}
+
+int ui64_len(ui64_t x)
+{
+    int i;
+
+    for (i = UI64_DIGITS; i &gt; 1 &amp;&amp; x.x[i-1] == 0; i--)
+        ;
+    return i;
+}
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_ui64h"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_ui64.h (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_ui64.h                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_ui64.h        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,113 @@
</span><ins>+/*
+**  OSSP ui64 - 64-Bit Arithmetic
+**  Copyright (c) 2002-2005 Ralf S. Engelschall &lt;rse@engelschall.com&gt;
+**  Copyright (c) 2002-2005 The OSSP Project &lt;http://www.ossp.org/&gt;
+**
+**  This file is part of OSSP ui64, a 64-bit arithmetic library
+**  which can be found at http://www.ossp.org/pkg/lib/ui64/.
+**
+**  Permission to use, copy, modify, and distribute this software for
+**  any purpose with or without fee is hereby granted, provided that
+**  the above copyright notice and this permission notice appear in all
+**  copies.
+**
+**  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+**  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+**  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+**  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
+**  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+**  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+**  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+**  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+**  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+**  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+**  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+**  SUCH DAMAGE.
+**
+**  ui64.h: API declaration
+*/
+
+#ifndef __UI64_H__
+#define __UI64_H__
+
+#include &lt;string.h&gt;
+
+#define UI64_PREFIX uuid_
+
+/* embedding support */
+#ifdef UI64_PREFIX
+#if defined(__STDC__) || defined(__cplusplus)
+#define __UI64_CONCAT(x,y) x ## y
+#define UI64_CONCAT(x,y) __UI64_CONCAT(x,y)
+#else
+#define __UI64_CONCAT(x) x
+#define UI64_CONCAT(x,y) __UI64_CONCAT(x)y
+#endif
+#define ui64_t     UI64_CONCAT(UI64_PREFIX,ui64_t)
+#define ui64_zero  UI64_CONCAT(UI64_PREFIX,ui64_zero)
+#define ui64_max   UI64_CONCAT(UI64_PREFIX,ui64_max)
+#define ui64_n2i   UI64_CONCAT(UI64_PREFIX,ui64_n2i)
+#define ui64_i2n   UI64_CONCAT(UI64_PREFIX,ui64_i2n)
+#define ui64_s2i   UI64_CONCAT(UI64_PREFIX,ui64_s2i)
+#define ui64_i2s   UI64_CONCAT(UI64_PREFIX,ui64_i2s)
+#define ui64_add   UI64_CONCAT(UI64_PREFIX,ui64_add)
+#define ui64_addn  UI64_CONCAT(UI64_PREFIX,ui64_addn)
+#define ui64_sub   UI64_CONCAT(UI64_PREFIX,ui64_sub)
+#define ui64_subn  UI64_CONCAT(UI64_PREFIX,ui64_subn)
+#define ui64_mul   UI64_CONCAT(UI64_PREFIX,ui64_mul)
+#define ui64_muln  UI64_CONCAT(UI64_PREFIX,ui64_muln)
+#define ui64_div   UI64_CONCAT(UI64_PREFIX,ui64_div)
+#define ui64_divn  UI64_CONCAT(UI64_PREFIX,ui64_divn)
+#define ui64_and   UI64_CONCAT(UI64_PREFIX,ui64_and)
+#define ui64_or    UI64_CONCAT(UI64_PREFIX,ui64_or)
+#define ui64_xor   UI64_CONCAT(UI64_PREFIX,ui64_xor)
+#define ui64_not   UI64_CONCAT(UI64_PREFIX,ui64_not)
+#define ui64_rol   UI64_CONCAT(UI64_PREFIX,ui64_rol)
+#define ui64_ror   UI64_CONCAT(UI64_PREFIX,ui64_ror)
+#define ui64_len   UI64_CONCAT(UI64_PREFIX,ui64_len)
+#define ui64_cmp   UI64_CONCAT(UI64_PREFIX,ui64_cmp)
+#endif
+
+typedef struct {
+    unsigned char x[8]; /* x_0, ..., x_7 */
+} ui64_t;
+
+#define ui64_cons(x7,x6,x5,x4,x3,x2,x1,x0) \
+    { { 0x##x0, 0x##x1, 0x##x2, 0x##x3, 0x##x4, 0x##x5, 0x##x6, 0x##x7 } }
+
+/* particular values */
+extern ui64_t        ui64_zero (void);
+extern ui64_t        ui64_max  (void);
+
+/* import and export via ISO-C &quot;unsigned long&quot; */
+extern ui64_t        ui64_n2i  (unsigned long n);
+extern unsigned long ui64_i2n  (ui64_t x);
+
+/* import and export via ISO-C string of arbitrary base */
+extern ui64_t        ui64_s2i  (const char *str, char **end, int base);
+extern char *        ui64_i2s  (ui64_t x, char *str, size_t len, int base);
+
+/* arithmetical operations */
+extern ui64_t        ui64_add  (ui64_t x, ui64_t y, ui64_t *ov);
+extern ui64_t        ui64_addn (ui64_t x, int    y, int    *ov);
+extern ui64_t        ui64_sub  (ui64_t x, ui64_t y, ui64_t *ov);
+extern ui64_t        ui64_subn (ui64_t x, int    y, int    *ov);
+extern ui64_t        ui64_mul  (ui64_t x, ui64_t y, ui64_t *ov);
+extern ui64_t        ui64_muln (ui64_t x, int    y, int    *ov);
+extern ui64_t        ui64_div  (ui64_t x, ui64_t y, ui64_t *ov);
+extern ui64_t        ui64_divn (ui64_t x, int    y, int    *ov);
+
+/* bit operations */
+extern ui64_t        ui64_and  (ui64_t x, ui64_t y);
+extern ui64_t        ui64_or   (ui64_t x, ui64_t y);
+extern ui64_t        ui64_xor  (ui64_t x, ui64_t y);
+extern ui64_t        ui64_not  (ui64_t x);
+extern ui64_t        ui64_rol  (ui64_t x, int s, ui64_t *ov);
+extern ui64_t        ui64_ror  (ui64_t x, int s, ui64_t *ov);
+
+/* other operations */
+extern int           ui64_len  (ui64_t x);
+extern int           ui64_cmp  (ui64_t x, ui64_t y);
+
+#endif /* __UI64_H__ */
+
</ins></span></pre></div>
<a id="freeswitchtrunklibsuuiduuid_versh"></a>
<div class="addfile"><h4>Added: freeswitch/trunk/libs/uuid/uuid_vers.h (0 => 16021)</h4>
<pre class="diff"><span>
<span class="info">--- freeswitch/trunk/libs/uuid/uuid_vers.h                                (rev 0)
+++ freeswitch/trunk/libs/uuid/uuid_vers.h        2009-12-22 19:10:16 UTC (rev 16021)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+/*
+**  uuid_vers.h -- Version Information for OSSP uuid (syntax: C/C++)
+**  [automatically generated and maintained by GNU shtool]
+*/
+
+#ifdef _UUID_VERS_H_AS_HEADER_
+
+#ifndef _UUID_VERS_H_
+#define _UUID_VERS_H_
+
+#define _UUID_VERSION 0x106202
+
+typedef struct {
+    const int   v_hex;
+    const char *v_short;
+    const char *v_long;
+    const char *v_tex;
+    const char *v_gnu;
+    const char *v_web;
+    const char *v_sccs;
+    const char *v_rcs;
+} _uuid_version_t;
+
+extern _uuid_version_t _uuid_version;
+
+#endif /* _UUID_VERS_H_ */
+
+#else /* _UUID_VERS_H_AS_HEADER_ */
+
+#define _UUID_VERS_H_AS_HEADER_
+#include &quot;uuid_vers.h&quot;
+#undef  _UUID_VERS_H_AS_HEADER_
+
+_uuid_version_t _uuid_version = {
+    0x106202,
+    &quot;1.6.2&quot;,
+    &quot;1.6.2 (04-Jul-2008)&quot;,
+    &quot;This is OSSP uuid, Version 1.6.2 (04-Jul-2008)&quot;,
+    &quot;OSSP uuid 1.6.2 (04-Jul-2008)&quot;,
+    &quot;OSSP uuid/1.6.2&quot;,
+    &quot;@(#)OSSP uuid 1.6.2 (04-Jul-2008)&quot;,
+    &quot;$Id: OSSP uuid 1.6.2 (04-Jul-2008) $&quot;
+};
+
+#endif /* _UUID_VERS_H_AS_HEADER_ */
+
</ins></span></pre>
</div>
</div>
<div id="footer">See you at ClueCon</div>

</body>
</html>